quran-mcp-server is an MCP (Model Context Protocol) server designed to interact with the Quranic corpus through the official Quran.com REST API v4. The project is generated according to the OpenAPI specification and wraps multiple API endpoints as tools, enabling LLMs to call these tools through compatible clients.
Main Capabilities
The server provides the following tools (corresponding to API endpoints):
- GET /chapters - List all chapters
- GET /chapters/{id} - Get a specified chapter
- GET /chapters/{chapter_id}/info - Get chapter information
- GET /verses/by_chapter/{chapter_number} - Get verses by chapter/surah number
- GET /verses/by_page/{page_number} - Get all verses of a specific Madani Quran page
- GET /verses/by_juz/{juz_number} - Get verses by Juz number
- GET /verses/by_hizb/{hizb_number} - Get verses by Hizb number
- GET /verses/by_rub/{rub_el_hizb_number} - Get verses by Rub el Hizb number
- GET /verses/by_key/{verse_key} - Get a verse by key
- GET /verses/random - Get a random verse
- GET /juzs - Get the list of all Juzs
- GET /search - Search for specific terms in the Quran
- GET /resources/translations - Get the list of available translations
- GET /resources/translations/{translation_id}/info - Get information about a specific translation
- GET /resources/tafsirs - Get the list of available tafsirs
- GET /resources/tafsirs/{tafsir_id}/info - Get information about a specific tafsir
- GET /quran/tafsirs/{tafsir_id} - Get a single tafsir
- GET /resources/chapter_reciters - List chapter reciters
- GET /resources/recitation_styles - Get available recitation styles
- GET /resources/languages - Get all languages
Usage
Build the Docker image
Before using the Docker-based production mode, you need to build the Docker image first:
docker build -t quran-mcp-server .
Claude Desktop Integration
To use this MCP server in Claude Desktop, add the following configuration to the claude_desktop_config.json file (on macOS it is usually located at ~/Library/Application Support/Claude/claude_desktop_config.json, and on Windows at %APPDATA%\Claude\claude_desktop_config.json):
Configuration examples (for specific configuration content such as Docker production mode, Node.js production mode, development mode, etc., please refer to the project repository).
Important notes:
- Replace /path/to/quran-mcp-server with the actual path to this repository on your system.
- If using the production mode configuration, you need to build the project first with npm run build or docker build -t quran-mcp-server .
- If required by the Quran.com API, replace your_api_key_if_needed with the actual API key.
- If other MCP servers are already configured, add this configuration to the existing mcpServers object.
- After updating the configuration, restart Claude Desktop for the changes to take effect.
Environment Variables
- API_KEY: API key used for authentication
- PORT: Server port (default: 8000 or 3000, depending on the language)
- VERBOSE_MODE: Set to 'true' to enable detailed logging of API requests and responses (default: false)
When VERBOSE_MODE is set to 'true', the server logs detailed information about API requests and responses to the console. This is very useful for debugging and monitoring API interactions. Detailed logs include:
- Requests: Log the tool name and parameters of each incoming request
- Responses: Log the tool name and result data of each response
- Errors: Log detailed error information, including error name, message, and stack trace (if available) Each log entry is timestamped and prefixed with the log type (REQUEST, RESPONSE, or ERROR) for easy identification.
Use Cases
Suitable for developers who need to integrate Quran data into AI applications, such as building LLM-based Islamic knowledge Q&A, verse search, translation, and tafsir query applications.
Limitations
This project is based on the Quran.com API v4, and its functionality is limited by the available endpoints and data of that API. An API key may be required before use (depending on the requirements of the Quran.com API). The project uses the MIT license.