hadathna-mcp
An MCP server for read-only research over Sahih al-Bukhari via Hadathna: search and retrieve hadiths, narrator profiles/biographies, and topics.
Search hadiths by phrase, book, topic, or narrator ID, with pagination and total counts.
Fetch a hadith number’s full entry: sanad, matn, tawabi, chains, topics, and citation/page URL.
Search narrators by name and get rank, hadith counts, and top teachers/students.
Retrieve source-by-source classical biographies for a narrator.
List topics with entry counts for exact topic filtering.
Inputs are Arabic; diacritics and hamza forms are normalized; all tools are read-only.
The schema exposes 6 tools; README also advertises
search_hadiths_by_meaningandverify_quote, which are absent from this schema.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@hadathna-mcp ما هو حديث بدء الوحي؟"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
hadathana-mcp
An MCP server over Sahih al-Bukhari: its hadiths, their chains of narrators, and the narrators' biographies. Any MCP client (Claude, Codex, Cursor, VS Code, your own agent) can ask it questions, and the model answers with hadith numbers it can cite.
It reads the public Hadathna API (https://api.hadathana.app). No key, no account.
Tools
Tool | What it does |
| Search by words in the text, narrator, book or topic; at most 20 entries a page, each with its |
| Search by meaning: the idea in other words; write the query in Arabic; at most 20 entries |
| The whole entry for a hadith number: sanad, matn, tawabi, chains (each with a |
| Check that quoted words occur letter for letter in a hadith's sanad or matn, in one hadith ( |
| Find a narrator's |
| Name, rank, hadith count, top teachers and students, each with |
| What the classical tarajim books say, source by source: each source keeps its end within a per-source limit and a total budget; |
| The topics hadiths are tagged with |
All tools are read-only. Inputs are Arabic; diacritics and hamza forms do not matter.
page_url is the reader's page on Hadathana (https://www.hadathana.app/hadith/<number> or
/narrator/<id>), the link to cite. The source site's page is not returned.
Every hadith entry also carries citation, the reference in words, built only from the
entry's own book, chapter and hadith numbers (Western digits, every number listed):
«صحيح البخاري، كتاب الصوم، باب وجوب صوم رمضان، رقم (1891)». It names no edition, volume or
page. Cite a hadith with citation and page_url together.
Search results stay small: at most 20 entries per call, and a matn longer than 800
characters is cut to its first 800 with «…» and matn_truncated: true; get_hadith
returns the whole matn. Page through search_hadiths with offset and next_offset.
verify_quote takes the quoted words (text, 2 to 300 characters) and, optionally, a
hadith number. It ignores diacritics, tatweel, hamza forms, ة/ه, ى/ي, punctuation and
spacing, and matches whole words only. Without number it finds candidates with the phrase
search and reads up to 5 entries in full, so a call makes at most 8 API requests and
returns at most 3 matches. found: false means not letter for letter; for a paraphrase,
use search_hadiths_by_meaning.
A refused argument (a number out of range, a search with nothing to filter by) comes
back as a sentence that says what to try instead, not as a validation dump.
Each chain's summary reads the chain in order, from al-Bukhari's teacher to the
last link, without adding a name the data does not hold.
The evals in evals/ score 21 Arabic questions end to end — the answer, the tools called and
the bytes those tools returned — without an LLM judge; evals/README.md shows how to run them.
Related MCP server: hadith-mcp
Install
It needs uv. uvx downloads and runs the one version you pin.
Claude Code
claude mcp add hadathna -- uvx hadathana-mcp@0.2.0Claude Desktop, Cursor, VS Code (the mcpServers block of the client's config)
{
"mcpServers": {
"hadathna": { "command": "uvx", "args": ["hadathana-mcp@0.2.0"] }
}
}Codex (~/.codex/config.toml)
[mcp_servers.hadathna]
command = "uvx"
args = ["hadathana-mcp@0.2.0"]Then ask, for example: «ما هو حديث بدء الوحي؟» or «من هو أبو هريرة؟».
Settings
Variable | Default | Use |
|
| Point at another copy of the API, such as a local one |
|
| Point |
|
| Address for |
|
| Port for |
| the package's default | Host headers |
|
| Tool calls that may run at once; one that waits over 10 seconds for a slot is told to retry |
Remote
https://mcp.hadathana.app/mcp is a hosted Streamable HTTP copy: the same eight tools, no
sign-in and no key. It is public and read-only, rate limited per client, and the
container holds no secret — it reaches only the public API.
claude.ai — Customize > Connectors > Add custom connector, URL
https://mcp.hadathana.app/mcp, Authentication «No sign in».
Claude Code
claude mcp add --transport http hadathna https://mcp.hadathana.app/mcpCursor (the mcpServers block of the client's config)
{
"mcpServers": {
"hadathna": { "url": "https://mcp.hadathana.app/mcp" }
}
}Codex
codex mcp add hadathna --url https://mcp.hadathana.app/mcpChatGPT — on Business, Enterprise and Edu plans, add it as a custom MCP server with
URL https://mcp.hadathana.app/mcp and No authentication.
The same server runs on your machine over stdio, as installed above.
What it sends
Each call to the API carries two headers, User-Agent: hadathna-mcp/<version> and
X-MCP-Tool: <tool name>, so the API can count calls per tool and version. Nothing
else is sent: not your question, not the model's text, no identifier.
Source
github.com/abdelrahmaan/hadathana-mcp.
License
MIT. See LICENSE.
Available Tools
6 toolsget_hadithARead-onlyInspect
Get every entry that holds a hadith number: sanad, matn, tawabi and chains.
A number can sit in more than one entry (221, 4952 and 5472 do), and an entry can hold several consecutive hadiths; hadith_numbers lists them all.
Inputs: number (required). Returns: Every entry that holds one hadith number: two, for 221, 4952 and 5472.
get_narratorARead-onlyInspect
Get a narrator's name, rank, hadith count, and top teachers and students.
Teachers and students are ranked by the hadiths they share with this narrator.
Inputs: narrator_id (required), limit. Returns: era, rank, kunya, location, +9 more
get_narrator_biographyARead-onlyInspect
Get what the classical books of tarajim say about a narrator, source by source.
Long: call it only when the user asks about the narrator's life or reliability.
Inputs: narrator_id (required). Returns: url, sources, narrator_id
list_topicsARead-onlyInspect
List the topics hadiths are tagged with, and how many entries carry each.
Use it to find the exact topic name before search_hadiths(topic=...), which matches the name exactly.
Inputs: no named parameters. Returns: items
search_hadithsARead-onlyInspect
Search Sahih al-Bukhari's hadiths by words in the text, narrator, book or topic.
Filters combine (AND). Each result is an entry with its hadith numbers and its whole matn; call get_hadith for the sanad, the chains and the full text.
total is how many entries match. To count, call with limit=1 and read total. A total of 0 means nothing matched: try a shorter phrase, or check the topic with list_topics.
Inputs: book, limit, query, topic, +2 more. Returns: total, offset, results, next_offset
search_narratorsARead-onlyInspect
Find narrators by name, to get the narrator_id the other tools take.
Inputs: name (required), limit, offset. Returns: total, offset, results, next_offset
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Search vs. fetch pairs are clearly separated (search_hadiths/get_hadith, search_narrators/get_narrator), and list_topics is unambiguous. The one soft boundary is get_narrator vs get_narrator_biography: get_narrator already reports rank/reliability, while the biography tool covers classical-source material on 'life or reliability', so an agent may hesitate between them, though the descriptions give a usable rule of thumb.
Every tool follows a clean verb_noun snake_case pattern: search_*, get_*, list_*. The singular get_hadith vs plural search_hadiths is a deliberate semantic distinction (fetch one number vs. search many), not an inconsistency.
Six tools is a tight, well-scoped set for a single-collection hadith corpus: two search tools, two fetch tools, a biography lookup, and a topic directory. It is on the lean side — nothing for browsing books/chapters directly — but each tool clearly earns its place.
Core lifecycles are covered: discover via search (hadith, narrator, topic), then retrieve full entries with sanad/matn/chains and narrator details. The notable gap is that topics get a list_topics discovery helper for exact-name matching, but 'book' is also a search filter with no equivalent listing tool, so agents must guess book names; a book/chapter listing would close the loop.
Maintenance
Related MCP Connectors
Read-only search of the Quran, hadith and classical books of the four Sunni schools, with citations.
Quran, hadith collections and tafsirs: browse books and chapters, read verses, full-text search
Quran MCP — Al-Quran Cloud API. Surahs (chapters), ayahs (verses), translations, and full-text…
Islamic prayer times & calendar MCP (Aladhan API). Keyless.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables fetching and searching canonical hadith texts (Arabic and English) with cross-references and citation-safe URLs for assistants, built on FastMCP.3GPL 3.0
- AlicenseNot gradedqualityBmaintenanceAn MCP server for retrieving hadith text and metadata from auditable sources, providing exact references, Arabic text, English translations, and source-attributed grading.MIT
- AlicenseNot gradedqualityDmaintenanceMCP server to search and retrieve passages from a corpus of 7,872 classical Islamic books via the Sahifah API, with full citations and mu'tabar filtering.1MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI assistants and developers to query Quranic verses, Hadith, Tafsir, and classical Islamic heritage texts through a single federated MCP endpoint with unified tools and caching.2-