Skip to main content
Glama

Quran MCP Server šŸ•Œ - Revolutionary Islamic AI Assistant

npm version License: MIT

A revolutionary Model Context Protocol (MCP) server that gives AI assistants powerful access to Islamic resources. The first MCP server with intelligent keyword search for Quran and Hadith - no more needing exact verse numbers!

✨ What Makes This Revolutionary?

šŸ” Intelligent Search (NEW!)

  • Search Quran by Keywords: Find verses about "patience", "prayer", "mercy" without knowing verse numbers

  • Search Hadith by Topics: Discover hadiths about "charity", "fasting", "manners" instantly

  • Topic-Based Discovery: AI understands common Islamic topics and finds relevant content

  • Natural Language Queries: Ask "find verses about patience" and get instant results

šŸ“– Comprehensive Quran Access

  • Arabic Text: Original Quranic text in Arabic

  • Multiple Translations: English translations from renowned scholars (Asad, Sahih International, Pickthall, Yusuf Ali, Hilali & Khan)

  • Full Surah Retrieval: Get complete chapters with or without translations

  • Random Verse: Daily inspiration feature

  • Verse-by-Verse Access: Traditional reference-based lookup

šŸ“š Tafsir (Commentary)

  • Multiple Sources: Access to various Tafsir collections

    • Tafsir Ibn Kathir (English & Arabic)

    • Maarif-ul-Quran

    • Tafsir al-Tabari (Arabic)

    • Tafsir al-Qurtubi (Arabic)

  • Verse-by-verse Explanations: Detailed scholarly commentary

šŸ“œ Hadith Collections

  • Six Major Collections:

    • Sahih Bukhari (7,563 hadiths)

    • Sahih Muslim (7,563 hadiths)

    • Sunan Abu Dawud (5,274 hadiths)

    • Jami' at-Tirmidhi (3,956 hadiths)

    • Sunan an-Nasa'i (5,758 hadiths)

    • Sunan Ibn Majah (4,341 hadiths)

  • Random Hadith: Daily hadith feature

šŸŽµ Audio Recitations

  • Multiple Reciters: Choose from renowned Quran reciters

    • Maher Al-Muaiqly

    • Abdul Basit

    • Abdurrahman As-Sudais

    • Mishary Rashid Alafasy

    • Mahmoud Khalil Al-Hussary

  • High-Quality Audio: MP3 format in various bitrates

  • Playlist Generation: M3U playlists for full Surahs

⚔ Performance Features

  • Intelligent Caching: LRU cache with TTL to minimize API calls

  • Error Handling: Comprehensive error handling with meaningful messages

  • Type Safety: Full TypeScript implementation with strict mode

  • Validation: Input validation for all parameters

Related MCP server: quran-mcp

šŸš€ Installation - Just Copy & Paste!

Step 1: Add to Your AI Agent

Claude Desktop - Add this to your config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "quran": {
      "command": "npx",
      "args": ["@quranmcp/server"]
    }
  }
}

Step 2: Restart Claude

Step 3: Done! šŸŽ‰

Ask: "Search the Quran for verses about patience"


Works with any MCP-compatible AI agent - just use the same JSON configuration!

šŸ› ļø Available Tools (18 Total)

šŸ” NEW! Search Tools (Revolutionary)

search_quran

Search the Quran by keywords or phrases - Find verses without knowing exact references!

{
  "query": "patience",
  "translation": "en.sahih",
  "max_results": 20
}

Example Queries:

  • "patience" - Find all verses about patience

  • "those who believe" - Find verses with this phrase

  • "prayer" - Discover verses about prayer

  • "mercy forgiveness" - Multiple keywords

search_hadith

Search Hadith collections by keywords - Discover hadiths about any topic!

{
  "query": "charity",
  "collections": ["bukhari", "muslim"],
  "max_results": 20
}

