RAG MCP Server
Exposes semantic document retrieval from a ChromaDB collection of arXiv papers as a callable tool for any MCP-compatible client.
README
RAG MCP Server
A standalone Model Context Protocol (MCP) server that exposes semantic document retrieval — over a ChromaDB collection of arXiv research papers — as a callable tool for any MCP-compatible client (Claude Desktop, custom agents, etc.).
This project decouples the retrieval layer from the Agentic Corrective RAG System (a separate project), so the same indexed knowledge base can be queried by any LLM client without needing to know about ChromaDB, embeddings, or the underlying pipeline.
MCP Client (Claude Desktop / any MCP-compatible agent)
│ MCP protocol (stdio)
▼
RAG MCP Server (this project)
│
▼
retrieve_documents(query, top_k)
│
▼
ChromaDB collection "research_papers"
(allenai-specter embeddings, dense retrieval)
Why this exists
Most RAG systems bury retrieval inside a single monolithic pipeline — the vector store is only reachable by running the whole application end to end. This project takes just the retrieval component and puts a standard interface in front of it, so:
- Any MCP client can query the knowledge base directly, without touching LangGraph, Groq, or any generation/correction logic
- The vector store becomes reusable infrastructure instead of an implementation detail locked inside one app
- Swapping the underlying vector DB (ChromaDB → Qdrant → Pinecone) would require no changes to any client, only to this server
What it exposes
retrieve_documents(query: str, top_k: int = 5)
Performs dense semantic search over a corpus of arXiv research papers and returns structured, typed results — not a raw text blob.
Returns: a list of RetrievedChunk objects:
| Field | Type | Description |
|---|---|---|
content |
str | The retrieved chunk text |
title |
str | Title of the source paper |
source |
str | Source PDF filename |
page |
int | Page number within the source document |
arxiv_id |
str | arXiv identifier / URL for the paper |
score |
float | Similarity distance score (lower = closer match) |
Example call (via an MCP client):
"Use retrieve_documents to find information about attention mechanisms in transformers"
Example structured output:
[
{
"content": "Quantifying attention flow in transformers...",
"title": "Beyond the Leaderboard: Design Lessons for Trustworthy Multimodal VQA",
"source": "2607.15241v1.pdf",
"page": 6,
"arxiv_id": "https://arxiv.org/abs/2607.15241v1",
"score": 0.42
}
]
Architecture notes
- Embeddings:
sentence-transformers/allenai-specter, run locally — no API key or embedding cost. - Vector store: ChromaDB, loaded read-only from a pre-built persisted collection (
research_papers). This server never re-indexes or re-embeds documents — it only queries an existing index built by the source RAG pipeline. - Transport: stdio, following the standard local MCP server pattern used by Claude Desktop.
- Server framework:
FastMCP, Anthropic's Python SDK for MCP servers.
Setup
1. Install dependencies
uv add mcp langchain-huggingface langchain-chroma sentence-transformers
2. Provide the vector store
This server expects a pre-built, persisted ChromaDB collection at ./data/chroma_db with collection name research_papers. If you're using this against your own document set, build that collection first using your own ingestion pipeline, or point CHROMA_PERSIST_DIR in vectorstore.py at your existing persisted collection.
3. Run the server directly (sanity check)
uv run python server.py
No output is expected — the server sits idle over stdio waiting for a client to connect. This is normal.
4. Connect to Claude Desktop
Add the server to your claude_desktop_config.json:
{
"mcpServers": {
"rag-retrieval-server": {
"command": "C:\\path\\to\\uv.exe",
"args": [
"--directory",
"C:\\path\\to\\rag-mcp-server",
"run",
"python",
"server.py"
]
}
}
}
Fully quit and restart Claude Desktop, then check "+" → Connectors in the chat box to confirm rag-retrieval-server is listed with the retrieve_documents tool.
Project structure
rag-mcp-server/
├── server.py # MCP server + tool definitions
├── vectorstore.py # Loads the existing Chroma collection (read-only)
├── data/
│ └── chroma_db/ # Persisted ChromaDB collection (copied from source project)
└── README.md
Relationship to the Corrective RAG project
This server reuses the exact same indexed document collection as the Agentic Corrective RAG System — same embeddings, same ChromaDB store — but strips away the LangGraph orchestration, relevance grading, web-search fallback, and Groq-based generation. It exposes only the retrieval primitive, as a standalone, protocol-compliant service.
Possible extensions
retrieve_by_paper(arxiv_id, query)— scoped search within a single paperlist_indexed_papers()— enumerate all papers currently in the collection- HTTP/SSE transport, so the server is reachable over a network instead of only local stdio
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。