rag-retriever-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@rag-retriever-mcp search my indexed documents for references to machine learning"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
rag-retriever
A lightweight, local-first document retrieval engine that mounts to an agent as an MCP tool. Drop files in; the agent searches them and answers with its own LLM. There is no LLM in here — this is only the "front half" of RAG (extract → chunk → embed → store + similarity search).
your agent (owns the LLM)
│ calls MCP tool: search("question")
▼
rag-retriever ──► extract ─► chunk ─► embed ─► LanceDB
▲ │
└────────── returns relevant passages ◄────────┘
│
agent reads passages → answers with its own LLMBuilt from the same proven pieces as Open Notebook (file extraction + bge-m3 embeddings + vector search), minus the heavyweight backend, UI, and answer/podcast generation you don't need.
Why this shape
One LLM, not two. The retriever never answers; your agent does. You keep full control of reasoning, prompts, and cost.
Local-first. Default backend (
fastembed) runs entirely offline, no server.Pluggable embeddings. Switch between fully local and a China-friendly cloud API (SiliconFlow) with one env var — no code change.
Related MCP server: io.github.Brightdotdev/darwin-rag
Install
cd rag-retriever
uv sync
cp .env.example .env # then pick your embedding backendConfigure the embedding backend (.env)
| What it uses | Notes |
| fastembed (ONNX, in-process) | 100% offline, no server, heavier first install |
| local Ollama daemon |
|
| OpenAI-compatible API (e.g. SiliconFlow) | needs |
⚠️ Index-time and query-time must use the same backend + model. Changing the model means re-indexing everything.
Use (CLI, for testing)
uv run rag-retriever index "C:\path\to\docs" # a file or a whole folder
uv run rag-retriever search "什么是表见代理" -k 5
uv run rag-retriever list
uv run rag-retriever statsMount as an MCP server (the real entry point)
Run uv run rag-retriever-mcp (stdio). Register it with your MCP client. For
Claude Code, add to your MCP config:
{
"mcpServers": {
"rag-retriever": {
"command": "uv",
"args": ["run", "--directory", "D:\\Vibe Coding Items\\rag-retriever", "rag-retriever-mcp"]
}
}
}Tools exposed: index_path, search, list_sources, stats.
Supported files
pdf, docx, pptx, xlsx, html, md, txt, csv, json, epub (via markitdown). Scanned / image-only PDFs need an OCR engine (tesseract) installed separately; without it they extract empty and are reported as skipped.
Layout
rag_retriever/
config.py # env-driven config; picks the embedding backend
extract.py # file -> text (markitdown)
chunk.py # token-based chunking with overlap
embed.py # local | ollama | openai-compatible backends
store.py # LanceDB vector store (embedded, no server)
pipeline.py # ingest + search orchestration (no LLM)
server.py # MCP server (agent-facing)
cli.py # manual CLIAvailable Tools
4 toolsindex_pathA
Index a file or a whole folder of documents (pdf, docx, pptx, xlsx, html, md, txt...). Extracts text, chunks it, embeds it, and stores vectors for later search. Returns a summary of how many files/chunks were indexed and what was skipped.
Inputs: path (required), recursive. Returns: result
list_sourcesB
List the documents currently indexed and how many chunks each has.
Inputs: no named parameters. Returns: result
searchA
Search the indexed documents for passages relevant to query and return the
top k chunks (with source path and similarity score). Use these passages as
grounding to answer the user's question yourself — this tool does NOT answer.
Inputs: query (required), k. Returns: result
statsA
Show retriever status: embedding backend/model, storage location, and counts.
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a distinct purpose: indexing files, searching passages, listing indexed sources, and showing system stats—no overlap or ambiguity.
All tool names follow a consistent verb_noun snake_case pattern (e.g., index_path, list_sources) with clear, predictable naming.
With only 4 tools, the set is well-scoped for a document retrieval MCP, covering core operations without unnecessary bloat.
The set covers key operations (index, search, list, stats) but lacks a tool to delete indexed documents, which is a minor but notable gap.
Related MCP Connectors
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Your personal library, readable by AI agents: durable snapshots, hybrid search, 46 MCP tools.
Query your own PDFs and documents from any MCP client. Every answer cites the page it came from.
Agentic search over your Dewey document collections from any MCP-compatible client.
Related MCP Servers
FlicenseNot gradedqualityDmaintenanceMinimal local RAG stack with an MCP server that provides document search for any agent.1-- AlicenseNot gradedqualityCmaintenanceA local-first RAG engine that ingests documents (PDF, Markdown, images, etc.) and provides hybrid search, reranking, and LLM answer synthesis via MCP for AI agent integration.34 PyPI3MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to manage, upload, chunk, and semantically search local documents through MCP tools and a REST API, with a built-in web dashboard and optional Gemini-powered AI search.1MIT
- AlicenseNot gradedqualityBmaintenanceTurns any folder of PDFs, markdown, and text files into a local, queryable knowledge base exposed as an MCP server. Enables MCP-compatible agents to semantically search indexed documents, retrieve relevant passages with source and relevance scores, list or reindex documents, and inspect cache and token usage — instead of reading whole files into context.1MIT