GitHub Chat MCP(Model Context Protocol)是用于通过 GitHub Chat API 分析和查询GitHub仓库的协议。借助该协议,用户能够方便地对 GitHub 仓库进行索引和查询操作。官方网址:https://github-chat.com
要开始使用 GitHub Chat MCP,你可以按照以下步骤操作:
你可以选择以下方式进行安装:
# 使用 pip 安装
pip install github-chat-mcp
# 或使用较新的 uv 包管理器安装
uv install github-chat-mcp
⚠️ 重要提示
首先,请确保您拥有GitHub Chat API密钥。这是使用服务的必需条件。
首先安装uv:
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"
]
}
}
}
这样设置后,无需环境变量,因为这是免费试用版本。
# claude_desktop_config.json
# 可以通过以下步骤找到位置:
# 点击汉堡菜单 -> 文件 -> 设置 -> 开发人员 -> 编辑配置
# 必须先执行:brew install uv
{
"mcpServers": {
"github-chat": {
"command": "uvx",
"args": ["github-chat-mcp"],
"env": {
}
}
}
}
您可以使用Smithery自动为Claude Desktop安装GitHub Chat:
npx -y @smithery/cli install github-chat-mcp --client claude
运行以下命令进行调试:
npx @modelcontextprotocol/inspector uvx github-chat-mcp
git clone https://github.com/yourusername/github-chat-mcp.git
首先安装uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
然后在GitHub Chat - MCP项目中安装依赖项:
cd github-chat-mcp
# 创建虚拟环境并激活它
uv venv
source .venv/bin/activate # MacOS/Linux
# 或者
.venv/Scripts/activate # Windows
# 安装依赖项
uv sync
# 如果尚未安装,请先执行 `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",
"github-chat-mcp"
]
}
}
}
/index 命令,例如:/index https://github.com/yourusername/repo/query 命令,例如:/query 这个仓库的核心技术栈是什么?⚠️ 重要提示
- 通过环境变量
FASTMCP_LOG_LEVEL可以调节日志级别(例如:FASTMCP_LOG_LEVEL="ERROR")- 此MCP服务器提供两个主要功能:
- 仓库索引 - 索引和分析一个GitHub仓库
- 仓库查询 - 查询已索引的仓库