التوثيق

البداية السريعة

ثبّت الخادم مرّة، فيعمل مع كلّ مساعد متوافق مع MCP.

claude_desktop_config.json
# 1) Issue an API key in the dashboard at /app
# 2) Add Tafsir MCP to your assistant (Claude Desktop shown):
{
  "mcpServers": {
    "tafsir": {
      "command": "npx",
      "args": ["-y", "mcp-remote",
               "https://tafseer-ai.rascoda.com/mcp",
               "--header", "Authorization: Bearer YOUR_API_KEY"]
    }
  }
}
# 3) Ask your assistant — it now calls authenticated tools, never memory.

أو عبر REST مباشرة:

bash
curl -X POST https://tafseer-ai.rascoda.com/api/v1/tools/fetch_ayah \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"surah": 1, "ayah_start": 1, "ayah_end": 7}'

مرجع الأدوات

مولّد من نفس مخطّطات JSON التي يستخدمها الخادم — مصدر واحد للحقيقة.

fetch_ayah

Retrieve the exact Uthmani text of one Qur'an verse or a continuous range, with sūrah metadata. Use this whenever you need the wording of an āyah; never recite from memory. Returns a validation error for verses that do not exist.

surah :integer *ayah_start :integer *ayah_end :integer | null

fetch_tafsir

Retrieve the verbatim classical tafsir (commentary) for one verse from one or more named editions (ibn_kathir, tabari, saadi, muyassar, jalalayn, qurtubi, baghawi). Every result carries the scholar, work, edition, and source reference. Use this for 'what does the tafsir say about …'; do not paraphrase from memory.

surah :integer *ayah :integer *editions :array

fetch_nuzool_reason

Retrieve the recorded occasion(s) of revelation (asbāb al-nuzūl) for a verse, with the source compilation. Many verses have no recorded occasion — in that case a NOT_AVAILABLE error is returned rather than an invented narrative.

surah :integer *ayah :integer *

search_quran_text

Search the Qur'anic text. mode='exact' matches the verbatim Uthmani string; mode='normalised' ignores diacritics and letter variants; mode='root' finds verses containing any word from a given Arabic root. Returns verse references with snippets — use it to locate where something is said before quoting it.

query :string *mode :any limit :integer

analyze_word

Return the morphological analysis (root, lemma, part-of-speech, grammatical features, surface form) of a single word at a given verse position, backed by the King Saud University Quran Corpus. word_index is 1-based.

surah :integer *ayah :integer *word_index :integer *

find_root_occurrences

Return every occurrence of a given Arabic trilateral/quadrilateral root across the Qur'an (paginated by limit/offset), with the surface form at each position. Matching is diacritic- and hamza-insensitive. Use it to study a root's usage.

root :string *limit :integer offset :integer

الاستضافة الذاتية

كلّ شيء مفتوح المصدر. شغّل نسختك بأمر واحد.

bash
git clone https://github.com/rascoda/tafsir-mcp && cd tafsir-mcp
cp .env.example .env
uv venv && uv pip install -e ".[dev]"
tafsir-ingest all            # build the authentic corpus (~1 min)
tafsir-mcp --transport http  # serve /mcp + /api + dashboard

# or the whole stack with Docker:
docker compose -f deploy/docker-compose.yml up

مصادر المُدوّنة

كلّ طبعة: مصدرها، عالِمها، رخصتها.

العملالمؤلّفالنوعالرخصة
أسباب نزول القرآن (Asbāb al-Nuzūl)علي بن أحمد الواحدي(ت 468هـ)asbabPublic Domain (classical)
Quranic Arabic Corpus — Morphology v0.4Quranic Arabic Corpus (Kais Dukes) — KSUmorphologyGNU GPL / see source
معالم التنزيلالحسين بن مسعود البغوي(ت 516هـ)tafsirPublic Domain (classical)
تفسير القرآن العظيمإسماعيل بن عمر بن كثير الدمشقي(ت 774هـ)tafsirPublic Domain (classical)
تفسير الجلالينجلال الدين المحلّي وجلال الدين السيوطي(ت 911هـ)tafsirPublic Domain (classical)
التفسير الميسرنخبة من العلماء — مجمع الملك فهدtafsirKing Fahd Complex (free distribution)
الجامع لأحكام القرآنمحمد بن أحمد القرطبي(ت 671هـ)tafsirPublic Domain (classical)
تيسير الكريم الرحمن في تفسير كلام المنانعبد الرحمن بن ناصر السعدي(ت 1376هـ)tafsirPublic Domain (classical)
جامع البيان عن تأويل آي القرآنمحمد بن جرير الطبري(ت 310هـ)tafsirPublic Domain (classical)