Skip to main content
MCP server CX Codex

rag-mcp — Claude Code MCP server: search local files

The rag-mcp MCP server for Claude Code searches selected files and folders. It retrieves passages by exact terms or meaning, then can answer questions from that material.

MIT ★ 9 updated 2026-11-15

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add rag-mcp -e OPENROUTER_API_KEY=<OPENROUTER_API_KEY> -- uvx ragmcp-cli
Open on GitHub

What rag-mcp does

rag-mcp searches local files within a chosen scope and returns passages relevant to a question. BM25 handles exact-term retrieval; semantic search uses embeddings, and a separate model can rerank results. The MCP server can also produce answers grounded in the retrieved material.

Exact-term search needs no account or API key. Semantic retrieval requires a selected embedding provider; written answers can use a Codex session with a ChatGPT plan or an OpenRouter key. With OPENROUTER_API_KEY set, OpenRouter also receives the query and retrieved passages for reranking, which is enabled automatically. Source files and the index stay local.

What it helps with

  • find relevant passages in a selected folder
  • retrieve material by meaning when wording differs
  • draft an answer from local documents

Example prompts for the agent

  • Find information about upload limits in ./docs and answer from those files.
  • Search ./docs for material describing changes to the requirements.
  • Find the file-retention period after account closure in ./docs.

How to install rag-mcp

Platform CLI

claude mcp add rag-mcp -e OPENROUTER_API_KEY=<OPENROUTER_API_KEY> -- uvx ragmcp-cli

Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from ragmcp-cli <command>

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about rag-mcp

How do I install rag-mcp in Claude Code?

Run claude mcp add rag-mcp -e OPENROUTER_API_KEY=<OPENROUTER_API_KEY> -- uvx ragmcp-cli. This registers the MCP server with an OpenRouter key.

What does rag-mcp do?

It searches scoped local files and folders using exact terms or semantic retrieval. The retrieved passages can support answers to questions about those documents.

What does rag-mcp need to run?

Exact-term search works without an account or key. Semantic retrieval needs a chosen embedding provider; written answers use either Codex signed in with codex login and a ChatGPT plan, or an OpenRouter key.

Similar MCP servers

All MCP servers for Agent setup: memory, context, orchestration →

Project sponsors

Companies that keep this analytics open