MCP-Ragdocs
模型上下文协议 (MCP) 服务器,支持使用向量数据库 (Qdrant) 进行文档的语义搜索和检索。此服务器允许您从 URL 或本地文件添加文档,然后使用自然语言查询进行搜索。
快速安装指南
- 全局安装包:
- 启动 Qdrant(使用 Docker):
- 确保 Ollama 使用默认嵌入模型运行:
- 添加到您的配置文件:
- 对于 Cline:
%AppData%\Roaming\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
- 对于 Roo-Code:
%AppData%\Roaming\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\cline_mcp_settings.json
- 对于 Claude 桌面:
%AppData%\Claude\claude_desktop_config.json
- 对于 Cline:
- 验证安装:
版本
当前版本:0.1.6
特征
- 从 URL 或本地文件添加文档
- 将文档存储在向量数据库中以进行语义搜索
- 使用自然语言搜索文档
- 列出所有文档来源
安装
使用 npm 全局安装:
这将在您的全局 npm 目录中安装服务器,您将需要它来完成下面的配置步骤。
要求
- Node.js 16 或更高版本
- Qdrant(本地或云端)
- 以下其中之一用于嵌入:
- Ollama 在本地运行(默认,免费)
- OpenAI API 密钥(可选,付费)
Qdrant 设置选项
选项 1:本地 Qdrant
- 使用 Docker(推荐):
- 或者从Qdrant 网站下载
选项 2:Qdrant Cloud
- 在Qdrant Cloud创建帐户
- 创建新集群
- 从仪表板获取集群 URL 和 API 密钥
- 在您的配置中使用这些(请参阅下面的配置部分)
配置
该服务器可与 Cline/Roo 和 Claude Desktop 一起使用。两者的配置略有不同:
克莱恩配置
添加到您的 Cline 设置文件( %AppData%\Roaming\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
)和/或添加到您的 Roo-Code 设置文件( %AppData%\Roaming\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\cline_mcp_settings.json
):
- 使用 npm global install(推荐):
对于 OpenAI 而不是 Ollama:
- 使用本地开发设置:
Claude桌面配置
添加到您的 Claude Desktop 配置文件:
- Windows:
%AppData%\Claude\claude_desktop_config.json
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- 使用 Ollama 进行 Windows 安装(使用完整路径):
使用 OpenAI 的 Windows 设置:
- 使用 Ollama 设置 macOS:
Qdrant 云配置
对于 Cline 或 Claude Desktop,使用 Qdrant Cloud 时,修改 env 部分:
与 Ollama 一起:
使用 OpenAI:
环境变量
Qdrant 配置
QDRANT_URL
(必需):您的 Qdrant 实例的 URLQDRANT_API_KEY
(云所需):您的 Qdrant Cloud API 密钥
嵌入配置
EMBEDDING_PROVIDER
(可选):在“ollama”(默认)或“openai”之间选择EMBEDDING_MODEL
(可选):- 对于 Ollama:默认为“nomic-embed-text”
- 对于 OpenAI:默认为“text-embedding-3-small”
OLLAMA_URL
(可选): 您的 Ollama 实例的 URL (默认为http://localhost:11434 )OPENAI_API_KEY
(使用 OpenAI 时需要):您的 OpenAI API 密钥
可用工具
add_documentation
- 将文档从 URL 添加到 RAG 数据库
- 参数:
url
:要获取的文档的 URL
search_documentation
- 搜索存储的文档
- 参数:
query
:搜索查询limit
(可选):返回的最大结果数(默认值:5)
list_sources
- 列出当前存储的所有文档源
- 无需参数
示例用法
在 Claude Desktop 或任何其他兼容 MCP 的客户端中:
- 添加文档:
- 搜索文档:
- 列出来源:
发展
- 克隆存储库:
- 安装依赖项:
- 构建项目:
- 本地运行:
执照
麻省理工学院
故障排除
常见问题
- Qdrant 连接错误
- 检查 Docker 是否正在运行
- 验证 Qdrant 容器是否正在运行:
docker ps | grep qdrant
- 尝试重启容器
- Ollama 模型失踪
- 运行:
ollama pull nomic-embed-text
- 验证模型是否已安装:
ollama list
- 运行:
- 配置路径问题
- Windows:将
YOUR_USERNAME
替换为您的实际 Windows 用户名 - 检查文件权限
- 验证路径是否存在
- Windows:将
- npm 全局安装问题
- 尝试使用管理员权限安装
- 检查 npm 是否在 PATH 中:
npm -v
- 验证全局安装:
npm list -g @qpd-v/mcp-server-ragdocs
对于其他问题,请查看:
- Docker 日志:
docker logs $(docker ps -q --filter ancestor=qdrant/qdrant)
- Ollama 状态:
ollama list
- Node.js 版本:
node -v
(应为 16 或更高版本)
贡献
欢迎贡献代码!欢迎提交 Pull 请求。
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
模型上下文协议 (MCP) 服务器,支持使用向量数据库 (Qdrant) 进行文档的语义搜索和检索。此服务器允许您从 URL 或本地文件添加文档,然后使用自然语言查询进行搜索。
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol (MCP) server that enables LLMs to interact directly the documents that they have on-disk through agentic RAG and hybrid search in LanceDB. Ask LLMs questions about the dataset as a whole or about specific documents.Last updated -1231TypeScriptMIT License
- -securityAlicense-qualityA tool for Model Context Protocol (MCP) that allows you to analyze web content and add it to your knowledge base, storing content as Markdown files for easy viewing with tools like Obsidian.Last updated -6PythonMIT License
- AsecurityAlicenseAquality🔍 A Model Context Protocol (MCP) server providing unified access to multiple search engines (Tavily, Brave, Kagi), AI tools (Perplexity, FastGPT), and content processing services (Jina AI, Kagi). Combines search, AI responses, content processing, and enhancement features through a single interface.Last updated -1510988TypeScriptMIT License
- AsecurityAlicenseAqualityA documentation server based on MCP protocol designed for various development frameworks that provides multi-threaded document crawling, local document loading, keyword searching, and document detail retrieval.Last updated -237JavaScriptMIT License