MCP Local RAG
Local semantic and keyword search over your own PDF, DOCX, Markdown and text files
Read-only search, reading and sandboxed analysis over your own indexed documents, with page-level citations
By Yiorgis Gozadinos (individual) Python Local · stdio Knowledge and memoryDatabases
66 popularity score ★ 653 ↓ 4.3k/mo
Opens the app, which asks before it adds the server.
pip install haiku.ragclaude mcp add haiku-rag -- haiku-rag mcp --stdio{
"mcpServers": {
"haiku-rag": {
"command": "haiku-rag",
"args": [
"mcp",
"--stdio"
]
}
}
}{
"mcpServers": {
"haiku-rag": {
"command": "haiku-rag",
"args": [
"mcp",
"--stdio"
]
}
}
}{
"servers": {
"haiku-rag": {
"type": "stdio",
"command": "haiku-rag",
"args": [
"mcp",
"--stdio"
]
}
}
}[mcp_servers.haiku-rag]
command = "haiku-rag"
args = ["mcp", "--stdio"]gemini mcp add --scope user haiku-rag haiku-rag -- mcp --stdioHAIKU_RAG_CONFIG_PATH |
Optional: Path to a haiku.rag.yaml config; otherwise ./haiku.rag.yaml, then the platform data directory, are tried. |
|---|---|
OLLAMA_BASE_URL |
Optional: Ollama address used for embeddings; defaults to http://localhost:11434. |
haiku.rag is a retrieval toolkit for your own documents, and its `haiku-rag mcp` command serves an existing haiku.rag database to an MCP client. The assistant can run hybrid (vector plus full-text) searches, search by image when a multimodal embedder is configured, list documents, read a whole document, fetch its heading outline with page numbers, or pull a single section. Search results come back as text with rank, document ID, title, headings and the passage expanded to its section, followed by any pictures as image blocks.
A seventh tool, `execute_code`, runs a short Python program over the documents and returns what it printed, which suits counting and aggregating across many files. The program runs in pydantic-monty, a restricted Python interpreter written in Rust, in a worker subprocess; documents appear inside it as a virtual file system under /documents/{id}/. In version 0.97.0 each call is cut off after 60 seconds (`sandbox.code_timeout`) and its output is capped at 50,000 characters (`sandbox.max_output_chars`), per the config models in the source.
The server opens the database read-only. Documents are added beforehand with the haiku-rag CLI (`add`, `add-src`) or the separate `haiku-ingester` service. It speaks Streamable HTTP on 127.0.0.1:8001 by default, or stdio with `--stdio`, and can cover several databases at once, naming which one each result came from.
| Runtime | Python 3.12+ |
|---|
Python 3.12 or newer and the haiku.rag package (`pip install haiku.rag`) so that `haiku-rag` is on PATH. A database built first with `haiku-rag add` or the ingester. The default configuration embeds queries with Ollama (`qwen3-embedding:4b` at http://localhost:11434), so Ollama must be running with that model, unless a haiku.rag.yaml points to another provider such as OpenAI or VoyageAI, which then needs that provider's key. The published Docker image (ghcr.io/ggozad/haiku.rag-slim) serves HTTP on port 8001 rather than stdio.
It cannot add, change or delete documents: ingestion happens outside the server. `search_documents_by_image` is registered only when a multimodal embedder is configured. The `filter` parameter narrows searches and listings but does not restrict the three document read tools, so the docs say content that must stay hidden belongs in a database the server does not cover. Each `execute_code` call is a fresh program with no state carried over, stopped after 60 seconds and cut at 50,000 characters of output by default. Search scores are not comparable across queries. Claude Desktop does not show the server's instructions to the model.
Suits someone who already keeps, or is willing to build, a local haiku.rag index of PDFs and office files and wants an assistant to search and quote it with page numbers, without sending documents to a hosted service when Ollama is used. The read-only design fits shared or sensitive collections. Less suited to anyone wanting the assistant itself to save notes or memories, since nothing can be written through the server, or to anyone who does not want to run a local model or an indexing step first.
search_documentssearch_documents_by_imageget_documentget_document_outlineget_document_sectionlist_documentsexecute_code