Tafsir MCP logo

Tafsir MCP

Organization
tafsircenter

Scholarly MCP server for the Holy Quran with 5 classical tafsirs and word-level linguistic analysis — sponsored by Tafsir Center for Quranic Studies

Publishertafsircenter
Repositorytafsir-mcp
LanguagePython
Forks
10
Stars
68
Available tools
0
Transport typestdio, streamable-http
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Tafsir MCP exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    68 stars and 10 forks from the linked repository.

🕌 Tafsir MCP

خادم MCP العلمي للقرآن الكريم — برعاية مركز تفسير للدراسات القرآنية

PyPI License Data License MCP Tafsir Center

العربية · English


🌙 نبذة

خادم Model Context Protocol (MCP) يوفّر وصولاً علمياً موثّقاً للقرآن الكريم لأي مساعد ذكي يدعم MCP (Claude Code، Claude Desktop، VS Code، وغيرها).

كل البيانات مراجعة ومعتمدة من مركز تفسير للدراسات القرآنية.


✨ المميزات

  • 📖 6,236 آية كاملة بالرسم العثماني
  • 📚 5 تفاسير كلاسيكية: الطبري · ابن كثير · البغوي · السعدي · الميسر
  • 🌍 المختصر في التفسير بـ3 لغات (عربي، إنجليزي، بنغالي)
  • 🔤 77,432 كلمة بتحليل لغوي شامل (إعراب، صرف، جذر، رسم)
  • 🔍 1,891 جذر قابل للبحث والإحصاء
  • ⚡ بحث FTS5 سريع مع تطبيع عربي كامل (بدون تشكيل)
  • 🎵 اختلاف القراءات لكل آية وكلمة
  • 📜 أسباب النزول بالإسناد الكامل (201 آية)
  • 📊 إحصاءات تفصيلية لكل سورة وصفحة مصحف
  • 🛡️ حماية صارمة من الهلوسة (Pydantic v2 validation)
  • 📴 يعمل دون إنترنت بعد التثبيت

🚀 التثبيت السريع

لمستخدمي Claude Code:

bash
claude mcp add tafsir --scope user -- uvx tafsir-mcp

للتثبيت اليدوي:

bash
pip install tafsir-mcp
# أو
uvx tafsir-mcp

عند أول تشغيل، سيُحمَّل ملف البيانات (~214 MB) من Hugging Face تلقائياً ويُخزَّن في ~/.cache/tafsir-mcp/.

للمطوّرين (من المصدر):

bash
git clone https://github.com/tafsircenter/tafsir-mcp
cd tafsir-mcp
cp /path/to/quran.db data/quran.db   # أو: export TAFSIR_DB_PATH=/path/to/quran.db
uv sync
uv run tafsir-mcp

🌐 الاستضافة والنشر

الإنتاج مُستضاف على Fly.io (region bom/Mumbai) خلف النطاق الرسمي https://mcp.tafsir.net/mcp (MCP-over-HTTP، فحص صحة على /health). أي عميل يدعم HTTP transport يتّصل مباشرةً دون تثبيت محلي.

نسخة Hugging Face Space السابقة أصبحت أرشيفًا خاصًّا (Private، غير حيّة) — انظر docs/ADR/0001-fly-over-hf-space.md.


🔧 ربط Claude Desktop

أضف إلى ~/Library/Application Support/Claude/claude_desktop_config.json:

json
{
  "mcpServers": {
    "tafsir": {
      "command": "uv",
      "args": [
        "--directory",
        "/Users/YOUR_USERNAME/projects/quranic-scholar-mcp",
        "run",
        "tafsir-mcp"
      ]
    }
  }
}

🧰 الأدوات المتاحة (13 أداة)

