Skip to main content

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_hadiths Search by words in the text, narrator, book or topic; at most 20 entries a page, each with its citation and page_url
search_hadiths_by_meaning Search by meaning: the idea in other words; write the query in Arabic; at most 20 entries
get_hadith The whole entry for a hadith number: sanad, matn, tawabi, chains (each with a summary in words), its citation and its page_url
verify_quote Check that quoted words occur letter for letter in a hadith's sanad or matn, in one hadith (number) or the whole book; each match gives the entry's own wording, the text around it, whether the sentence goes on, citation and page_url
search_narrators Find a narrator's narrator_id by name; each result carries its page_url
get_narrator Name, rank, hadith count, top teachers and students, each with page_url
get_narrator_biography What the classical tarajim books say, source by source: each source keeps its end within a per-source limit and a total budget; source and offset read one source fully in pages
list_topics 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.

Install

It needs uv. uvx downloads and runs the one version you pin.

Claude Code

claude mcp add hadathna -- uvx hadathana-mcp@0.2.0

Claude 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
HADATHNA_API_URL https://api.hadathana.app Point at another copy of the API, such as a local one
HADATHNA_SITE_URL https://www.hadathana.app Point page_url at another copy of the site
HADATHNA_HTTP_HOST 127.0.0.1 Address for --http; the container sets 0.0.0.0
HADATHNA_HTTP_PORT 8765 Port for --http; --port wins over it
HADATHNA_ALLOWED_HOSTS the package's default Host headers --http accepts, comma-separated, such as mcp.hadathana.app,mcp-dev.hadathana.app
HADATHNA_MAX_CONCURRENT 16 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/mcp

Cursor (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/mcp

ChatGPT — 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.

Metadata

Release files for hadathana-mcp 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hadathana-mcp 0.2.0
File Size Uploaded Provenance Actions
hadathana_mcp-0.2.0.tar.gz 23.5 kB Without provenance Details for hadathana_mcp-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hadathana-mcp 0.2.0
File Interpreter ABI Platform Actions
hadathana_mcp-0.2.0-py3-none-any.whl Python 3 none any Details for hadathana_mcp-0.2.0-py3-none-any.whl

Total release size: 50.1 kB

Release files / hadathana_mcp-0.2.0.tar.gz

Download URL hadathana_mcp-0.2.0.tar.gz
Size 23.5 kB
Tags Source
SHA-256 checksum
How to use checksums
39fc6b3e02de047ac88ee7f9d45ff08aa1125be5816c48d71f4a9ebd43fc059a
BLAKE2b-256 checksum
How to use checksums
5968e3c7208ae91df1898c421d85fe11bd356a3b2c2cd9c539d1fe23089ade18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.13 {"installer":{"name":"uv","version":"0.13.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / hadathana_mcp-0.2.0-py3-none-any.whl

Download URL hadathana_mcp-0.2.0-py3-none-any.whl
Size 26.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98925385101e32d0df3ea1c7adf61d0410caf899358195c9bf934f32a8f4ae36
BLAKE2b-256 checksum
How to use checksums
8240c6129d6e5e3ed13ca2ef4ae3b3b0660c6be9406c612b6debd7fb2076ca6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.13 {"installer":{"name":"uv","version":"0.13.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for hadathana-mcp 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page