GitHub MCP 工具
通过 Claude Desktop 与 GitHub API 交互的多 Claude 程序 (MCP)。
特征
搜索 GitHub 存储库和问题
创建、更新和管理 GitHub 问题和拉取请求
管理存储库设置和配置
处理存储库工作流和操作
搜索用户和组织
管理存储库协作者和团队
安装
克隆此存储库:
git clone https://github.com/yourusername/github-mcp.git cd github-mcp创建并激活虚拟环境:
# On macOS/Linux python -m venv venv source venv/bin/activate # On Windows python -m venv venv .\venv\Scripts\activate安装依赖项:
pip install -r requirements.txt在项目根目录中创建一个
.env
文件:touch .env将您的 GitHub 凭据添加到
.env
文件:GITHUB_TOKEN=your_personal_access_token_here GITHUB_USERNAME=your_github_username测试安装:
# Run all tests python -m pytest # Run a specific test file python -m pytest tests/test_search_repos.py启动 MCP 服务器:
python run.py
环境设置
GitHub 个人访问令牌
您需要一个细粒度的个人访问令牌来向 GitHub 进行身份验证:
登录你的 GitHub 帐户
转到“设置”>“开发者设置”>“个人访问令牌”>“细粒度令牌”
点击“生成新令牌”
配置令牌:
代币名称:“Claude Desktop Integration”
描述:“Claude Desktop GitHub 集成令牌”
到期日期:选择合适的到期日期
存储库访问:选择“所有存储库”或特定存储库
权限:
存储库权限:
行动:阅读和写作
内容:阅读和写作
问题:阅读和写作
拉取请求:读取和写入
存储库钩子:读取和写入
存储库设置:读取和写入
组织权限(如果使用组织存储库):
成员:只读
团队:只读
点击“生成token”,并安全保存生成的token
工具
搜索存储库
使用各种标准搜索 GitHub 存储库。
参数:
查询:搜索查询字符串
排序:排序字段(星级、分叉、更新等)
order:排序顺序(升序或降序)
max_results:返回的最大结果数(默认值:10)
创建问题
在指定的存储库中创建一个新的 GitHub 问题。
参数:
所有者:存储库所有者
repo:存储库名称
title:问题标题
正文:问题描述
标签:要应用的标签列表
受让人:受让人用户名列表
创建拉取请求
创建一个新的拉取请求。
参数:
所有者:存储库所有者
repo:存储库名称
标题:PR 标题
正文:PR 描述
head:源分支
基础:目标分支
draft:是否创建为 PR 草稿
管理存储库设置
更新存储库设置和配置。
参数:
所有者:存储库所有者
repo:存储库名称
设置:要更新的设置词典
搜索问题
跨存储库搜索问题。
参数:
查询:搜索查询字符串
状态:问题状态(打开、关闭、全部)
排序:排序字段
顺序:排序顺序
max_results:最大结果数
管理工作流程
管理 GitHub Actions 工作流程。
参数:
所有者:存储库所有者
repo:存储库名称
workflow_file:工作流文件路径
动作:要执行的动作(启用、禁用、触发)
管理合作者
管理存储库合作者。
参数:
所有者:存储库所有者
repo:存储库名称
用户名:合作者用户名
权限:权限级别(拉取、推送、管理、维护、分类)
示例用法
发展
运行测试
添加新工具
在
src/tools/
中创建一个新文件实现你的工具功能
在
src/main.py
中注册该工具在
tests/
中添加测试更新 README.md 中的文档
贡献
分叉存储库
创建功能分支
进行更改
运行测试
提交拉取请求
执照
MIT 许可证
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
一个多 Claude 程序,用于通过 Claude Desktop 与 GitHub API 交互,允许用户搜索存储库、管理问题、拉取请求、存储库设置、工作流和协作者。
Related MCP Servers
- AsecurityFlicenseAqualityAn MCP server that enables Claude and other compatible LLMs to interact with the GitHub API, supporting features like creating issues, retrieving repository information, listing issues, and searching repositories.Last updated -4
- -securityFlicense-qualityA modular command processor server that enables interaction with GitHub's REST API to fetch user details, repository information, and authenticated user data through natural language commands in Claude.Last updated -
- AsecurityFlicenseAqualityAn MCP server that allows Claude and other MCP-compatible LLMs to interact with the GitHub API, supporting features like creating issues, getting repository information, listing issues, and searching repositories.Last updated -4
- -securityAlicense-qualityConnects Claude Desktop to GitHub repositories, enabling users to perform git operations and GitHub API interactions through natural conversation.Last updated -3,264MIT License