# MCP for developers: Add the Islamic library MCP server to Claude Code

Source: https://qurangallery.com/docs/mcp/claude-code

> One command adds the Quran Gallery MCP server to Claude Code: classical Arabic books, printed-page citations, no account and no key.

**No account, no sign-in, no key.** One command:

```bash
claude mcp add --transport http quran-gallery https://qurangallery.com/mcp/shamela
```

## Steps

1. Run the command above in your terminal. It registers the server for you in the local scope; add `--scope user` to make it available in every project, or `--scope project` to share it through `.mcp.json`.
2. Run `claude mcp list`, or start `claude` and run `/mcp`. `quran-gallery` should show as connected.

3. Ask a question that needs a text (below). Claude Code asks before it runs each tool the first time. Approve it.

The answer gives each edition with its volume, printed page and Maktabah link, and quotes the Arabic:

To remove it: `claude mcp remove quran-gallery`.

## First prompt to try

> _Find the hadith «إنما الأعمال بالنيات» in the primary collections and tell me which book, edition, volume and page it is printed on. Quote the Arabic exactly._

Your assistant should call `shamela_search_library` (or `search` then `fetch`). The hits include **صحيح البخاري, ط السلطانية, page 1/6**, with a link to that page in the Maktabah reader. If it answers from memory instead, say: _"Use the Quran Gallery library tool and quote what it returns."_

Search queries must be in Arabic; your assistant translates English terms first ([details](https://qurangallery.com/docs/mcp/search-library)). Ready-made prompts for takhrīj, citing a passage and comparing tafsir are listed in [the full tool surface](https://qurangallery.com/docs/mcp/tools).

## Troubleshooting

- **429, "Keyless limit reached".** Keyless use allows 10 tool calls a minute and 200 a day per IP address. Wait for the `Retry-After` header, or add a free key (below). See [Limits and errors](https://qurangallery.com/docs/mcp/limits-and-errors).
- **503.** The server or the library behind it is briefly unavailable. Retry after the `Retry-After` header; if the client lists zero tools, wait a minute and reconnect.
- **The tools do not appear, or a tool you expect is missing.** Run `/mcp` and reconnect the server, or restart `claude`; the tool list is read when the server connects.
- **Connection fails immediately.** The endpoint is `/mcp/shamela`; the bare `/mcp` is a web page, not the server.

## Optional: a free key for higher limits

A key is never required. A free key raises the limit to 60 calls a minute and lifts the keyless page-range caps. Create one on the **Developers** page of your Quran Gallery account ([how keys work](https://qurangallery.com/docs/accounts/api-keys)), then send it as a bearer token.

Add it with `--header`:

```bash
claude mcp add --transport http quran-gallery \
  https://qurangallery.com/mcp/shamela \
  --header "Authorization: Bearer qg_sk_your_key_here"
```

Treat the key like a password and keep it out of git.

## Next steps

- [Open Quran Gallery MCP](https://qurangallery.com/mcp)
- [Connect Claude to the Islamic library (MCP)](https://qurangallery.com/docs/mcp/claude)
- [Connect Cursor to the Islamic texts MCP server](https://qurangallery.com/docs/mcp/cursor)
- [MCP server for Islamic texts: what it does](https://qurangallery.com/docs/mcp/overview)
