Skip to content

Hosted MCP server or your own RAG or OpenITI corpus?

Qdrant, pgvector or web search instead of a hosted MCP server? What a self-built RAG over classical books must do, what hosted returns, when to build.

On this page

There are two reasonable ways to give an AI assistant classical Arabic books: connect to a hosted server, or build your own search over a corpus you hold. This page sets out what each involves so you can choose. Neither is the right answer for everyone.

The Quran Gallery MCP server is hosted and closed-source. It searches a fixed library of 8,594 classical Arabic works. It cannot ingest your texts, and it has rate limits (see Limits and errors).

What you build, and what the server returns

TaskIf you build it yourselfWhat the hosted server returns
Get the textsChoose a corpus, check its licence, download it, keep it updated.A fixed library of 8,594 works from the Shamela catalogue, already loaded.
Clean the textRemove markup, fix OCR or conversion errors, decide how to treat diacritics.Verbatim passages with markup removed. Diacritics do not affect matching (Arabic search).
Map to a printed editionWork out which printing each text follows and how its pages are numbered.Title including the printing, plus volume and page as that printing paginates it, such as 1/ 6.
Separate main text from footnotesDetect editor notes and keep them apart from the author’s words.A matchedIn field per passage: body, footnote, both or unknown (details).
Cite the sourceDesign a citation format and a link back to the source page.Edition data where the library has it, and a sourceUrl to the same page in the Maktabah reader.
Rank results for a questionChoose and tune a ranking method; decide which books should come first.A required scope naming one of twelve shelves, so results come from the books you meant (Scopes).
Host and run itPay for storage, an index, an embedding model if you use one, and keep it online.Nothing to host. You call one URL.

Building your own gives you all of this under your control, and costs the time to do each row well. The hosted server gives you the right-hand column in one URL, with the limits it has.

Vector database or web search instead?

The usual self-built answer is a vector database (Qdrant, PostgreSQL with pgvector, Chroma or Pinecone) filled with chunked, embedded book text and queried through LangChain or LlamaIndex. The other common answer is a web search API such as Tavily, Brave Search or Exa. Both are reasonable. Neither is the same job as the hosted server.

LangChain and LlamaIndex are frameworks that wire a retriever to a model. They do not supply the corpus, the printed page or the edition, and both can instead call the hosted server as a tool (Python, LangChain and agents).

What a self-built vector stack has to do

A vector database stores vectors and returns the nearest ones. Everything that makes a result citable has to be built around it:

  • Get and clean the corpus. Download a text collection, check its licence, strip markup and conversion errors, and keep it updated. Whether a downloaded text carries the printed volume and page for each passage, and which printing it follows, is for that corpus’s own documentation to say (see OpenITI and KITAB below). Check it text by text before you rely on it for citations.
  • Keep main text apart from footnotes. If editor notes are chunked and embedded with the author’s words, a hit can quote an editor as the author. You have to detect the notes and store the layer with each chunk.
  • Keep edition metadata. A page number means nothing without the printing. Edition, editor and publisher must travel with every chunk.
  • Normalise Arabic for search. The hosted server folds diacritics, hamza on alif, ta marbuta and ha, and alif maqsura and ya the same way in the index and in your query, and offers an exact mode when a spelling must match (Arabic search). In your own stack you choose and build that folding, on both sides.
  • Host it and re-index it. Storage, the database, an embedding model, and a full re-index whenever you change chunking, folding or model.

What web search gives you

A web search API returns pages from the open web. It does not return the printed book, so there is no volume and page, and no guarantee that the quote exists in the edition you would cite. That makes it useful for background reading and weak for citing a classical text.

Comparison

Hosted MCP serverVector database RAGWeb search API
Setup timePaste one URL; a first cited search in about a minute (getting started)Build ingestion, chunking, embedding and an index firstGet an API key and write the glue code
Printed page citationVolume and page as the printing paginates itOnly if your source text and chunking keep itNo: it returns web pages
Footnotes kept apartYes: matchedIn per passageOnly if you detect and separate themNo
Edition metadataWhere the library has itOnly what your corpus providesNo
CostFree; keyless 10 calls a minute and 200 a day per IP address, free key 60 a minute (limits)Hosting, embeddings and re-indexingThe provider’s per-search pricing; check theirs
Works offlineNoYes, if the index and model run locallyNo

When building your own is still right

A vector database is the right tool when the texts are yours (a manuscript collection, a teaching library, notes), when it must run offline, when you want your own ranking or embeddings, or when the books are not among the 8,594 works, including Shia or other catalogues the library does not cover. See When your own corpus is the right choice. Web search is the right tool when you want current background from the open web and do not need to cite a printed page.

When your own corpus is the right choice

