文档MCP服务器

一个基于Python SDK的文档MCP服务器,用于在开发环境中集成MCP工具,支持VSCode Copilot聊天和Claude Desktop等客户端。

  • by Shivansh12t
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 shivansh12t/docs-mcp-server-pythonsdk

使用说明

使用Python SDK编写MCP服务器文档

先决条件

  • uv 包管理器(可选,但 强烈推荐)
  • claude桌面或光标(基本上是任何MCP客户端)
  • Serper帐户-搜索工具(免费,无需信用卡)

安装

将MCP添加到Python项目中

uv add "mcp[cli]"

或者,对于使用pip作为依赖关系的项目:

pip install "mcp[cli]"

开发人员快速入门

克隆存储库

git clone https://github.com/shivansh12t/docs-mcp-pythonsdk
cd docs-mcp-pythonsdk

安装依赖项(可选)

uv pip sync

根据template.env创建.env

SERPER_API_KEY=<your_api_key>

将MCP服务器添加到VSCode副驾驶聊天

  1. 首选 .vscode/mcp.json
  2. 将args更新为mcp服务器的绝对路径
  3. 它应该已经启动并运行了 Agent Mode
  4. 如果您有任何问题,请访问 在VSCode副驾驶聊天中使用MCP服务器

将MCP添加到客户端-此处为Claude Desktop

  1. 打开克劳德桌面,转到设置 shift + ,
  2. Edit Configurations
  3. 将以下带有正确路径的json添加到 claude_desktop_configurations.json
{
    "mcpServers": {
            "documentation": {
                "command": "uv",
                "args": [
                    "--directory",
                    "absolute/path/to/the/project",
                    "run",
                    "main.py"
                ]
            }
        }
}
  1. 重启克劳德&如果你在聊天室附近看到一个锤子标志,恭喜你的MCP已启动并运行

使用MCP检查器

npx @modelcontextprotocol/inspector uv run main.py