الفئةالأداةالوصف
الآيةfetch_ayahنص آية بالرسم العثماني، مع تجويد/إعراب اختياري
fetch_tafsirتفسير من 8 مصادر (تفاسير متعددة بطلب واحد)
fetch_nuzool_reasonسبب النزول بالإسناد الكامل
السورةfetch_surah_infoمعلومات شاملة: أهداف، فضائل، نزول
get_surah_statisticsإحصاءات: كلمات، حروف، أطول كلمة...
الكلمةanalyze_wordإعراب، صرف، معنى، جذر، قراءات
find_root_occurrencesكل مواضع جذر في القرآن
get_root_statsإحصاءات جذر: سور، آيات، أوزان
البحثsearch_quran_textبحث FTS5 بدون تشكيل
search_in_tafsirبحث LIKE في متن تفسير محدد
القراءاتget_qeraat_variantsاختلاف القراءات لآية أو كلمة
عامget_quran_overviewإحصاءات شاملة للقرآن
get_page_fawaedفوائد صفحة من المصحف

📋 الموارد والقوالب

الموارد (Resources)

الموردالوصف
quran://surahsفهرس 114 سورة (JSON)
quran://tafsirsفهرس 8 مصادر تفسيرية مع الإسناد (JSON)
quran://schemaتوثيق مخطط قاعدة البيانات (Markdown)

قوالب الدراسة (Prompts)

القالبالوصف
study_ayah(surah, ayah)دراسة شاملة: نص + تفسير + إعراب + كلمات
compare_tafsirs(surah, ayah)مقارنة التفاسير الخمسة
root_study(root)دراسة جذر: إحصاء + مواضع + سياقات
surah_overview(surah)نظرة شاملة على سورة
tajweed_lesson(surah, ayah)درس تجويد: أحكام + قراءات

📚 مصادر التفسير

المعرّفالكتابالمؤلفالوفاة
tabaryجامع البيانأبو جعفر الطبري310هـ
katheerتفسير ابن كثيرأبو الفداء إسماعيل بن كثير774هـ
baghawyمعالم التنزيلالحسين بن مسعود البغوي510هـ
saadiتيسير الكريم الرحمنعبد الرحمن بن ناصر السعدي1376هـ
moyassarالتفسير الميسرمجمع الملك فهد—
mukhtasar_arالمختصر (عربي)مجمع الملك فهد—
mukhtasar_enConcise Commentary (English)King Fahd Complex—
mukhtasar_bnসংক্ষিপ্ত তাফসীর (Bengali)King Fahd Complex—

🗂️ بنية المشروع

src/tafsir/
├── server.py          # FastMCP entry point
├── db.py              # SQLite read-only connection
├── data_loader.py     # DB path resolver + auto-download
├── models.py          # Pydantic models + attributions
├── normalize.py       # Arabic text normalization
├── tools/             # 13 MCP tools
├── resources/         # 3 MCP resources
└── prompts/           # 5 study prompt templates

🧪 الاختبارات

bash
uv run pytest tests/ -v
# 35 tests — all pass

🔒 الأمان

  • قاعدة البيانات تُفتح للقراءة فقط: mode=ro + PRAGMA query_only=ON
  • جميع مدخلات المستخدم عبر ? placeholders — لا SQL injection
  • الأدوات لا تصل للشبكة (openWorldHint=False)

📜 الترخيص

  • الكود: MIT License — Ahmed Eid, Tafsir Center for Quranic Studies
  • قاعدة البيانات: CC BY 4.0 — يجب نسبة المصدر لمركز تفسير

🏛️ الجهة الراعية

هذا المشروع رعاية ودعم مركز تفسير للدراسات القرآنية. البيانات القرآنية مراجعة وموثّقة من قِبل الباحثين العلميين في المركز.

📧 cloud@tafsir.net


🌙 About

A Model Context Protocol (MCP) server providing scholarly, certified access to the Holy Quran for any MCP-compatible AI assistant (Claude Code, Claude Desktop, VS Code, etc.).

All data is reviewed and certified by Tafsir Center for Quranic Studies.

