关于 GitHub Chat MCP
GitHub Chat MCP 是一个 MCP 服务,用于借助 GitHub Chat API 分析和查询 GitHub 仓库。它面向需要在 AI 助手中直接了解代码库结构的用户,通过 pip 或 uv 安装。
主要功能
- 01索引 GitHub 仓库
- 02基于仓库内容进行提问
- 03支持 pip 与 uv 安装
- 04可通过 FASTMCP_LOG_LEVEL 调整日志级别
适用场景
- 01让 Claude 分析 React 或 TypeScript 等开源仓库的架构
- 02询问陌生仓库的核心技术栈
MCP 相关
该项目是一个 MCP 服务,向 MCP 客户端暴露仓库索引和仓库查询两个工具。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
GitHub Chat MCP
使用 GitHub Chat API 分析和查询 GitHub 代码仓库的模型上下文协议(MCP)。官方网站: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
- 开始使用 Claude!
示例提示词:
- “使用 github-chat-mcp 分析 React 代码仓库”
- “使用 github-chat-mcp 为 TypeScript 代码仓库建立索引,并询问其架构”
GitHub Chat MCP 服务
设置说明
首先,请确保你拥有 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
# 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
在 Claude 中使用 GitHub Chat
-
首先为 GitHub 代码仓库建立索引: “为 https://github.com/username/repo 上的 GitHub 代码仓库建立索引”
-
然后询问有关该代码仓库的问题: “此代码仓库使用的核心技术栈是什么?”
调试
运行:
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
# 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": {
}
}
}
}
在 Claude 中使用 GitHub Chat
-
首先为 GitHub 代码仓库建立索引: “为 https://github.com/username/repo 上的 GitHub 代码仓库建立索引”
-
然后询问有关该代码仓库的问题: “此代码仓库使用的核心技术栈是什么?”
调试
运行:
# 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 Inspector。你可能需要在 Inspector 的环境变量中添加 GitHub API 密钥,变量名为 GITHUB_API_KEY。
备注
- 可以通过
FASTMCP_LOG_LEVEL环境变量调整日志级别(例如FASTMCP_LOG_LEVEL="ERROR") - 此 MCP 服务提供两种主要工具:
- 代码仓库索引 - 为 GitHub 代码仓库建立索引并进行分析
- 代码仓库查询 - 针对已建立索引的代码仓库提问
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。