Skip to main content
Glama
Qaf MCP Server
by qaf-ai
README.md
# Qaf MCP server and plugins

Qaf connects an AI assistant to a library of 8,500+ classical Arabic books from the Islamic scholarly tradition: Qur’an commentary (tafsir), hadith collections and their commentaries, jurisprudence (fiqh) across the schools, theology, history and Arabic language. Ask in English or Arabic and get passages in the original Arabic, each with its book, author, volume, page and a link to the printed page.

The Qaf MCP server is hosted by Qaf, so there is nothing to install or run. This repository holds its configuration and the Qaf plugin, which bundles the server with a research skill for Claude Code, Cursor, Codex and Antigravity.

|              |                                                           |
| ------------ | --------------------------------------------------------- |
| Server URL   | `https://api.qaf.ai/mcp`                                  |
| Transport    | Streamable HTTP                                           |
| Sign-in      | OAuth 2.1 with a Qaf account, in the browser. No API key. |
| MCP Registry | `ai.qaf/qaf`                                              |

## Tools

All three tools are read-only.

| Tool                           | What it does                                                                                                   |
| ------------------------------ | -------------------------------------------------------------------------------------------------------------- |
| `search`         | Finds passages by meaning and keywords, optionally filtered by author, book, genre or the author's death year. |
| `fetch`          | Reads a passage with its footnotes and, if asked, up to five passages on each side.                            |
| `lookup_catalog` | Resolves an author or book name to the IDs that search filters take.                                           |

## Before you connect

You need a Qaf account; create one at https://qaf.ai. The free plan works. The first time you connect, you sign in on qaf.ai and approve access. Each account has a weekly search allowance; reading passages and catalog lookups don't count against it.

## Configure

### VS Code with GitHub Copilot

[Install in VS Code](https://vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522qaf%2522%252C%2522type%2522%253A%2522http%2522%252C%2522url%2522%253A%2522https%253A%252F%252Fapi.qaf.ai%252Fmcp%2522%257D), or add it yourself:

1. Run **MCP: Add Server** from the Command Palette and choose **HTTP**.
2. Paste `https://api.qaf.ai/mcp` and enter `qaf` as the server ID.
3. Send a message in Copilot Chat to start the server, then sign in with your Qaf account in the browser that opens.

### GitHub Copilot CLI

```sh
copilot mcp add --transport http qaf https://api.qaf.ai/mcp
```

### Claude Code

To install the plugin, with the server and the research skill:

```text
/plugin marketplace add qaf-ai/plugins
/plugin install qaf@qaf
```

Then run `/mcp`, select qaf and sign in.

### claude.ai and Cowork

Open **Customize › Plugins › Add › Add marketplace** and enter `qaf-ai/plugins`.

### Codex

```sh
codex plugin marketplace add qaf-ai/plugins
codex plugin add qaf@qaf
codex mcp login qaf
```

### Cursor

Add the server to `~/.cursor/mcp.json`, then turn on qaf under **Customize** and sign in:

```json
{
  "mcpServers": {
    "qaf": {
      "url": "https://api.qaf.ai/mcp"
    }
  }
}
```

### Other clients

Any client that supports remote MCP servers with OAuth sign-in can connect. Most take this configuration:

```json
{
  "mcpServers": {
    "qaf": {
      "type": "http",
      "url": "https://api.qaf.ai/mcp"
    }
  }
}
```

Steps for more clients, and troubleshooting: https://docs.qaf.ai/mcp/connect

## Use it

Ask a question and name a scholar or book if you have one in mind. The assistant resolves the name, searches the library, reads the passages around a result, and cites the book and page for each point. For example:

- What do classical scholars say about combining prayers while traveling? Cite the books.
- Find what al-Nawawi wrote about intention (niyyah) in his commentary on Sahih Muslim, then show me the passages around it.
- ما قول المالكية في المسح على الخفين؟ اذكر المصادر والصفحات.

Passages are in Arabic, and a translation or summary written by an assistant can contain errors, so check the linked page. Qaf returns sources, not rulings. For a ruling on your own situation, ask a qualified scholar.

## Documentation and support

- Documentation: https://docs.qaf.ai/mcp
- Tools, inputs and outputs: https://docs.qaf.ai/mcp/tools
- Privacy policy: https://qaf.ai/privacy
- Terms: https://qaf.ai/terms
- Support: https://qaf.ai/contact

## About this repository

The plugin is in [plugins/qaf](plugins/qaf). This repository is generated by Qaf's internal listing tool, and each release is a tag `vX.Y.Z`. It doesn't hold the server's source. We don't accept pull requests.

The files in this repository are MIT-licensed. The Qaf name and logo are trademarks of Qaf LLC, and the library's texts are not covered by this license.