✨ Features

  • 📖 6,236 ayahs in Uthmani script
  • 📚 5 classical Arabic tafsirs: Tabari · Ibn Kathir · Baghawi · Saadi · Muyassar
  • 🌍 Trilingual Mukhtasar (Arabic, English, Bengali)
  • 🔤 77,432 words with full linguistic analysis (i'rab, sarf, root, rasm)
  • 🔍 1,891 roots searchable with statistics
  • ⚡ FTS5 search with full Arabic normalization (diacritic-free)
  • 🎵 Qira'at variants per ayah and word
  • 📜 Asbab al-nuzool with full isnad (201 ayahs)
  • 📊 Detailed statistics per surah and mushaf page
  • 🛡️ Hallucination protection (strict Pydantic v2 validation)
  • 📴 Fully offline after installation

🚀 Quick Install

bash
# Claude Code
claude mcp add tafsir --scope user -- uvx tafsir-mcp

# pip / uvx
pip install tafsir-mcp
uvx tafsir-mcp

On first run, the database (~214 MB) is downloaded automatically from Hugging Face and cached at ~/.cache/tafsir-mcp/.

🧰 Available Tools (13)

CategoryToolDescription
Ayahfetch_ayahAyah text with optional tajweed/i'rab
fetch_tafsirTafsir from up to 8 sources in one call
fetch_nuzool_reasonAsbab al-nuzool with full isnad
Surahfetch_surah_infoFull surah info: goals, virtues, revelation
get_surah_statisticsWord count, char count, longest word...
Wordanalyze_wordI'rab, sarf, meaning, root, qira'at
find_root_occurrencesAll occurrences of a root in the Quran
get_root_statsRoot stats: surahs, ayahs, distinct forms
Searchsearch_quran_textFTS5 diacritic-free search
search_in_tafsirLIKE search in a tafsir text
Qira'atget_qeraat_variantsReading variants for ayah or word
Generalget_quran_overviewQuran-wide statistics
get_page_fawaedFawaed for a mushaf page

📜 License

  • Code: MIT — Ahmed Eid, Tafsir Center for Quranic Studies
  • Quranic Data: CC BY 4.0 — attribution to "Tafsir Center for Quranic Studies" required

🏛️ Sponsor

Sponsored by Tafsir Center for Quranic Studies.

📧 cloud@tafsir.net · GitHub Issues

Installation

TypingMind
{
  "mcpServers": {
    "tafsir-mcp": {
      "command": "uvx",
      "args": [
        "tafsir-mcp"
      ]
    }
  }
}

Use Tafsir MCP MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Tafsir MCP is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. You can run MCP locally on your device or connect to a remote MCP server URL.

Option 1: Use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Tafsir MCP as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Tafsir MCP MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "tafsir-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Tafsir MCP MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Tafsir MCP MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Tafsir MCP to help me with this task?
Tafsir MCP
Sure. I read it.
Here is what I found using Tafsir MCP.

Option 2: Add an MCP server URL

Use this when Tafsir MCP is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter https://mcp.tafsir.net/mcp in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste https://mcp.tafsir.net/mcp into the Server URL field.
  2. Enter a connection name for Tafsir MCP.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the Tafsir MCP connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the Tafsir MCP tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the Tafsir MCP tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Tafsir MCP to help me with this task?
Tafsir MCP
Sure. I read it.
Here is what I found using Tafsir MCP.

Frequently asked questions

What is the Tafsir MCP MCP server used for?

Tafsir MCP is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Tafsir MCP MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Tafsir MCP with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Tafsir MCP MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Tafsir MCP connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Tafsir MCP MCP to TypingMind?

Tafsir MCP can be connected in TypingMind with the local MCP connector or by adding a remote MCP server URL. Use the local connector when the server needs access to files, apps, or private resources on your device, and use a server URL when the MCP server is hosted remotely.

What tools does Tafsir MCP MCP provide in TypingMind?

Tafsir MCP exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Tafsir MCP MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Tafsir MCP requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