rag-mcp is a local hybrid-RAG engine I built for coding agents. It indexes your documents locally, searches them by exact words (BM25) and by meaning (vectors), reranks, and returns cited passages — as a CLI and as an MCP server your agent can call.
The thesis: a coding agent should not have to choose between opening files one at a time and dumping an entire repository into context. A scoped, cited search is the middle path.
One line to try
curl -LsSf https://raw.githubusercontent.com/MasihMoafi/rag-mcp/main/install.sh | sh rag connect claude # or: codex, copilot, gemini rag query "What changed?" --path ./docs It works with no account and no key: BM25 exact-word search is on from the start, and without an answer model a question returns the best matching passages — which is what an agent reads anyway. Meaning search (Ollama, a local CPU model, or hosted providers) and written answers (your Codex sign-in, or an OpenRouter key) are optional layers on top.
The numbers I can stand behind
I didn't want a decorative benchmark chart, so the repo keeps the evidence per question, with the grading rubric, and regrades old runs when the pipeline changes.
On EnterpriseRAG-Bench — a public benchmark of company-internal knowledge (Slack, email, tickets, docs, code; 500 questions) — rag answered 81.0% correct on a 100,721-document sample with all 499 questions the sample supports. The dataset paper's best system scores 68.8% — on the full corpus, not the sample, so the comparison is indicative, not apples-to-apples; the repo separates the two and says so. Answers were graded with the benchmark's own judge prompt.
The honest steps matter more than the headline: the same pipeline scored 66.3% before titles, stemming and a balanced candidate shortlist (75.2%), and reading short documents whole brought it to 81.0%. Each step is a recorded experiment with its own question, constraints and outcome.
On my own harder test — 153 questions with known answers over a paper, a textbook, a biography, a novel and a mixed codebase — the October pipeline puts the answering passage in the top 5 for 83.0% of questions (exact), 98.0% exact-or-partial, up from 69.9% in August. That gain is not chance: exact sign test, p = 0.0008. Graders were subagents using the same rubric on both runs.
What stays on your machine
Source files and indexes never leave the machine. Answer synthesis sends the question and selected evidence to the provider you configured (your own ChatGPT sign-in through Codex, or OpenRouter) — and hosted reranking can be turned off with rag config reranker off.
What it is not
- Not hosted-first: no accounts, no billing, nothing leaves unless you configure it to.
- Not a vector-only demo: BM25 is always on, because exact words matter in code and documents.
- Not finished: it's beta, Linux-verified, and the Studio UI is deliberately excluded from the release until it has an end-to-end demo.
The README has the full benchmark tables, the per-question evidence is under evals/, and there is a longer architectural walkthrough on my site. If you try it, I would honestly like to know where it breaks — that's what the issue tracker is for.