Build your own, or use an open corpus directly, when you need any of these:

  • Private or custom texts. Your own manuscripts, a teaching collection, or notes. The hosted server cannot add them.
  • Offline use. The hosted server needs an internet connection.
  • A corpus outside the 8,594 works. If the books you need are not in the library, check the scopes page for what is covered. Twelve scopes cover 26 of the library’s 41 categories (7,084 books); the rest are reached through the raw tools described in the tool surface.
  • Full control of ranking. If you need your own ranking, embeddings or filters, you need your own index.
  • No rate limits. A large batch job over the whole corpus is better run against data you hold than through a rate-limited service.

You can also use both: a hosted server for citations from published classical works, and your own index for material only you hold.

OpenITI and KITAB

OpenITI and KITAB are public research projects that publish corpora. They are described here from their own pages, read on 1 November 2026. Neither is a competitor product, and this page does not rank them.

  • OpenITI (Open Islamicate Texts Initiative) describes itself as “a multi-institutional effort to construct the first machine-actionable scholarly corpus of premodern Islamicate texts”. The corpus is published as a release on GitHub, with a suggested citation per version. Sources: openiti.org, the OpenITI release README, the OpenITI GitHub.
  • KITAB (Knowledge, Information Technology, and the Arabic Book) invites readers to “explore the OpenITI corpus and reuse data”, and publishes text-reuse data. Source: kitab-project.org.

If you want the raw texts to build on, start from these sources and read their documentation for the format, licence and edition coverage of each text. This page does not state those, because they are theirs to describe.

Formats and sources people ask about

The server does not index your files. For a text you have scanned or encoded yourself, use shamela_verify_quote as the citation check, one passage at a time. Each row below gives one fact from the project’s own page, with the date we read it, and what our server does for someone who uses that tool. We do not integrate with any of them.

Format or projectWhat its own page saysSource, read 2 December 2026What our server does
OpenITI“a multi-institutional effort to construct the first machine-actionable scholarly corpus of premodern Islamicate texts”, published as versioned releases on GitHub and Zenodoopeniti.org; release READMENothing with the file itself; check a passage with shamela_verify_quote.
TEI/XML“an international and interdisciplinary standard used by libraries, museums, publishers, and academics to represent all kinds of literary and linguistic texts”TEI on GitHubNothing with the file itself; check a passage with shamela_verify_quote.
Kraken“a turn-key OCR system optimized for historical and non-Latin script material”kraken on GitHubNothing with the file itself; check a passage with shamela_verify_quote.
eScriptorium“A Digital Text Production Pipeline for Print and Handwritten Texts using machine learning techniques”eScriptoriumNothing with the file itself; check a passage with shamela_verify_quote.
Transkribusdescribes itself as “the operating system for written heritage”, built and owned by a community of stakeholderstranskribus.orgNothing with the file itself; check a passage with shamela_verify_quote.
PyMuPDF“a layout-aware document engine for AI and a feature-rich Python toolkit for extracting, rendering and editing PDFs and other documents”PyMuPDF documentationNothing with the file itself; check a passage with shamela_verify_quote.
CAMeL Tools“A suite of Arabic natural language processing tools developed by the CAMeL Lab at New York University Abu Dhabi”CAMeL Tools on GitHubNothing with the file itself; check a passage with shamela_verify_quote.
Hugging Face vectors“The Hugging Face Hub hosts Git-based repositories, which are version-controlled folders that can contain all your files.”Hub documentationNothing with the file itself; check a passage with shamela_verify_quote.

Choosing

If you want…Consider
Cited passages in your assistant in a minute, from published booksThe hosted server: getting started
Your own texts, offline use or your own rankingYour own corpus, possibly built on OpenITI
Your own code to call the hosted serverPython, LangChain and agents
A comparison with other Islamic MCP serversIslamic MCP servers compared

Next steps

Questions

Should I use the hosted MCP server or build my own RAG for Islamic texts?

Use the hosted server for cited passages from published classical works in a minute. Build your own for private texts, offline use, your own ranking, or a corpus outside its 8,594 works.

Can the hosted server index my own texts?

No. It searches a fixed library and cannot ingest your texts.

Does the hosted server work offline?

No. It needs an internet connection and has rate limits, so a large batch job is better run on data you hold.

What work does the hosted server save me?

Getting and cleaning the texts, mapping them to a printed edition, separating main text from footnotes, building citation links, ranking by scope, and hosting an index.

Is the server open source?

No. It is hosted and closed source.

Can I use OpenITI or KITAB instead?

They are public research projects that publish corpora. Read their own documentation for the format, licence and edition coverage of each text before you build on them.

Should I use Qdrant or pgvector for Shamela books?

Either can store the vectors, and neither gives you printed volume and page, edition data or a footnote split. Those come from your own ingestion. If you only need cited passages from published books, the hosted server skips the choice.

Can I use Tavily, Brave or Exa web search instead of a Shamela MCP server?

They return pages from the open web, not the printed book, so you get no volume and page and no guarantee the quote is in the edition. Use them for background, and the hosted server when you must cite a printed page.

Edit this page on GitHub