返回市场
GitHub聊天MCP服务器

GitHub聊天MCP服务器

作者:AsyncFuncAI62 星标更新:2025-04-10

项目介绍

GitHub Chat MCP

一个用于通过GitHub Chat API分析和查询GitHub仓库的模型上下文协议(MCP)。官方网站:https://github-chat.com

安装

# 使用pip安装
pip install github-chat-mcp

# 或者使用更新的uv包管理器安装
uv install github-chat-mcp
  1. 开始使用Claude!

示例提示:

  • "使用github-chat-mcp分析React仓库"
  • "用github-chat-mcp索引TypeScript仓库并询问其架构"

GitHub Chat MCP服务器

smithery徽章

设置指南

在开始之前,请确保您拥有GitHub Chat API密钥。这是使用该服务所必需的。

首先安装uv。

MacOS/Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

使用Cursor设置(推荐)

在mcp.json中:

{
  "mcpServers": {
    "github-chat": {
      "command": "uvx",
      "args": [
        "github-chat-mcp"
      ]
    }
  }
}

由于这是一个免费增值版本,因此不需要环境变量。

使用Claude Desktop设置

# claude_desktop_config.json
# 可以通过以下方式找到位置:
# 汉堡菜单 -> 文件 -> 设置 -> 开发者 -> 编辑配置
# 必须执行:brew install uv
{
  "mcpServers": {
    "github-chat": {
      "command": "uvx",
      "args": ["github-chat-mcp"],
      "env": {
      }
    }
  }
}

通过Smithery安装

您可以自动通过Smithery为Claude Desktop安装GitHub Chat:

npx -y @smithery/cli install github-chat-mcp --client claude

使用GitHub Chat与Claude

  1. 首先索引一个GitHub仓库: "索引位于https://github.com/username/repo的GitHub仓库"

  2. 然后询问关于该仓库的问题: "这个仓库使用的主技术栈是什么?"

调试

运行:

npx @modelcontextprotocol/inspector uvx github-chat-mcp

本地/开发设置指南

克隆仓库

git clone https://github.com/yourusername/github-chat-mcp.git

安装依赖项

首先安装uv。

MacOS/Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

然后安装MCP服务器依赖项:

cd github-chat-mcp

# 创建虚拟环境并激活它
uv venv

source .venv/bin/activate # MacOS/Linux
# 或者
.venv/Scripts/activate # Windows

# 安装依赖项
uv sync

使用Claude Desktop设置

使用MCP CLI SDK

# 如果还没有安装,请运行 `pip install mcp[cli]`
mcp install /ABSOLUTE/PATH/TO/PARENT/FOLDER/github-chat-mcp/src/github_chat_mcp/server.py -v "GITHUB_API_KEY=API_KEY_HERE"

手动设置

# claude_desktop_config.json
# 可以通过以下方式找到位置:
# 汉堡菜单 -> 文件 -> 设置 -> 开发者 -> 编辑配置
{
  "mcpServers": {
    "github-chat": {
      "command": "uv",
      "args": [
        "--directory",
        "/ABSOLUTE/PATH/TO/PARENT/FOLDER/github-chat-mcp",
        "run",
        "github-chat-m
cp"
      ],
      "env": {
      }
    }
  }
}

使用GitHub Chat与Claude

  1. 首先索引一个GitHub仓库: "索引位于https://github.com/username/repo的GitHub仓库"

  2. 然后询问关于该仓库的问题: "这个仓库使用的主技术栈是什么?"

调试

运行:

# 如果已安装mcp cli (`pip install mcp[cli]`)
mcp dev /ABSOLUTE/PATH/TO/PARENT/FOLDER/github-chat-mcp/src/github_chat_mcp/server.py

# 如果未安装
npx @modelcontextprotocol/inspector \
      uv \
      --directory /ABSOLUTE/PATH/TO/PARENT/FOLDER/github-chat-mcp \
      run \
      github-chat-mcp

然后访问MCP Inspector在http://localhost:5173。您可能需要在inspector下的环境变量中添加您的GitHub API密钥作为GITHUB_API_KEY

注意事项

  • 日志级别可以通过FASTMCP_LOG_LEVEL环境变量进行调整(例如FASTMCP_LOG_LEVEL="ERROR"
  • 这个MCP服务器提供了两个主要工具:
    1. 仓库索引 - 索引和分析一个GitHub仓库
    2. 仓库查询 - 关于已索引仓库提问