# GitHub-MCP代码分析工具
## 基本信息
- Slug: `asyncfuncai-github-chat-mcp`
- Source: modelscope
- Publisher: @AsyncFuncAI/github-chat-mcp
- Categories: version-control / developer-tools
- Hosted: No
- License: MIT License
- Source URL: https://www.modelscope.cn/mcp/servers/@AsyncFuncAI/github-chat-mcp
## 简介
一种MCP服务器，它通过GitHub聊天API启用对GitHub存储库的分析和查询，允许用户对存储库进行索引并对其代码、架构和技术堆栈提出问题。
## 安装提示

```bash
# Install with pip pip install github-chat-mcp # Or install with the newer uv package manager uv install github-chat-mcp
```

## MCP Server 详情

# GitHub Chat MCP

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

## 安装

```bash
# Install with pip
pip install github-chat-mcp

# Or install with the newer uv package manager
uv install github-chat-mcp
```


3. 开始使用 Claude！

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

# GitHub Chat MCP 服务器

[![smithery 徽章](https://smithery.ai/badge/github-chat-mcp)](https://smithery.ai/server/github-chat-mcp)

## 设置说明
> 在开始之前，请确保您拥有 GitHub Chat API 密钥。这是使用该服务所必需的。

首先安装 uv。

MacOS/Linux:
```bash
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 中：

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


如上所述，由于是免费版本，因此不需要环境变量。

### 使用 Claude Desktop 设置
```json
# 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：

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


### 使用 Claude 进行 GitHub Chat
1. 首先索引一个 GitHub 仓库：
   "索引位于 https://github.com/username/repo 的 GitHub 仓库"

2. 然后询问关于该仓库的问题：
   "这个仓库中使用的核心技术栈是什么？"

### 调试
运行：
```bash
npx @modelcontextprotocol/inspector uvx github-chat-mcp
```


## 本地/开发设置说明

### 克隆仓库
`git clone https://github.com/yourusername/github-chat-mcp.git`

### 安装依赖项
首先安装 uv。

MacOS/Linux:
```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
```


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


然后安装 MCP 服务器依赖项：
```bash
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
```bash
# `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"
```


#### 手动设置
```json
# 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": {
      }
    }
  }
}
```


### 使用 Claude 进行 GitHub Chat
1. 首先索引一个 GitHub 仓库：
   "索引位于 https://github.com/username/repo 的 GitHub 仓库"

2. 然后询问关于该仓库的问题：
   "这个仓库中使用的核心技术栈是什么？"

### 调试
运行：
```bash
# 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
```
然后访问 `http://localhost:5173` 上的 MCP 检查器。您可能需要在检查器中的环境变量下添加您的 GitHub API 密钥，键名为 `GITHUB_API_KEY`。

# 注意事项
- 日志级别可以通过 `FASTMCP_LOG_LEVEL` 环境变量进行调整（例如 `FASTMCP_LOG_LEVEL="ERROR"`）
- 该 MCP 服务器提供了两个主要工具：
  1. 仓库索引 - 索引并分析一个 GitHub 仓库
  2. 仓库查询 - 对已索引的仓库提问

