
Grounded Docs MCP Server:Context7、Nia 和 Ref.Tools 的开源替代方案
概览
通过为你的AI编码助手提供个性化、始终最新的文档索引,解决了AI幻觉和过时知识的问题。它能从网站、GitHub、npm、PyPI和本地文件获取官方文档,让你的AI查询你正在使用的具体版本。 开源的 、 、 和 。 - ✅ 按需直接从官方来源获取文档。- 🎯 查询针对项目中的精确库版本。- 💡 将LLM建立在真实文档中。- 🔒 完全运行在您的机器上;您的代码从未离开网络。- 🧩 支持任何兼容MCP的客户端(如Claude、Cline等)。- 📁 索引网站、GitHub仓库、本地文件夹和zip压缩文档。- 📄 处理HTML、Markdown、PDF、Office文档(Word、Excel、PowerPoint)、OpenDocument、RTF、EPUB、Jupyter Notebooks和90+源代码语言。 完整参考文献包括MIME类型和处理细节。
概述(AI 翻译)
Grounded Docs 为你的 AI 编码助手提供了一个与你使用的库版本相匹配的文档索引。它从网站、GitHub 仓库、npm、PyPI 和本地文件夹获取文档,并通过模型上下文协议(MCP)、命令行和网页界面提供搜索功能。你的助手会根据文档回答,而不是它记忆的内容。
它是 Context7、Nia 和 Ref.Tools 的开源替代方案。
特色
- 索引网站、GitHub仓库、npm和PyPI包、本地文件夹及归档(ZIP、TAR)。
- 读取 HTML、Markdown、PDF、Office 和 OpenDocument 文件、EPUB、Jupyter 笔记本、源代码等。参见支持格式。
- 分别存储每个库版本,因此搜索目标是项目使用的版本。
- 结合了全文搜索和可选的矢量搜索,通过OpenAI、Ollama、Gemini、Vertex AI、AWS Bedrock、Azure OpenAI或任何兼容OpenAI的服务器。
- 运行在您的机器上,并将索引保存在本地的SQLite数据库中。文档文本只发送到您配置的嵌入提供商;而本地的嵌入提供者,如Ollama,则文本会留在您的机器上。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Grounded Docs MCP Server
Grounded Docs gives your AI coding assistant a documentation index that matches the library versions you use. It fetches documentation from websites, GitHub repositories, npm, PyPI and local folders, and serves search over the Model Context Protocol (MCP), a command line and a web UI. Your assistant answers from that documentation instead of from what it remembers.
It is an open-source alternative to Context7, Nia and Ref.Tools.
Features
- Indexes websites, GitHub repositories, npm and PyPI packages, local folders and archives (ZIP, TAR).
- Reads HTML, Markdown, PDF, Office and OpenDocument files, EPUB, Jupyter notebooks, source code and more. See Supported Formats.
- Stores each library version separately, so a search targets the version your project uses.
- Combines full-text search with optional vector search through OpenAI, Ollama, Gemini, Vertex AI, AWS Bedrock, Azure OpenAI or any OpenAI-compatible server.
- Runs on your machine and keeps its index in a local SQLite database. Document text goes only to the embedding provider you configure; with a local one, such as Ollama, it stays on your machine. Usage telemetry is on by default; Telemetry lists what it sends and how to turn it off.
- Works with any MCP client, over stdio or Streamable HTTP.
Quick Start
You need Node.js 22 or later, or Docker. Installation covers both in detail, along with Docker Compose and running the server inside your AI client.
1. Start the server
npx @arabold/docs-mcp-server@latest
Or with Docker:
docker run --rm \
-v docs-mcp-data:/data \
-v docs-mcp-config:/config \
-p 6280:6280 \
ghcr.io/arabold/docs-mcp-server:latest
2. Turn on vector search (optional)
Without an embedding model, search uses full-text matching. Vector search also finds passages by meaning. To use OpenAI, start the server with OPENAI_API_KEY set:
OPENAI_API_KEY="sk-proj-..." npx @arabold/docs-mcp-server@latest
With Docker, add -e OPENAI_API_KEY="sk-proj-...". Embedding Models covers Ollama, Gemini, Azure OpenAI and other providers.
Do this before you add documentation. Embeddings are computed when a page is indexed, so documentation indexed without a model gets no vectors until you scrape it again with --replace.
3. Add documentation
Open the web UI at http://localhost:6280 and choose Add library.
4. Connect your AI client
Add the server’s MCP endpoint, http://localhost:6280/mcp, to your client. Most clients accept an entry like this:
{
"mcpServers": {
"docs-mcp-server": {
"url": "http://localhost:6280/mcp"
}
}
}
安装
npx @arabold/docs-mcp-server@latest配置
{
"mcpServers": {
"docs-mcp-server": {
"url": "http://localhost:6280/mcp"
}
}
}