mcp-ragdocs
一个 MCP 服务器实现,它提供工具,通过向量搜索来检索和处理文档,从而使 AI 助手能够利用相关的文档上下文来增强其回复。
Tools
search_documentation
Search through stored documentation using natural language queries. Use this tool to find relevant information across all stored documentation sources. Returns matching excerpts with context, ranked by relevance. Useful for finding specific information, code examples, or related documentation.
list_sources
List all documentation sources currently stored in the system. Returns a comprehensive list of all indexed documentation including source URLs, titles, and last update times. Use this to understand what documentation is available for searching or to verify if specific sources have been indexed.
extract_urls
Extract and analyze all URLs from a given web page. This tool crawls the specified webpage, identifies all hyperlinks, and optionally adds them to the processing queue. Useful for discovering related documentation pages, API references, or building a documentation graph. Handles various URL formats and validates links before extraction.
remove_documentation
Remove specific documentation sources from the system by their URLs. Use this tool to clean up outdated documentation, remove incorrect sources, or manage the documentation collection. The removal is permanent and will affect future search results. Supports removing multiple URLs in a single operation.
list_queue
List all URLs currently waiting in the documentation processing queue. Shows pending documentation sources that will be processed when run_queue is called. Use this to monitor queue status, verify URLs were added correctly, or check processing backlog. Returns URLs in the order they will be processed.
run_queue
Process and index all URLs currently in the documentation queue. Each URL is processed sequentially, with proper error handling and retry logic. Progress updates are provided as processing occurs. Use this after adding new URLs to ensure all documentation is indexed and searchable. Long-running operations will process until the queue is empty or an unrecoverable error occurs.
clear_queue
Remove all pending URLs from the documentation processing queue. Use this to reset the queue when you want to start fresh, remove unwanted URLs, or cancel pending processing. This operation is immediate and permanent - URLs will need to be re-added if you want to process them later. Returns the number of URLs that were cleared from the queue.
README
RAG 文档 MCP 服务器
一个 MCP 服务器实现,提供通过向量搜索检索和处理文档的工具,使 AI 助手能够使用相关的文档上下文来增强其响应。
特性
- 基于向量的文档搜索和检索
- 支持多个文档来源
- 语义搜索能力
- 自动化文档处理
- LLM 的实时上下文增强
工具
search_documentation
使用自然语言查询搜索存储的文档。返回匹配的摘录及其上下文,并按相关性排序。
输入:
query(字符串):要在文档中搜索的文本。可以是自然语言查询、特定术语或代码片段。limit(数字,可选):要返回的最大结果数(1-20,默认值:5)。更高的限制提供更全面的结果,但可能需要更长的处理时间。
list_sources
列出当前存储在系统中的所有文档来源。返回所有已索引文档的完整列表,包括源 URL、标题和上次更新时间。使用此功能可以了解哪些文档可用于搜索,或验证是否已索引特定来源。
extract_urls
从给定的网页中提取和分析所有 URL。此工具会抓取指定的网页,识别所有超链接,并可选择将它们添加到处理队列中。
输入:
url(字符串):要分析的网页的完整 URL(必须包含协议,例如 https://)。该页面必须可公开访问。add_to_queue(布尔值,可选):如果为 true,则自动将提取的 URL 添加到处理队列中,以便稍后进行索引。在大型网站上使用时要小心,以避免过度排队。
remove_documentation
通过 URL 从系统中删除特定的文档来源。删除是永久性的,会影响未来的搜索结果。
输入:
urls(字符串数组):要从数据库中删除的 URL 数组。每个 URL 必须与添加文档时使用的 URL 完全匹配。
list_queue
列出当前在文档处理队列中等待的所有 URL。显示将在调用 run_queue 时处理的待处理文档来源。使用此功能可以监视队列状态,验证 URL 是否已正确添加,或检查处理积压。
run_queue
处理和索引当前在文档队列中的所有 URL。每个 URL 都会按顺序处理,并具有适当的错误处理和重试逻辑。处理过程中会提供进度更新。长时间运行的操作将一直处理,直到队列为空或发生无法恢复的错误。
clear_queue
从文档处理队列中删除所有待处理的 URL。当您想要重新开始、删除不需要的 URL 或取消待处理的处理时,可以使用此功能重置队列。此操作是立即且永久性的 - 如果您想稍后处理 URL,则需要重新添加它们。
用法
RAG 文档工具专为以下目的而设计:
- 使用相关文档增强 AI 响应
- 构建文档感知 AI 助手
- 为开发人员创建上下文感知工具
- 实现语义文档搜索
- 增强现有知识库
配置
与 Claude Desktop 一起使用
将其添加到您的 claude_desktop_config.json:
{
"mcpServers": {
"rag-docs": {
"command": "npx",
"args": [
"-y",
"@hannesrudolph/mcp-ragdocs"
],
"env": {
"OPENAI_API_KEY": "",
"QDRANT_URL": "",
"QDRANT_API_KEY": ""
}
}
}
}
您需要为以下环境变量提供值:
OPENAI_API_KEY:您的 OpenAI API 密钥,用于生成嵌入QDRANT_URL:您的 Qdrant 向量数据库实例的 URLQDRANT_API_KEY:用于向 Qdrant 验证身份的 API 密钥
许可证
此 MCP 服务器已获得 MIT 许可证的许可。这意味着您可以自由使用、修改和分发该软件,但须遵守 MIT 许可证的条款和条件。有关更多详细信息,请参阅项目存储库中的 LICENSE 文件。
致谢
本项目是 qpd-v/mcp-ragdocs 的一个分支,最初由 qpd-v 开发。原始项目为该实现提供了基础。
推荐服务器
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mult-fetch-mcp-server
一个多功能的、符合 MCP 规范的网页内容抓取工具,支持多种模式(浏览器/Node)、格式(HTML/JSON/Markdown/文本)和智能代理检测,并提供双语界面(英语/中文)。
Knowledge Graph Memory Server
为 Claude 实现持久性记忆,使用本地知识图谱,允许 AI 记住用户的信息,并可在自定义位置存储,跨对话保持记忆。
Hyperbrowser
欢迎来到 Hyperbrowser,人工智能的互联网。Hyperbrowser 是下一代平台,旨在增强人工智能代理的能力,并实现轻松、可扩展的浏览器自动化。它专为人工智能开发者打造,消除了本地基础设施和性能瓶颈带来的麻烦,让您能够:
Exa MCP Server
一个模型上下文协议服务器,它使像 Claude 这样的人工智能助手能够以安全和受控的方式,使用 Exa AI 搜索 API 执行实时网络搜索。
mcp-perplexity
Perplexity API 的 MCP 服务器。
MCP Web Research Server
一个模型上下文协议服务器,使 Claude 能够通过集成 Google 搜索、提取网页内容和捕获屏幕截图来进行网络研究。
PubMedSearch MCP Server
一个模型内容协议(Model Content Protocol)服务器,提供从 PubMed 数据库搜索和检索学术论文的工具。
YouTube Translate MCP
一个模型上下文协议服务器,可以通过文字稿、翻译、摘要和各种语言的字幕生成来访问 YouTube 视频内容。