From Hallucination to Precision: How Sefaria MCP Transforms AI-Powered Talmud Study and Research
Outline
From Hallucination to Precision: How Sefaria MCP Transforms AI-Powered Talmud Study and Research
The Problem I Identified
Enter Model Context Protocol (MCP)
What ChatGPT and Claude Can Actually Do Now
The Impact for those studying and researching
Technical Note - Which Sefaria MCP tools work, and which don’t
Working Tools (10/15)
Not Working Tools (5/15)
Technical References: Relevant Links and Documentation
Appendix 1 - Screenshots
Chatgpt
Claude
Appendix 2 - Testing Usage of Sefaria MCP on ‘ ‘When a King Sins’: Sin, Reward, and Responsibility in Talmudic Theology (Horayot 10a-b)’
Claude
Leadership as Servitude
The Concept of Aveira Li-shmah (Transgression for the Sake of Heaven)
Theodicy and Divine Justice
Lot and His Daughters: Intention Determining Morality
The Biblical Source: Ecclesiastes on Divine Justice
The Story of Lot and His Daughters
ChatGPT
Authority as service / leadership burdens; Gamliel & Yehoshua (parallel to your Horayot scene)
Euphemistic speech; Amon/Moav tone & reward for refined language
Aveira li-shmah vs. mitzvah she-lo li-shmah; Yael, Balak→Ruth; “always do, even not for its own sake”
Suffering, reward, theodicy (your Kohelet/Hosea section’s themes echoed)
Clean language and Moav/Amon (again), but from the halakhic/aggadic angle you noted
The Problem I Identified
Back in June, I wrote about a fundamental issue plaguing AI-assisted Jewish text study: When I asked Claude or ChatGPT about specific Talmudic passages, they would try to recall information from their training data, and frequently get it wrong. The AI systems were recalling vaguely, leading to misquoted passages, incorrect attributions, and the kind of scholarly errors that can completely change meaning.
I demonstrated this problem by showing how AI systems, despite having access to web search, consistently failed to properly query Sefaria's API. Even with detailed documentation and custom instructions, they wouldn't reliably access the authoritative sources. Instead, they'd generate plausible-sounding but often inaccurate responses about Jewish texts, essentially creating sophisticated hallucinations.
This was particularly frustrating because Sefaria's API is remarkably open—no authentication keys, no complex setup. Anyone can query https://www.sefaria.org/api/texts/Berakhot.2b and get both Hebrew text and English translation in structured JSON. The technology was there, but AI systems weren't using it properly.
Enter Model Context Protocol (MCP)
The solution arrived with Model Context Protocol (MCP), announced by Anthropic in November 2024. MCP is a standardized way for AI systems to connect with external data sources and tools in real-time. Think of it as a universal adapter that lets AI models plug into databases, APIs, and other resources during conversation, rather than relying solely on their training data.
MCP works through servers that expose specific functionalities to AI clients.
Sefaria now has an MCP server; essentially a bridge between Claude and Sefaria's vast library. This was exactly what I needed to solve the "grounding" problem I had identified. Instead of AI systems vaguely trying to recall Jewish texts from training data, they can now access authoritative sources directly.
Now, when I ask ChatGPT or Claude a question about Talmud, instead of trying to remember what it learned during training, it can actively query external resources through MCP tools and return authoritative, real-time information.
The Sefaria MCP server exposes multiple functions:
get_text
: Retrieves specific passages with both Hebrew and Englishtext_search
: Searches across the entire corpusget_current_calendar
: Shows today's Daf Yomi and other learning cyclesget_links_between_texts
: Finds cross-references and connectionsget_topic_details
: Provides comprehensive information about subjects
The server needs to actively be set up for it to work. I set up my own fork of the Sefaria MCP server on Render.com, which provides reliable (and free) cloud hosting for the server.
What ChatGPT and Claude Can Actually Do Now
The transformation is remarkable. When I ask ChatGPT or Claude about today's Daf Yomi, it doesn't guess, it queries the actual calendar and retrieves Horayot 14a with complete Hebrew and English text. When I want to explore cross-references for the Shema (Deuteronomy 6:4), Claude returns hundreds of actual connections across Mishnah, Talmud, medieval commentaries, and modern scholarship.
This enables entirely new research workflows:
Verification and Citation: Claude can now check actual sources when someone claims a text says something specific. No more taking quotes on faith—the AI retrieves and displays the actual passage.
Contextual Analysis: Instead of isolated quotes, Claude pulls surrounding passages that clarify meaning. It can show you not just what Rashi says on a particular verse, but also related comments from other medieval commentators.
Cross-Textual Research: Need to find all Talmudic discussions of a particular concept? Claude can search the entire corpus and return relevant passages with their exact locations.
Real-Time Accuracy: By accessing Sefaria directly rather than relying on training data, the system dramatically reduces the risk of propagating errors or outdated information.
The Impact for those studying and researching
What we have now is closer to a research assistant than a text generator. When I'm studying a difficult Talmudic passage, I can ask ChatGPT or Claude to pull up parallel discussions, trace conceptual developments across tractates, or examine how different commentators approach the same issue—all while working with the actual authoritative texts.
The difference between "ChatGPT thinks the Talmud says X" and "ChatGPT retrieved this exact passage from Sanhedrin 99a" is transformative for serious scholarship. Every claim can be traced back to its source, every quote can be verified, and every analysis can be grounded in actual texts rather than AI-generated approximations.
This represents a fundamental shift from AI as a potentially unreliable oracle to AI as a powerful research tool that enhances rather than replaces careful textual study. For anyone engaged in serious Jewish learning, this changes everything.
The infrastructure is finally catching up to the promise. Instead of fighting with AI systems that hallucinate about Jewish texts, we now have tools that can access, analyze, and cross-reference the entire Jewish literary corpus with precision.
Technical Note - Which Sefaria MCP tools work, and which don’t
Some of Sefaria’s MCP tools don’t work correctly and are broken.
Bottom line, get_text
is the primary useful tool; search is mostly broken.
Based on Claude’s testing, this the breakdown; this is Claude’s verbatim response; link to convo:
https://claude.ai/share/fca7e3a7-ffa8-4c2f-b89d-671957144d69
I'll test each Sefaria MCP tool systematically. Let me start with some basic tests:I've systematically tested all 15 Sefaria MCP tools. Here's a concise summary:
Working Tools (10/15):
get_text
- retrieves text contentget_current_calendar
- Jewish calendar infoget_links_between_texts
- cross-referencesget_english_translations
- multiple translationsget_topic_details
- topic informationclarify_name_argument
- name autocompletionget_text_or_category_shape
- text structureget_text_catalogue_info
- bibliographic dataget_available_manuscripts
- manuscript metadataget_manuscript_image
- downloads manuscript images
Not Working Tools (5/15):
text_search
- validation error (returns results instead of JSON string)search_in_book
- validation error (returns results instead of JSON string)search_in_dictionaries
- validation error (returns results instead of JSON string)english_semantic_search
- 404 error (AI API not found)clarify_search_path_filter
- validation error (returns None instead of string)
Main Issues:
Output validation errors - Several search functions return actual data arrays instead of JSON strings as expected
Missing AI API - Semantic search can't access the KNN search endpoint
Type mismatch - One function returns None instead of required string type
The core functionality for text retrieval, calendar, links, and manuscripts works well, but search functionality has implementation issues.
Technical References: Relevant Links and Documentation
ChatGPT:
Claude:
https://support.anthropic.com/en/articles/11503834-building-custom-connectors-via-remote-mcp-servers
Appendix 1 - Screenshots
Chatgpt:
Link to the convo: https://chatgpt.com/share/68c832b9-8b2c-8012-9eff-a7104b95dcfc (note: the shared chat doesn’t show tool calls and responses)
Notice that I have “Developer Mode” and “sefaria-mcp” chosen (I set this up in Settings > Connectors, and connected to my render.com server), I highlighted this with a red arrow:
Claude:
Appendix 2 - Testing Usage of Sefaria MCP on ‘ ‘When a King Sins’: Sin, Reward, and Responsibility in Talmudic Theology (Horayot 10a-b)’
The text in this Appendix is copied verbatim from the responses of Claude and ChatGPT, aside from initial italicized text and my initial query.
Claude
Link to convo:
https://claude.ai/share/b1e09304-ea90-4614-9087-70658b8933f4
Screenshot of part of Claude’s tool calling (sefaria mcp) and “thinking”:
EB:
read this piece, and find related talmudic passages using sefaria mcp tool that you have (not just in tractate horayot), and cite verbatim:
"""
Pt1 ‘When a King Sins’: Sin, Reward, and Responsibility in Talmudic Theology (Horayot 10a-b)
Sep 14, 2025
[....]
Claude:
I'll search for related Talmudic passages that connect to the themes in this rich analysis. Let me start with some key concepts from the piece.Now let me search for related passages that connect to the themes in this rich analysis. I'll look for passages about specific concepts mentioned in the text.I've found several fascinating related Talmudic passages that illuminate and expand on the themes explored in this rich analysis of Horayot 10a-b. Here are the key related passages with verbatim citations:
Leadership as Servitude
The biblical foundation for Rabban Gamliel's teaching appears in 1 Kings 12:7:
"וַיְדַבְּרוּ אֵלָיו לֵאמֹר אִם־הַיּוֹם תִּֽהְיֶה־עֶבֶד לָעָם הַזֶּה וַעֲבַדְתָּם וַעֲנִיתָם וְדִבַּרְתָּ אֲלֵיהֶם דְּבָרִים טוֹבִים וְהָיוּ לְךָ עֲבָדִים כׇּל־הַיָּמִים"
"They answered him, 'If you will be a servant to those people today and serve them, and if you respond to them with kind words, they will be your servants always.'"
The Concept of Aveira Li-shmah (Transgression for the Sake of Heaven)
Nazir 23b contains a parallel discussion that expands on themes from Horayot:
"אָמַר עוּלָּא: תָּמָר זִינְּתָה, זִמְרִי זִינָּה. תָּמָר זִינְּתָה — יָצְאוּ מִמֶּנָּה מְלָכִים וּנְבִיאִים. זִמְרִי זִינָּה — נָפְלוּ עָלָיו כַּמָּה רְבָבוֹת מִיִּשְׂרָאֵל"
"Ulla said: Tamar engaged in licentious sexual intercourse with her father-in-law, Judah, and Zimri ben Salu also engaged in licentious sexual intercourse with a Midianite woman. Tamar engaged in licentious sexual intercourse for the sake of a mitzva, to have children, and therefore she merited that kings of the House of David descended from her. And she also merited to be the ancestor of prophets. Conversely, with regard to Zimri, who engaged in licentious sexual intercourse for the purpose of a transgression, several multitudes of Israel fell due to him."
The crucial principle follows:
"אָמַר רַב נַחְמָן בַּר יִצְחָק: גְּדוֹלָה עֲבֵירָה לִשְׁמָהּ מִמִּצְוָה שֶׁלֹּא לִשְׁמָהּ. וְהָאָמַר רַב יְהוּדָה אָמַר רַב: לְעוֹלָם יַעֲסוֹק אָדָם בְּתוֹרָה וּבְמִצְוֹת אֲפִילּוּ שֶׁלֹּא לִשְׁמָן, שֶׁמִּתּוֹךְ שֶׁלֹּא לִשְׁמָן בָּא לִשְׁמָן? אֶלָּא אֵימָא: כְּמִצְוָה שֶׁלֹּא לִשְׁמָהּ"
"Rav Naḥman bar Yitzḥak said: Greater is a transgression committed for its own sake, i.e., for the sake of Heaven, than a mitzva performed not for its own sake. The Gemara questions this comparison: But didn't Rav Yehuda say that Rav said: A person should always occupy himself with Torah and mitzvot even not for their own sake, as it is through acts performed not for their own sake that good deeds for their own sake come about? Rather, one must emend the above statement and say as follows: A transgression for the sake of Heaven is equivalent to a mitzva not for its own sake."
The proof text cited is the same as in Horayot:
"דִּכְתִיב: 'תְּבֹרַךְ מִנָּשִׁים יָעֵל אֵשֶׁת חֶבֶר הַקֵּינִי מִנָּשִׁים בָּאֹהֶל תְּבֹרָךְ'. מַאן נָשִׁים שֶׁבָּאֹהֶל — שָׂרָה רִבְקָה רָחֵל וְלֵאָה"
"As it is written: 'Blessed above women shall Yael be, the wife of Hever the Kenite, above women in the tent she shall be blessed' (Judges 5:24). Who are these 'women in the tent'? They are Sarah, Rebecca, Rachel, and Leah."
Theodicy and Divine Justice
Berakhot 5a contains profound discussions about suffering and divine justice that complement the theodicy themes in Horayot:
"אָמַר רָבָא, וְאִיתֵּימָא רַב חִסְדָּא: אִם רוֹאֶה אָדָם שֶׁיִּסּוּרִין בָּאִין עָלָיו — יְפַשְׁפֵּשׁ בְּמַעֲשָׂיו, שֶׁנֶּאֱמַר: 'נַחְפְּשָׂה דְרָכֵינוּ וְנַחְקֹרָה וְנָשׁוּבָה עַד ה׳'. פִּשְׁפֵּשׁ וְלֹא מָצָא — יִתְלֶה בְּבִטּוּל תּוֹרָה, שֶׁנֶּאֱמַר: 'אַשְׁרֵי הַגֶּבֶר אֲשֶׁר תְּיַסְּרֶנּוּ יָּהּ וּמִתּוֹרָתְךָ תְלַמְּדֶנּוּ'. וְאִם תָּלָה וְלֹא מָצָא — בְּיָדוּעַ שֶׁיִּסּוּרִין שֶׁל אַהֲבָה הֵם, שֶׁנֶּאֱמַר: 'כִּי אֶת אֲשֶׁר יֶאֱהַב ה׳ יוֹכִיחַ'"
"Rava, and some say Rav Ḥisda, said: If a person sees that suffering has befallen him, he should examine his actions. Generally, suffering comes about as punishment for one's transgressions, as it is stated: 'We will search and examine our ways, and return to God' (Lamentations 3:40). If he examined his ways and found no transgression for which that suffering is appropriate, he may attribute his suffering to dereliction in the study of Torah. God punishes an individual for dereliction in the study of Torah in order to emphasize the gravity of the issue, as it is stated: 'Happy is the man whom You punish, Lord, and teach out of Your law' (Psalms 94:12). And if he did attribute his suffering to dereliction in the study of Torah, and did not find this to be so, he may be confident that these are afflictions of love, as it is stated: 'For whom the Lord loves, He rebukes' (Proverbs 3:12)."
The passage also includes this remarkable teaching about suffering as a gift:
"תַּנְיָא, רַבִּי שִׁמְעוֹן בֶּן יוֹחַאי אוֹמֵר: שָׁלֹשׁ מַתָּנוֹת טוֹבוֹת נָתַן הַקָּדוֹשׁ בָּרוּךְ הוּא לְיִשְׂרָאֵל, וְכוּלָּן לֹא נְתָנָן אֶלָּא עַל יְדֵי יִסּוּרִין, אֵלּוּ הֵן: תּוֹרָה וְאֶרֶץ יִשְׂרָאֵל וְהָעוֹלָם הַבָּא"
"It was taught in a baraita with regard to affliction: Rabbi Shimon ben Yoḥai says: The Holy One, Blessed be He, gave Israel three precious gifts, all of which were given only by means of suffering, which purified Israel so that they may merit to receive them. These gifts are: Torah, Eretz Yisrael, and the World-to-Come."
Lot and His Daughters: Intention Determining Morality
Nazir 23b also contains the parallel discussion about Lot:
"דָּרֵשׁ רָבָא וְאִיתֵּימָא רַבִּי יִצְחָק: מַאי דִּכְתִיב 'לְתַאֲוָה יְבַקֵּשׁ נִפְרָד וּבְכׇל תּוּשִׁיָּה יִתְגַּלָּע'? 'לְתַאֲוָה יְבַקֵּשׁ נִפְרָד' — זֶה לוֹט, 'וּבְכָל תּוּשִׁיָּה יִתְגַּלָּע' — שֶׁנִּתְגַּלָּה קְלוֹנוֹ בְּבָתֵּי כְנֵסִיּוֹת וּבְבָתֵּי מִדְרָשׁוֹת. דִּתְנַן: עַמּוֹנִי וּמוֹאָבִי אֲסוּרִין, וְאִיסּוּרָן אִיסּוּר עוֹלָם"
"Rava expounded a verse homiletically, and some say it was Rabbi Yitzḥak: What is the meaning of that which is written: 'He who separates himself seeks his own desire, and snarls against all sound wisdom' (Proverbs 18:1)? 'He who separates himself seeks his own desire,' this is Lot, who separated from Abraham. 'And snarls against all sound wisdom,' this too describes Lot, as his shame was eventually revealed in the synagogues, when his actions recorded in the Torah are read in public, and in the study halls, where the halakhot of his descendants are taught. As we learned in a mishna: An Ammonite and a Moabite are prohibited from entering the congregation by marrying a Jewish woman, and their prohibition is permanent."
The Biblical Source: Ecclesiastes on Divine Justice
The biblical verse that forms the foundation for the theodicy discussion in Horayot is Ecclesiastes 8:14:
"יֶשׁ־הֶבֶל אֲשֶׁר נַעֲשָׂה עַל־הָאָרֶץ אֲשֶׁר יֵשׁ צַדִּיקִים אֲשֶׁר מַגִּיעַ אֲלֵהֶם כְּמַעֲשֵׂה הָרְשָׁעִים וְיֵשׁ רְשָׁעִים שֶׁמַּגִּיעַ אֲלֵהֶם כְּמַעֲשֵׂה הַצַּדִּיקִים אָמַרְתִּי שֶׁגַּם־זֶה הָבֶל"
"Here is a frustration that occurs in the world: sometimes an upright man is requited according to the conduct of the scoundrel; and sometimes the scoundrel is requited according to the conduct of the upright. I say all that is frustration."
The Story of Lot and His Daughters
The biblical narrative that provides the foundation for the moral analysis is Genesis 19:33:
"וַתַּשְׁקֶיןָ אֶת־אֲבִיהֶן יַיִן בַּלַּיְלָה הוּא וַתָּבֹא הַבְּכִירָה וַתִּשְׁכַּב אֶת־אָבִיהָ וְלֹֽא־יָדַע בְּשִׁכְבָהּ וּבְקוּׄמָֽהּ"
"That night they made their father drink wine, and the older one went in and lay with her father; he did not know when she lay down or when she rose."
The dotted vav in "bekumah" becomes the basis for the Talmudic interpretation that Lot was partially aware of what transpired.
These related passages show how the themes in Horayot 10a-b resonate throughout the Talmudic corpus: the paradox of leadership as service, the moral complexity of actions determined by intention, the challenge of theodicy, and the recognition that identical acts can be righteous or sinful depending on the actor's purpose and spiritual state.
ChatGPT
Link to the response: https://chatgpt.com/s/t_68c8f715acdc8191845a6413ddf46874
Awesome piece. Here are closely related sugyot across Shas (beyond Horayot), pulled via Sefaria and quoted verbatim (English Davidson unless noted), grouped by the themes in your write-up. I kept the key lines tight, but included enough surrounding text to preserve the point.
Authority as service / leadership burdens; Gamliel & Yehoshua (parallel to your Horayot scene)
Berakhot 28a — Rabban Gamliel sees R. Yehoshua’s poverty; leadership isn’t glamour, it’s responsibility:
“He reached Rabbi Yehoshua’s house, he saw that the walls of his house were black… Rabbi Yehoshua said to him: Woe unto a generation that you are its leader as you are unaware of the difficulties of Torah scholars, how they make a living and how they feed themselves.” (Berakhot 28a, Davidson)
Hebrew (key line):
אוֹי לוֹ לַדּוֹר שֶׁאַתָּה פַּרְנָסוֹ… (ברכות כח א)
Euphemistic speech; Amon/Moav tone & reward for refined language
Pesachim 3a — classic lashon nekiyyah sugya (matches your “Moab/Amon” language point):
“The tanna… employed a euphemism. … Rabbi Yehoshua ben Levi said: A person should never express a crude matter, as the formulation of a verse was distorted by the addition of eight letters rather than have it express a crude matter…” (Pesachim 3a, Davidson)
Hebrew (opening of that passage):
לְעוֹלָם אַל יוֹצִיא אָדָם דָּבָר מְגוּנֶּה מִפִּיו… (פסחים ג א)
Aveira li-shmah vs. mitzvah she-lo li-shmah; Yael, Balak→Ruth; “always do, even not for its own sake”
Nazir 23b — all the pieces you summarized appear together:
“Rav Naḥman bar Yitzḥak said: A transgression for the sake of Heaven is greater than a mitzva performed not for its own sake. … Jael is more blessed than the women in the tent… One should always engage in Torah/mitzvot even not for their own sake, for from not-for-its-own-sake one comes to for-its-own-sake. … Balak’s forty-two offerings merited Ruth…” (Nazir 23b, Davidson)
(If you want, I can paste more of the unit verbatim; it’s long and tightly interwoven.)
Sotah 22b — the same “do even she-lo li-shmah” principle, very explicit:
“Abaye and Rava both said to that tanna: Do not teach this [that learning/praying ‘out of love/fear’ are ideal and the rest is invalid], for Rav Yehuda said that Rav said: A person should always engage in Torah and mitzvot even if not for their own sake, for from doing them not for their own sake one comes to do them for their own sake.” (Sotah 22b, Davidson)
Suffering, reward, theodicy (your Kohelet/Hosea section’s themes echoed)
Berakhot 5a — “yissurin shel ahavah,” how to read suffering in a righteous life:
“If a person sees that suffering has befallen him, he should examine his actions… If he examined and found none, he may attribute it to dereliction in Torah… And if not, he may be confident that these are afflictions of love… ‘For whom the Lord loves, He rebukes…’” (Berakhot 5a, Davidson)
Hebrew (key lines):
אם רואה אדם שיסורין באין עליו יפשפש במעשיו… ואם תלה ולא מצא בידוע שיסורין של אהבה הן… (ברכות ה א)
Clean language and Moav/Amon (again), but from the halakhic/aggadic angle you noted
(Back to Pesachim 3a, same unit)
“A person should always converse euphemistically, as one finds in the following verses… ‘And you choose the language of the crafty’ (Job 15:5)… ‘My words shall utter the uprightness of my heart’ (Job 33:3).” (Pesachim 3a, Davidson)