rag-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
rag-mcp
基于 FastMCP 的 RAG 服务,通过标准 MCP 协议对外暴露文档检索能力。
已支持工具:
rag_rebuild_index— 索引指定目录的文档rag_index_status— 查看当前索引状态rag_search— 关键词 / 向量搜索rag_read_resource— 读取资源内容(rag://...URI)
说明:hybrid / rerank 为预留模式,尚未实现。
安装
uv syncRelated MCP server: MCP-RAGAnything
配置
cp .env.example .env
# 编辑 .env,至少填入 EMBEDDING_API_KEY(vector 搜索必需)核心环境变量:
变量 | 默认值 | 说明 |
|
| 索引数据目录 |
|
| 传输模式: |
|
| SSE 模式监听地址( |
|
| SSE 模式监听端口( |
| — | vector 搜索必填 |
|
| Embedding 服务地址 |
|
| Embedding 模型 |
| 自动检测 | 向量维度(可选) |
|
| 请求超时秒数 |
|
| 默认返回结果数 |
|
| 关键词检索候选数 |
|
| 分块大小(字符数) |
|
| 分块重叠(字符数) |
运行
stdio 模式(默认,供 MCP 客户端接入)
uv run python main.pySSE 模式(HTTP 服务,供调试或 Web 客户端使用)
MCP_TRANSPORT=sse uv run python main.py验证:
curl http://127.0.0.1:8787/health
# {"status": "ok"}MCP 端点:http://127.0.0.1:8787/mcp
资源访问端点:http://127.0.0.1:8787/resource?uri=rag://...
接入 Claude Desktop
在 Claude Desktop 配置文件中添加:
{
"mcpServers": {
"rag-mcp": {
"command": "uv",
"args": ["run", "python", "main.py"],
"cwd": "/path/to/rag_mcp"
}
}
}典型用法
调用
rag_rebuild_index,传入文档目录路径(支持.md/.txt/.pdf)调用
rag_search,指定查询词和模式(keyword或vector)通过
rag_read_resource读取搜索结果中的资源 URI
测试
uv run pytest -qThis server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for querying Forkast documentation
Agentic search over your Dewey document collections from any MCP-compatible client.
Related MCP Servers
- AlicenseDqualityCmaintenanceA lightweight RAG system that provides an MCP server for searching and interacting with vector-based knowledge bases. It enables users to perform retrieval-augmented generation and search across Qdrant collections through a standardized interface.12MIT
- FlicenseNot gradedqualityDmaintenanceMulti-modal RAG service exposing a REST API and MCP server for document indexing and knowledge-base querying, powered by RAGAnything and LightRAG.15-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that indexes documents and serves relevant context to LLMs via Retrieval Augmented Generation (RAG).21 npm36MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server for Retrieval-Augmented Generation (RAG) operations. It provides tools for building and querying vector-based knowledge bases from document collections, enabling semantic search and document retrieval capabilities.33 PyPI3MIT