Scan your whole stack
Latest version: v0.3.1
rag-mcp was last scanned on 24 Nov 2026 at version 0.3.1. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.3.1 LATEST | 24 Nov 2026 | No rules fired |
| 0.3.0 | 12 Nov 2026 | No rules fired |
| 0.2.1 | 11 Nov 2026 | No rules fired |
Findings for v0.3.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.3.1; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
A coding agent should not have to choose between opening files one at a time and dumping an entire repository into context.
Beta · v0.3.1 · Linux (verified; Python 3.13)
Install • Evals • How it works • Deep-Dive Post
Install with one line, or with the package manager you already use:
curl -LsSf https://raw.githubusercontent.com/MasihMoafi/rag-mcp/main/install.sh | sh # adds uv if missing
uv tool install ragmcp-cli # or: pipx install ragmcp-cli · npm install -g ragmcp-cli
Then give your coding agent the tool, or ask from the terminal:
rag connect claude # or: codex, copilot, gemini, agy
rag query "What changed?" --path ./docs
rag # menu: ask, connect an agent, add meaning search or an answer key
It works with no account and no key: exact-word search (BM25) is on from the start, and without an
answer model a question returns the best matching passages, which is what an agent reads anyway.
Two optional steps add more, both from the rag menu:
rag setup picks an embedding model (Ollama, a local CPU model, OpenRouter,
OpenAI, Gemini or any OpenAI-compatible server), so a search also finds passages in other words.codex login, with a ChatGPT plan), rag writes
answers with it at no extra cost; otherwise rag key set saves an OpenRouter key.
RAG_MCP_ANSWER_PROVIDER picks auto (Codex first), codex, openrouter or off.Tested on Linux. Studio is not included in this release.
What leaves your machine: answer synthesis sends the question and
selected evidence to Codex (your ChatGPT sign-in) or to OpenRouter (rag key set or
OPENROUTER_API_KEY). When an OpenRouter key is available, hosted reranking is
enabled by default and sends the query and candidate passages to OpenRouter; use
rag config reranker off to disable it. Hosted embedding and optional contextual
retrieval also send text to their configured providers. Source files and indexes
remain local. FastEmbed may download models unless HF_HUB_OFFLINE=1 or
TRANSFORMERS_OFFLINE=1 is set.
rag # menu at a terminal; help when piped
rag setup --auto # take the recommendation without questions
rag doctor
rag query "What changed?" --path /absolute/path/to/document-or-folder --top3
rag workspaces --json # list local workspaces
rag search "What changed?" --path ./docs # passages only, never an answer (or --workspace ID)
rag query "What changed?" --workspace personal --top 3
rag connect codex # or: claude, copilot, gemini or agy (registers the MCP server)
Bare rag opens the menu at a terminal and prints help otherwise. rag setup offers an interactive provider picker. Use explicit command flags for automation.
Run the installer again to update. RAGMCP_EXTRAS=office (or full, qdrant, anthropic) before sh adds
extras; RAGMCP_REF installs a tag or branch.
git clone https://github.com/MasihMoafi/rag-mcp
cd rag-mcp
python scripts/bootstrap.py # uv sync --all-extras --group dev, then the test suite
uv run rag doctor
Manual test equivalent:
uv sync --all-extras --group dev
.venv/bin/python -m pytest tests/ -v
Any MCP client can register rag mcp once rag is installed.
claude mcp add rag -s user -- rag mcp
Clients that accept standard MCP JSON can use:
{
"mcpServers": {
"rag": {
"type": "stdio",
"command": "rag",
"args": ["mcp"]
}
}
}
From a checkout, use /absolute/path/to/rag-mcp/.venv/bin/python /absolute/path/to/rag-mcp/server.py as the command instead.
rag connect codex
Expected result: the client discovers query_knowledge_base, and a query returns
only a readable answer from the requested document scope.
A first run of 0.3.1 in a clean home folder, with no account and no key (recorded 12 Nov 2026). Bare
rag opens the menu, and a question returns the matching passages with file and lines:
$ rag
rag · search your documents from this terminal or from your coding agent
Exact-word search: on · Meaning search: off · Written answers: off: questions return the matching passages
◆ What would you like to do?
❯ Ask about a file or folder
Connect your coding agent (Claude Code, Codex, ...)
Add or change the embedding model (meaning search)
...
$ rag query "What are the upload limits?" --path ./docs
Best matching passages (no answer model is set up; sign in to Codex with `codex login`, or add an OpenRouter key with `rag key set`, for written answers):
[1] limits.md (L1-L4)
# Limits
Uploads are limited to 10 MiB per file and 50 MiB per request.
Signed in to Codex, the same kind of question gets a written answer:
$ rag query "How long do we keep customer files after an account closes?" --path ./docs
Customer files are kept for 30 days after an account closes, then deleted.
rag-mcp is an answer-producing hybrid RAG CLI and MCP server. Point it at an
explicit supported file or narrow directory, ask a question in plain language,
and receive a grounded answer without retrieval internals in the public result.
The source documents and vector index remain local. The configured Qwen embedding,
Cohere reranking, and DeepSeek synthesis calls use OpenRouter. The answer tool keeps
retrieved chunks and scores out of its response; a shared conversation also returns
run and conversation IDs. rag search can return passage text and scores; MCP
workspace search returns them when include_content: true is set.
Coding agents commonly retrieve context by either opening files one by one or loading a large portion of the repository. The first can miss relevant files; the second consumes context with material the current task may not need.
rag-mcp moves retrieval and answer synthesis behind one scoped tool call so the
agent does not receive the source tree or intermediate chunks in its context.
rag or an MCP client; MCP host tests exercise the server.The approved hosted profile uses BM25 plus OpenRouter qwen/qwen3-embedding-4b, fuses
the best 50 candidates with RRF, asks cohere/rerank-4-fast for the best five,
then asks deepseek/deepseek-v4.1-flash for a concise grounded answer. The CLI
prints that answer. The MCP answer tool returns the answer without private paths, scores, or internal retrieval data.
When requested, the answer can include short quotes and available source references.
PDF page references use file positions. Missing printed page numbers remain unavailable.
A query must name an explicit supported file, a narrow directory, or a saved workspace. Directory queries accept an optional file-type filter.
With no OpenRouter key and no explicit reranker choice, a fresh local profile
keeps reranking off so retrieval-only BM25 search works without provider setup.
Adding a key enables the hosted reranker default; an explicit reranker choice
always takes precedence.
On 22 September 2026, OpenRouter served no endpoint for Qwen3 Reranker 4B or 0.6B. The configured Cohere fallback was verified live at $0.002 per search; the pipeline still fails clearly rather than silently skipping reranking.
The complete hosted profile was exercised live on 2026-09-22 with 60 synthetic Markdown chunks: Qwen embedded the corpus and query, RRF supplied 50 candidates, Cohere returned all 50 scores, five passages reached DeepSeek, and the public result contained only the correct answer. OpenRouter reported a total cost of $0.00214904. This is a wiring check, not a retrieval-quality benchmark.
The public answer pipeline operates across three stages:
.md while excluding HTML. Chunks are indexed for BM25 and Qwen3 Embedding 4B dense retrieval.RRF, k=60). At most 50 fused candidates reach Cohere Rerank 4 Fast; it keeps five.The answer-only decoder accepts a nonempty result string, optionally with a
string reason, or a nonempty error string. Legacy passage arrays, unexpected
metadata fields, malformed JSON, and empty output fail closed instead of being
serialized to the caller.
Use rag.core.RAGPipeline and rag.fetch.query_documents for new Python callers.
RAGPipelineV2, fetchExternalKnowledge, and the original core chunk/BM25 imports
remain compatibility entry points. Parser functions can also be imported directly,
for example rag.parsers.pdf.extract_pdf_text; importing one reader does not load
unrelated formats. Existing pipeline extraction overrides are retained.
Repository structure:
rag-mcp/
├── server.py # stdio JSON-RPC MCP host
├── rag/ # chunking, BM25, vector search, reranking
└── utils/proxy.py # local proxy-environment handling
Approved hosted-profile boundaries:
query_knowledge_base and retrieval-only search_workspace for a saved workspace;qwen/qwen3-embedding-4b plus always-on BM25;cohere/rerank-4-fast, with no silent fallback;deepseek/deepseek-v4.1-flash;doc_path, or a saved workspace with workspace_id;~/.local/share/rag/index, or RAG_MCP_DATA_DIR);.git, node_modules, .venv, dist, build, and target are rejected;Pipeline settings can be changed without editing source. The table shows source
defaults; saved settings and RAG_MCP_* environment variables override them. The
approved hosted profile uses Qwen3 Embedding 4B even though a clean installation
starts with no embedding model until setup is completed.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.