GitHub仓库分析工具

GitHub Chat MCP是一个用于分析和查询GitHub仓库的工具,通过GitHub Chat API实现仓库索引和查询功能。

  • by AsyncFuncAI
  • Python
  • 本地部署
  • 62 星标
  • 更新于
在 GitHub 查看 asyncfuncai/github-chat-mcp

使用说明

GitHub聊天MCP

一种模型上下文协议(MCP),用于使用GitHub Chat API分析和查询GitHub存储库。官方网站:https://github-chat.com

安装

# Install with pip
pip install github-chat-mcp

# Or install with the newer uv package manager
uv install github-chat-mcp
  1. 开始使用它与克劳德!

示例提示:

  • “使用github chat mcp分析React仓库”
  • “使用github chat mcp对TypeScript存储库进行索引,并询问其架构”

GitHub聊天MCP服务器

安装说明

在做任何事情之前,请确保您有一个GitHub Chat API密钥。这是使用服务所必需的。

先安装uv。

MacOS/Linux:

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

窗户:

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

使用光标设置(推荐)

在mcp.json中:

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

有了上述功能,不需要envs,因为这是一个免费增值版本。

使用Claude Desktop进行设置

# claude_desktop_config.json
# Can find location through:
# Hamburger Menu -> File -> Settings -> Developer -> Edit Config
# Must perform: 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与Claude聊天

  1. 首先索引GitHub存储库: “将GitHub存储库索引到https://github.com/username/repo"

  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

窗户:

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

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

cd github-chat-mcp

# Create virtual environment and activate it
uv venv

source .venv/bin/activate # MacOS/Linux
# OR
.venv/Scripts/activate # Windows

# Install dependencies
uv sync

使用Claude Desktop进行设置

使用MCP CLI SDK

# `pip install mcp[cli]` if you haven't
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
# Can find location through:
# Hamburger Menu -> File -> Settings -> Developer -> Edit Config
{
  "mcpServers": {
    "github-chat": {
      "command": "uv",
      "args": [
        "--directory",
        "/ABSOLUTE/PATH/TO/PARENT/FOLDER/github-chat-mcp",
        "run",
        "github-chat-mcp"
      ],
      "env": {
      }
    }
  }
}

使用GitHub与Claude聊天

  1. 首先索引GitHub存储库: “将GitHub存储库索引到https://github.com/username/repo"

  2. 然后询问有关存储库的问题: “这个存储库中使用的核心技术栈是什么?”

调试

运行:

# If mcp cli installed (`pip install mcp[cli]`)
mcp dev /ABSOLUTE/PATH/TO/PARENT/FOLDER/github-chat-mcp/src/github_chat_mcp/server.py

# If not
npx @modelcontextprotocol/inspector \
      uv \
      --directory /ABSOLUTE/PATH/TO/PARENT/FOLDER/github-chat-mcp \
      run \
      github-chat-mcp

然后访问MCP检查器 http://localhost:5173.您可能需要在下的检查器中的环境变量中添加您的GitHub API密钥 GITHUB_API_KEY.

备注

  • 测井水平可通过以下方式调节 FASTMCP_LOG_LEVEL 环境变量(例如。 FASTMCP_LOG_LEVEL="ERROR")
  • 此MCP服务器提供两个主要工具:
    1. 仓库索引-对GitHub仓库进行索引和分析
    2. 存储库查询-询问有关索引存储库的问题