Getting started
Create an API key, add the Quran Gallery server to your MCP client, and run your first grounded search.
On this page
Three steps: get a key, point your client at the server, ask a question.
1. Create an API key
Sign in at accounts.qurangallery.com, go to Developers, and create a key with a descriptive name.
The full key is shown once, on creation. Copy it then — only the first few characters are visible afterwards. Keys look like this:
qg_sk_ghjKm4x…sk stands for secret key. Treat it exactly like a password: it authenticates as you, it belongs in a password manager or a secret store, and it must never be committed to git or pasted into a public issue.
Full details on creating, rotating and revoking keys are in API keys.
2. Connect your client
The server speaks MCP over streamable HTTP at:
https://qurangallery.com/mcp/shamelaSend your key as a bearer token on every request. Most clients accept a config file in this shape:
{
"mcpServers": {
"quran-gallery": {
"type": "http",
"url": "https://qurangallery.com/mcp/shamela",
"headers": {
"Authorization": "Bearer qg_sk_your_key_here"
}
}
}
}Claude Code can add it from the command line instead:
claude mcp add --transport http quran-gallery
https://qurangallery.com/mcp/shamela
--header "Authorization: Bearer qg_sk_your_key_here"Other clients keep this config in different places, and some add remote servers through a settings screen rather than a file. Check your client’s own MCP documentation for where its config lives.
Your client must be able to send a custom header. The key travels in
Authorization: Bearer …and there is no other way to pass it — no query parameter, no OAuth flow, no anonymous mode. If a client only accepts a bare URL, it cannot authenticate against this server yet.
Use the full path,
/mcp/shamela. The bare/mcpis the documentation site you are reading now, not the endpoint, and pointing a client at it will not work.
3. Ask something
Restart your client so it picks up the new server, then ask a question that needs a text:
Find the hadith “إنما الأعمال بالنيات” in the primary collections and tell me exactly which printed page it’s on.
Your assistant should call search_library, and the answer should name a book, a printing, and a page — for that hadith, صحيح البخاري, ط السلطانية, page 1/6.
If it answers from memory instead of calling the tool, say so directly: “Use the Quran Gallery library tool and quote the printed page it returns.”
Checking the connection
Your client should list one tool, search_library. If it lists none, the server could not be reached or your key was rejected — see Limits and errors.
You can also check by hand:
curl -X POST https://qurangallery.com/mcp/shamela
-H "Authorization: Bearer qg_sk_your_key_here"
-H "Content-Type: application/json"
-H "Accept: application/json, text/event-stream"
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'A working key returns a JSON object describing search_library. A bad or missing key returns 401.