GitHub服务器配置工具

MCP Server Setup Guide 提供了在Volta环境下配置GitHub服务器的详细步骤和故障排除方法,适用于开发者在本地环境中快速设置和验证GitHub服务器连接。

  • by amurata
  • 本地部署
  • 更新于
在 GitHub 查看 amurata/mcpserver

使用说明

MCP服务器设置指南

配置

MCP设置位置

配置文件位于:

  • 光标用: ~/Library/Application Support/Cursor/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
  • 克劳德桌面用: ~/Library/Application Support/Claude/claude_desktop_config.json

Volta环境中的设置示例

macOS单击功能区上Volta使用时,以下设置将起作用:

{
  "mcpServers": {
    "github.com/modelcontextprotocol/servers/tree/main/src/github": {
      "command": "/Users/username/.volta/bin/npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

故障排除

失败模式

  1. node 直接使用命令
{
  "command": "node",
  "args": [
    "/path/to/server-github/build/index.js"
  ]
}

错误: spawn node ENOENT

  1. volta 使用命令
{
  "command": "/Users/username/.volta/bin/volta",
  "args": [
    "run",
    "node",
    "/path/to/server-github/build/index.js"
  ]
}

错误:连接超时

成功模式

Volta的,之 npx 的完整路径解决方案:

{
  "command": "/Users/username/.volta/bin/npx",
  "args": [
    "-y",
    "@modelcontextprotocol/server-github"
  ]
}

动作确认

要确定服务器是否正确配置,请尝试以下操作:

// リポジトリ検索
{
  "query": "modelcontextprotocol",
  "page": 1,
  "perPage": 5
}

如果能正常返回结果的话,设定就成功了。