---
title: Qaf developer docs
description: Search and read classical Islamic books from an AI app or your own code, with the Qaf MCP server and the Qaf API.
sidebar:
  label: Overview
---

The Qaf library holds more than 8,000 books of Qur’an exegesis, hadith, jurisprudence, theology, history and language, in Arabic.

## Connect an AI app

Paste the server URL into an AI app that supports MCP, then sign in with your Qaf account. You don't need an API key.

```text
https://api.qaf.ai/mcp
```

Setup steps for [Claude](/mcp/connect?client=claude), [ChatGPT](/mcp/connect?client=chatgpt), [Claude Code](/mcp/connect?client=claude-code), [Codex](/mcp/connect?client=codex), [Cursor](/mcp/connect?client=cursor) and [VS Code](/mcp/connect?client=vscode).

## Call the API

Create an API key, then search the library from your own code.

```bash
curl https://api.qaf.ai/v1/search \
  -H "Authorization: Bearer $QAF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "الصبر عند المصيبة"}'
```

[Get an API key](https://qaf.ai/login?redirect=%2F%3Fsettings%3Dapi-keys) or follow the [quickstart](/api/quickstart).

## What you can do

The MCP server and the API run the same operations on the same library, and return the same passages.

| Task | MCP tool | API endpoint |
| --- | --- | --- |
| Search passages by meaning and keywords | [`search`](/mcp/tools#search) | [`POST /v1/search`](/reference/passages/search-passages) |
| Read a passage and the passages around it | [`fetch`](/mcp/tools#fetch) | [`GET /v1/passages/{id}`](/reference/passages/get-passage) |
| Look up an author or book by name | [`lookup_catalog`](/mcp/tools#lookup_catalog) | [`GET /v1/catalog/lookup`](/reference/catalog/lookup-catalog) |
| Get Qur’an verses with their surah | [`get_quran_verses`](/mcp/tools#get_quran_verses) | [`GET /v1/quran/verses`](/reference/quran/get-quran-verses) |

## Before you build

- [The Qaf library](/library) explains books, authors, passages, IDs and genres.
- [Search and read passages](/guides/search) shows how to write queries and filters that find the right text.
- [Cite passages](/guides/citations) covers how to show where text comes from.
- [Docs for AI agents](/agents) lists the Markdown and machine-readable versions of these docs.