Example Queries:

  • "prayer times" - Find hadiths about prayer

  • "fasting ramadan" - Hadiths about fasting

  • "parents" - Hadiths about treating parents

search_quran_by_topic

Search by predefined Islamic topics - AI-optimized topic search!

{
  "topic": "patience",
  "translation": "en.sahih",
  "max_results": 10
}

Available Topics: prayer, patience, charity, faith, paradise, hell, prophet, allah, mercy, justice, knowledge, family, death, creation, guidance

search_hadith_by_topic

Search Hadith by Islamic topics - Topic-based hadith discovery!

{
  "topic": "prayer",
  "collections": ["bukhari"],
  "max_results": 10
}

Available Topics: prayer, fasting, charity, hajj, faith, prophet, companions, knowledge, manners, family, marriage, death, jihad, repentance

šŸ“– Quran Tools

get_quran_verse

Get a specific verse with Arabic text and translation.

{
  "surah": 1,
  "ayah": 1,
  "translation": "en.asad"
}

get_full_surah

Get all verses of a complete Surah.

{
  "surah": 1,
  "include_translation": true,
  "translation": "en.asad"
}

get_random_verse

Get a random verse for daily inspiration.

{
  "include_translation": true,
  "translation": "en.asad"
}

Tafsir Tools

get_tafsir

Get commentary/explanation for a verse.

{
  "surah": 2,
  "ayah": 255,
  "tafsir": "en-tafisr-ibn-kathir"
}

list_tafsir_sources

List all available Tafsir sources.

Hadith Tools

get_hadith

Get a specific Hadith from a collection.

{
  "collection": "bukhari",
  "hadith_number": 1
}

get_random_hadith

Get a random Hadith.

{
  "collection": "bukhari"
}

list_hadith_collections

List all available Hadith collections.

Recitation Tools

get_recitation_url

Get audio URL for a verse recitation.

{
  "surah": 1,
  "ayah": 1,
  "reciter": "Maher_AlMuaiqly_64kbps"
}

list_reciters

List all available reciters.

Information Tools

get_surah_info

Get information about a Surah.

{
  "surah": 1
}

list_surahs

List all 114 Surahs with their information.

list_translations

List all available translations.

get_cache_stats

Get cache statistics for monitoring.

šŸ’¬ Example Queries for AI Assistants

Once configured, you can ask your AI assistant natural language questions:

šŸ” Search Queries (NEW!)

  • "Find verses about patience in the Quran"

  • "Search for hadiths about charity"

  • "Show me Quranic verses about prayer"

  • "Find hadiths about treating parents"

  • "What does the Quran say about mercy?"

  • "Search for verses containing 'those who believe'"

  • "Find hadiths about fasting in Ramadan"

šŸ“– Traditional Queries

  • "Show me Ayat al-Kursi (verse 2:255) with translation and tafsir"

  • "Get me a random verse from the Quran for today"

  • "What does Surah Al-Fatiha say?"

  • "Show me hadith number 1 from Sahih Bukhari"

  • "Give me a random hadith"

  • "Get the audio recitation URL for Surah Yasin"

  • "List all available Quran translations"

  • "What is the information about Surah Al-Baqarah?"

šŸŽÆ AI Understanding

The AI assistant now understands it can:

  • Search by keywords instead of requiring exact verse numbers

  • Find content by topic without knowing references

  • Discover related verses and hadiths through natural language

  • Combine search with traditional lookup for comprehensive study

šŸ—ļø Architecture

quranMCP/
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ index.ts              # Main MCP server
│   ā”œā”€ā”€ types/                # TypeScript type definitions
│   │   └── index.ts
│   ā”œā”€ā”€ constants/            # Constants and validation
│   │   └── index.ts
│   ā”œā”€ā”€ services/             # Core services
│   │   ā”œā”€ā”€ cache.ts          # Caching layer
│   │   └── fetcher.ts        # HTTP client
│   └── tools/                # Tool implementations
│       ā”œā”€ā”€ quran.ts          # Quran text & translations
│       ā”œā”€ā”€ tafsir.ts         # Tafsir commentary
│       ā”œā”€ā”€ hadith.ts         # Hadith collections
│       └── recitation.ts     # Audio recitations
ā”œā”€ā”€ dist/                     # Compiled JavaScript
ā”œā”€ā”€ package.json
ā”œā”€ā”€ tsconfig.json
└── README.md

