# MCP for developers: MCP server for Islamic texts: what it does

Source: https://qurangallery.com/docs/mcp/overview

> A free MCP server at https://qurangallery.com/mcp/shamela over 8,594 classical Arabic books: verbatim passages with edition, volume, page, Maktabah link.

Ask most AI assistants for a hadith or a fiqh ruling and you get a reference recalled from memory. It often looks right. The book exists, the wording is close, the volume and page are plausible — and there is no way to tell, from the answer alone, whether anyone ever printed that page.

The Quran Gallery MCP server changes what your assistant has to work with. It searches an actual library, the Maktabah al-Shamela catalogue of **8,594 classical Arabic works by 3,188 authors**, and hands back, for each hit:

- the **book**, and which **printing** it is (editions paginate differently — the page number is meaningless without it)
- the **author** and the year they died
- the **printed volume and page**, as that printing paginates it
- the **verbatim Arabic** of the passage
- whether the words were found in the **main text or an editor's footnote**
- the **edition, editor and publisher**, when the library has them, and a **link to the page in the Maktabah reader**

Your assistant quotes what came back instead of reconstructing it.

## Common tasks

- [Is there an MCP server for Maktabah al-Shamela?](https://qurangallery.com/docs/mcp/shamela-mcp-server)
- [Islamic MCP servers compared: Shamela, hadith and Quran](https://qurangallery.com/docs/mcp/islamic-mcp-servers-compared)
- [Connect an AI to the Shamela library: getting started](https://qurangallery.com/docs/mcp/getting-started)
- [Connect ChatGPT to the Shamela library](https://qurangallery.com/docs/mcp/chatgpt)
- [Connect Claude to the Islamic library (MCP)](https://qurangallery.com/docs/mcp/claude)
- [Add the Islamic library MCP server to Claude Code](https://qurangallery.com/docs/mcp/claude-code)
- [Connect Cursor to the Islamic texts MCP server](https://qurangallery.com/docs/mcp/cursor)
- [Add the Islamic library MCP server to VS Code](https://qurangallery.com/docs/mcp/vscode)
- [Connect Gemini CLI to the Islamic texts MCP server](https://qurangallery.com/docs/mcp/gemini-cli)
- [Use the Islamic library MCP server with GitHub Copilot](https://qurangallery.com/docs/mcp/copilot)
- [Connect any MCP client to the Shamela library](https://qurangallery.com/docs/mcp/connect-any-mcp-client)
- [MCP API key and bearer token setup for each client](https://qurangallery.com/docs/mcp/bearer-token-setup)
- [shamela_search_library: search Arabic books with citations](https://qurangallery.com/docs/mcp/search-library)
- [MCP tools for classical Arabic books: the full list](https://qurangallery.com/docs/mcp/tools)
- [Use the Shamela MCP server from Python, LangChain and agents](https://qurangallery.com/docs/mcp/use-with-langchain-and-agents)
- [Hosted MCP server or your own RAG or OpenITI corpus?](https://qurangallery.com/docs/mcp/vs-own-rag-and-openiti)
- [Choose a Shamela MCP scope: one book or all](https://qurangallery.com/docs/mcp/scopes)
- [Why scope matters: one search on one shelf and on all](https://qurangallery.com/docs/mcp/why-scope-matters)
- [How to read a Shamela MCP search result](https://qurangallery.com/docs/mcp/reading-results)
- [Verify an AI-quoted passage against the printed page](https://qurangallery.com/docs/mcp/verify-a-quotation)
- [Grounding rules: citing classical Islamic texts with MCP](https://qurangallery.com/docs/mcp/grounding-rules)
- [Search the main text or the footnotes of a Shamela book](https://qurangallery.com/docs/mcp/search-main-text-or-footnotes)
- [Hadith takhrij with MCP: find a hadith across collections](https://qurangallery.com/docs/mcp/hadith-takhrij)
- [How Arabic search behaves in Shamela MCP](https://qurangallery.com/docs/mcp/arabic-search-behaviour)
- [Edition, editor and publisher in Shamela MCP results](https://qurangallery.com/docs/mcp/edition-metadata)
- [Ten test cases for the Shamela MCP server, with real results](https://qurangallery.com/docs/mcp/test-cases)
- [MCP prompts and custom instructions for cited answers](https://qurangallery.com/docs/mcp/custom-instructions)
- [MCP rate limits and error codes](https://qurangallery.com/docs/mcp/limits-and-errors)
- [Quran Gallery Shamela MCP: frequently asked questions](https://qurangallery.com/docs/mcp/faq)

## Who this is for

Anyone building or using an AI assistant that needs to talk about classical Islamic texts and be checkable: researchers, students, developers of Islamic apps, and anyone who has been burned by a confident citation that turned out not to exist.

You need nothing to start: add `https://qurangallery.com/mcp/shamela` to your assistant and ask. Keyless use is limited per IP address; an optional free key raises the limits ([Limits and errors](https://qurangallery.com/docs/mcp/limits-and-errors)). The library covers **8,594 works, 3,188 authors and 41 categories**, and every tool is read-only.

## What it does not do

This matters more than the feature list, so it is here rather than in a footnote.

**It cannot stop your assistant from misattributing a passage.** What the server guarantees is that the passage, the book and the page are real — that they were retrieved, not composed. It does not guarantee that the sentence your assistant builds around them is a fair reading of the text. A model can still quote a real page and draw a wrong conclusion from it.

**It is not a substitute for a scholar.** Retrieval quality is not the same as understanding. A passage found in a Hanafi manual is evidence of what that manual says, not a ruling for your situation.

**Searches return excerpts; reading tools return pages.** A search result is a page-scoped passage with its citation attached. If you need more, `shamela_read` (`unit: 'page'`) returns a full page and `shamela_read` (`unit: 'range'`) returns up to twenty consecutive ones. There is no single call that exports a book, and the rate limit is what stands between reading and scraping — please stay on the reading side of that line.

> If you want the reasoning behind the design — why search is scoped, why an exact-phrase miss is reported rather than hidden — the [Reading a result](https://qurangallery.com/docs/mcp/reading-results) page covers the parts that affect how you should read the output.

## What you get

**15 tools, all read-only, the same for every client.** Four are ours: `shamela_search_library`, which requires a named scope and is the right first call for most questions, and `search` and `fetch`, the standard pair ChatGPT deep research expects, a quick generic entry (one argument, unscoped), and `shamela_verify_quote`, which checks whether an Arabic quotation occurs in the library and where. The other 11 are the library server's own, exposed under their own names: isnād chains, narrator dossiers, boolean and diacritic-exact search, resolving a printed citation back to a page, per-verse tafsir, and reading a page in full.

The server also offers three ready-made prompts (`takhrij_hadith`, `cite_passage`, `compare_tafsir`) and one resource, `qurangallery://grounding-rules`. It never grades a hadith and gives no rulings.

The short version: start with `shamela_search_library`, reach for the raw tools when it cannot do what you need.

> **Queries must be in Arabic.** A query with no Arabic words is rejected outright. If you are working from an English question, translate the search terms first — nothing translates them for you.

| Page                                                | What it covers                                                                                                                                                                               |
| --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Getting started](https://qurangallery.com/docs/mcp/getting-started)                | Add the server to Claude, ChatGPT, Gemini CLI, Cursor or VS Code; run a first search; add a key for more                                                                                     |
| Connect your client, step by step                   | [ChatGPT](https://qurangallery.com/docs/mcp/chatgpt) and [Claude](https://qurangallery.com/docs/mcp/claude) with screenshots; [Claude Code](https://qurangallery.com/docs/mcp/claude-code), [Gemini CLI](https://qurangallery.com/docs/mcp/gemini-cli), [Cursor](https://qurangallery.com/docs/mcp/cursor), [VS Code](https://qurangallery.com/docs/mcp/vscode), [GitHub Copilot](https://qurangallery.com/docs/mcp/copilot) |
| [The shamela_search_library tool](https://qurangallery.com/docs/mcp/search-library) | Every parameter and every field that comes back                                                                                                                                              |
| [The full tool surface](https://qurangallery.com/docs/mcp/tools)                    | All of them, plus prompts and the resource, grouped by what they are for                                                                                                                     |
| [Choosing a scope](https://qurangallery.com/docs/mcp/scopes)                        | The twelve scopes, and why `shamela_search_library` requires one                                                                                                                             |
| [Reading a result](https://qurangallery.com/docs/mcp/reading-results)               | Footnote vs main text, exact match vs loose match                                                                                                                                            |
| [Grounding rules](https://qurangallery.com/docs/mcp/grounding-rules)                | The citation contract: quote only results, matn vs footnote, no invented data                                                                                                                |
| [Hadith takhrij](https://qurangallery.com/docs/mcp/hadith-takhrij)                  | Locate a hadith across collections with its isnād, without grading                                                                                                                           |
| [Limits and errors](https://qurangallery.com/docs/mcp/limits-and-errors)            | Rate limits, error responses, what to retry                                                                                                                                                  |

## Next steps

- [Open Quran Gallery MCP](https://qurangallery.com/mcp)
- [Is there an MCP server for Maktabah al-Shamela?](https://qurangallery.com/docs/mcp/shamela-mcp-server)
- [Islamic MCP servers compared: Shamela, hadith and Quran](https://qurangallery.com/docs/mcp/islamic-mcp-servers-compared)
