MCP文档助手
一个基于人工智能的开发工具,为LLM提供对MCP协议规范和TypeScript SDK文档的即时访问。
概述
MCP Documentation Helper是一个模型上下文协议(MCP)服务器,它将全面的MCP文档作为结构化资源公开。它使像Claude这样的人工智能助手能够在构建自定义MCP服务器时提供准确、上下文感知的指导。
特性
- 📚 完整的文档访问权限 -完整的MCP协议规范和TypeScript SDK文档
- 🔍 上下文感知搜索 -具有相关性评分和聚焦结果的智能搜索
- 📋 代码模板 -常见MCP用例的即用型实现模式
- 🎯 分类资源 -快速访问工具、资源、提示、传输和示例
- 🤖 AI优化 -专为LLM辅助开发工作流程而设计
先决条件
- Node.js 18+或Bun
- MCP客户端(Claude Desktop、Cursor或任何兼容MCP的客户端)
安装
1.克隆存储库
git clone https://github.com/yourusername/mcp-documentation-helper.git
cd mcp-documentation-helper2.安装依赖项
使用npm:
npm install使用Bun:
bun install就是这样!存储库包括所有必要的MCP文档文件 data 目录。
用法
本地运行
使用npm:
npm run dev使用Bun:
bun run dev直接使用Node(构建后):
npm run build
npm run start连接到克劳德桌面
- 打开您的Claude Desktop配置文件:
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json - 视窗: %APPDATA%\Claude\claude_desktop_config.json - Linux: ~/.config/Claude/claude_desktop_config.json
- 添加MCP服务器配置:
对于npm/Node:
{
"mcpServers": {
"mcp-docs": {
"command": "node",
"args": [
"/absolute/path/to/mcp-documentation-helper/build/index.js"
]
}
}
}对于Bun:
{
"mcpServers": {
"mcp-docs": {
"command": "bun",
"args": [
"index.ts"
],
"cwd": "/absolute/path/to/mcp-documentation-helper"
}
}
}- 替换
/absolute/path/to/mcp-documentation-helper使用您的实际项目路径 - 重新启动克劳德桌面
连接到游标
- 打开光标设置→ MCP服务器
- 点击“添加MCP服务器”
- 配置服务器:
对于npm/Node:
{
"name": "mcp-docs",
"command": "node",
"args": [
"/absolute/path/to/mcp-documentation-helper/build/index.js"
]
}对于Bun:
{
"name": "mcp-docs",
"command": "bun",
"args": [
"index.ts"
],
"cwd": "/absolute/path/to/mcp-documentation-helper"
}- 保存并重新启动游标
与VS代码一起使用(通过MCP扩展)
- 安装VS Code的MCP扩展
- 添加到工作区设置(
.vscode/settings.json):
{
"mcp.servers": {
"mcp-docs": {
"command": "node",
"args": [
"/absolute/path/to/mcp-documentation-helper/build/index.js"
]
}
}
}可用资源
连接后,以下资源可用:
| 资源URI | 描述 |
|---|---|
mcp://docs/complete | 完整的MCP协议和SDK文档 |
mcp://docs/quick-start | 入门指南 |
mcp://docs/tools | 工具实施参考 |
mcp://docs/resources | 资源实施参考 |
mcp://docs/prompts | 及时实施参考 |
mcp://docs/transport | 传输设置(stdio、HTTP、SSE) |
mcp://docs/examples | 工作代码示例 |
可用工具
搜索mcp文档
使用上下文感知结果搜索所有MCP文档。
参数:
query(string):你想学习或实现什么focus(可选):all,implementation,concepts,examples,或troubleshooting
获取实现模板
获取常见MCP模式的代码模板。
可用模板:
basic-server-基本MCP服务器结构tool-with-validation-Zod验证工具resource-static-静态资源resource-dynamic-带参数的动态资源prompt-simple-简单提示模板stdio-server-stdio传输设置http-server-HTTP传输设置error-handling-错误处理模式
可用提示
构建服务器
在指导下开始构建新的MCP服务器。
调试服务器
获取调试MCP服务器问题的帮助。
示例用法
连接到Claude Desktop或Cursor后,您可以:
You: "I want to build an MCP server that connects to a PostgreSQL database"
Claude: *Uses mcp-docs resources to provide accurate implementation guidance*You: "How do I implement a dynamic resource with parameters?"
Claude: *Searches documentation and provides relevant examples*You: "Show me how to set up an HTTP transport"
Claude: *Retrieves transport documentation and code templates*发展
项目结构
mcp-documentation-helper/
├── data/ # Documentation files
│ ├── llms-full.txt # MCP protocol documentation
│ └── typescript-sdk-readme.md # TypeScript SDK docs
├── index.ts # Main server implementation
├── package.json # Dependencies and scripts
└── tsconfig.json # TypeScript configuration脚本
npm run dev-使用tsx在开发模式下运行npm run build-将TypeScript构建为JavaScriptnpm run start-运行内置服务器bun run dev-使用Bun跑步(如果使用Bun)
运作原理
- 文档解析:服务器将MCP协议和SDK文档解析为结构化部分
- 资源暴露:文档通过具有语义URI的MCP资源公开
- 智能搜索:内置搜索工具提供具有相关性评分的上下文感知结果
- 代码模板:预构建的模板有助于快速启动常见的实现模式
- AI集成:LLM可以通过标准MCP协议访问文档
故障排除
服务器未显示在Claude桌面中
- 检查配置中的路径是否是绝对的,而不是相对的
- 验证
data目录包含两个必需的文件 - 完全重新启动克劳德桌面
- 检查Claude Desktop日志是否有错误
未找到文档文件
存储库包括所有必要的文档文件。如果您遇到此错误:
- 确保克隆了包含所有文件的完整存储库
- 检查一下
data目录中同时存在这两个文件:
ls data/
# Should show:
# llms-full.txt
# typescript-sdk-readme.md构建错误(节点/NMP)
在开始之前,请确保您已经运行了build命令:
npm run build
npm run start贡献
欢迎投稿!请随时提交拉取请求。
致谢
- 与 模型上下文协议SDK
- 文件来源于 模型上下文协议.io
- 灵感来自 使用LLM构建MCP 指南
链接
______________________________________________________________________
由以下材料制成❤️ 对于MCP社区