šŸ”§ Development

Build

npm run build

Watch Mode

npm run dev

Testing with MCP Inspector

npm run inspector

šŸ“Š Data Sources

This server aggregates data from multiple trusted Islamic resources:

šŸŽÆ Why This MCP Server is Revolutionary

Before This Server:

  • āŒ Had to know exact Surah and Ayah numbers

  • āŒ Couldn't search by keywords or topics

  • āŒ Required manual lookup in external resources

  • āŒ Limited to reference-based queries

With This Server:

  • āœ… Natural language search - "find verses about patience"

  • āœ… Keyword-based discovery - Search entire Quran and Hadith collections

  • āœ… Topic-aware AI - AI understands Islamic topics and finds relevant content

  • āœ… Universal compatibility - Works with any MCP-compatible AI agent

  • āœ… Zero-install option - Use with NPX instantly

  • āœ… Intelligent caching - Fast responses with smart caching

  • āœ… 18 powerful tools - Comprehensive Islamic resource access

Real-World Impact:

  • Students: Discover verses and hadiths for research without memorizing references

  • Educators: Quickly find relevant Islamic texts for teaching

  • Researchers: Search across multiple sources simultaneously

  • Daily Users: Get instant answers to Islamic questions

  • Developers: Build Islamic AI applications with ease

šŸ¤ Contributing

Contributions are welcome! This is an open-source project for the Muslim community.

Priority Areas:

  • Additional Tafsir sources (more languages)

  • More Hadith collections

  • Additional translations (Urdu, Arabic, French, etc.)

  • Enhanced search algorithms

  • Thematic indexing improvements

  • Juz/Hizb navigation

  • Performance optimizations

How to Contribute:

  1. Fork the repository

  2. Create a feature branch (git checkout -b feature/amazing-feature)

  3. Commit your changes (git commit -m 'Add amazing feature')

  4. Push to the branch (git push origin feature/amazing-feature)

  5. Open a Pull Request

šŸ“¦ Package Information

  • NPM Package: @quranmcp/server

  • Version: 2.0.0

  • License: MIT

  • Repository: GitHub

  • Size: 34.3 kB (compressed)

  • Node.js: >= 18.0.0

šŸ“„ License

MIT License - feel free to use this in your projects!

šŸ™ Acknowledgments

  • All the scholars and organizations who made these Islamic resources freely available

  • The Model Context Protocol team at Anthropic

  • The open-source community

šŸ“ž Support

šŸ“š More Examples

See EXAMPLES.md for detailed usage examples.


Made with ā¤ļø for the Muslim community and AI enthusiasts

Status: 🟢 Live on NPM | āœ… Ready to Use | šŸš€ Revolutionary Search Enabled

Available Tools

18 tools
get_cache_statsB

Get cache statistics for monitoring server performance.

Inputs: no named parameters.

get_full_surahB

Get all verses of a complete Surah (chapter). Can include translations.

Inputs: surah (required), include_translation, translation.

get_hadithC

Get a specific Hadith from a collection. Hadiths are sayings and actions of Prophet Muhammad (peace be upon him).

Inputs: collection (required), hadith_number (required).

get_quran_verseC

Get a Quran verse with both Arabic text and English translation. Returns the specified verse from the Quran.

Inputs: surah (required), ayah (required), translation.

get_random_hadithB

Get a random Hadith from a collection. Great for daily inspiration!

Inputs: collection.

get_random_verseC

Get a random verse from the Quran. Great for daily inspiration!

Inputs: include_translation, translation.

get_recitation_urlA

Get audio recitation URL for a specific Quran verse. Returns MP3 URL for listening to the verse.

Inputs: surah (required), ayah (required), reciter.

get_surah_infoB

Get information about a Surah (chapter) including name, number of verses, and revelation type.

Inputs: surah (required).

get_tafsirA

Get Tafsir (commentary/explanation) for a specific Quran verse. Provides scholarly interpretation and context.

Inputs: surah (required), ayah (required), tafsir.

list_hadith_collectionsB

List all available Hadith collections.

Inputs: no named parameters.

list_recitersA

List all available Quran reciters for audio recitations.

Inputs: no named parameters.

list_surahsA

List all 114 Surahs of the Quran with their names and basic information.

Inputs: no named parameters.

list_tafsir_sourcesA

List all available Tafsir (commentary) sources with their languages and authors.

Inputs: no named parameters.

list_translationsB

List all available Quran translations.

Inputs: no named parameters.

search_hadithA

Search Hadith collections by keywords or phrases. Find hadiths about specific topics without knowing exact hadith numbers. Search across all major collections (Bukhari, Muslim, Abu Dawud, Tirmidhi, Nasai, Ibn Majah) or specific ones. Perfect for queries like "prayer times", "charity", "manners", etc.

Inputs: query (required), collections, max_results.

search_hadith_by_topicB

Search Hadith collections by common Islamic topics. Uses predefined topic mappings for better results. Topics include: prayer, fasting, charity, hajj, faith, prophet, companions, knowledge, manners, family, marriage, death, jihad, repentance. The AI can suggest these topics to users based on their questions.

Inputs: topic (required), collections, max_results.

search_quranA

Search the Quran by keywords or phrases. This powerful tool allows you to find verses containing specific words or concepts without knowing the exact surah and ayah numbers. Perfect for finding verses about specific topics like "patience", "prayer", "mercy", etc. The AI agent can use natural language queries to search through the entire Quran.

Inputs: query (required), translation, max_results.

search_quran_by_topicB

Search the Quran by common Islamic topics. This tool uses predefined topic mappings to find relevant verses. Topics include: prayer, patience, charity, faith, paradise, hell, prophet, allah, mercy, justice, knowledge, family, death, creation, guidance. The AI understands these topics and can suggest them to users.

Inputs: topic (required), translation, max_results.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 18 tools

    Disambiguation3/5

    Most tools have distinct purposes, but there is significant overlap between 'search_hadith' and 'search_hadith_by_topic' as well as 'search_quran' and 'search_quran_by_topic', which could cause confusion. The descriptions clarify that the 'by_topic' versions use predefined mappings, but the core functionality is similar, potentially leading to misselection.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern (e.g., get_cache_stats, list_surahs, search_hadith), with no deviations in style. This predictability makes it easy for agents to understand and use the tools without confusion.

    Tool Count4/5

    With 18 tools, the count is slightly high but reasonable for covering Quran and Hadith resources comprehensively. It includes a good mix of retrieval, listing, and search functions, though some redundancy (e.g., multiple search tools) might be trimmed without losing essential functionality.

    Completeness5/5

    The tool set provides complete coverage for accessing and exploring Quranic and Hadith content, including verses, surahs, translations, recitations, tafsir, and search capabilities. There are no obvious gaps; agents can perform all core operations needed for this domain without dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants to retrieve canonical Quran text, translations, scholarly tafsir, full-text search, and word-level morphology from verified Quran data.
      -
    • F
      license
      A
      quality
      B
      maintenance
      A curated Islamic MCP server for AI agents. It returns Quran verses in Arabic with the Pickthall English translation, 440 du'as with source and grading where recorded, and the 99 Names of Allah. Every response instructs the agent to quote sacred text exactly. The server recognises common crisis and abuse phrasing and returns curated support resources alongside the answer.
      4
      139 npm
      -
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables 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.
      -