GitHub Dev Copilot
GitHub Dev Copilot - MCP Server
一个生产就绪的 Model Context Protocol (MCP) 服务器,充当 AI 代理的 GitHub Copilot。它提供与 GitHub API 交互的工具,使代理能够管理仓库、问题、PR,并分析仓库健康状况。
架构
+----------------+ +-----------------------+ +-------------+
| AI Agent | ---> | GitHub MCP Server | <--> | GitHub API |
| (Client) | STDI | (Python / FastMCP) | HTTP | |
+----------------+ +-----------------------+ +-------------+
|
+-----------------------+
| Tools |
| - list_repositories |
| - read_issues |
| - create_issue |
| - comment_on_pr |
| - analyze_repo_health |
+-----------------------+Related MCP server: github-mcp-server
功能
身份验证:使用 GitHub 个人访问令牌(PAT)安全连接。
工具集:暴露健壮、严格类型的 MCP 工具。
安全性:
使用 Pydantic 验证输入。
对 API 调用进行速率限制以防止阻塞。
绝不暴露令牌。
分析:智能的
analyze_repo_health工具,用于为仓库评分。
安装
克隆仓库(如果适用)或导航到项目目录。
安装依赖:
pip install -r requirements.txt配置环境: 将
.env.example复制为.env,并添加你的 GitHub PAT。cp .env.example .env # Edit .env and set GITHUB_TOKEN运行服务器: 你可以直接用 Python 运行,或通过 MCP 客户端检查器运行。
python main.py
与 Claude Desktop 或 MCP 客户端一起使用
将服务器配置添加到你的 claude_desktop_config.json:
{
"mcpServers": {
"github-copilot": {
"command": "python",
"args": ["/path/to/mcp_github_dev_copilot/main.py"]
}
}
}可用工具
1. list_repositories
列出经身份验证的用户可访问的仓库。
返回:名称、所有者、私有/公开状态、星标、语言。
2. read_issues
从仓库获取问题。
输入:
repo_owner、repo_name、state("open", "closed", "all")输出:包含 ID、标题、标签的问题列表。
3. create_issue
创建新问题。
输入:
repo_owner、repo_name、title、body(markdown)、labels输出:问题 URL 和编号。
4. comment_on_pr
向 Pull Request 添加评论。
输入:
repo_owner、repo_name、pr_number、comment_text输出:评论 URL。
5. analyze_repo_health
对仓库执行健康检查。
检查项:未解决问题数、陈旧问题(>30 天)、近期提交活动、测试是否存在、CI 配置。
输出:健康评分(0-100)和改进建议。
安全性与限制
速率限制:服务器实现了一个装饰器,通过等待或重试来处理 GitHub 速率限制。
权限范围:确保你的 PAT 具有
repo、read:org和workflow权限范围。无浏览器:此服务器使用官方 GitHub API,而非网页抓取。
日志:活动记录到
stderr,以避免干扰 MCP stdio 通信。
未来改进
添加
update_issue和merge_pr工具。实现文件内容的读取/搜索。
添加 GitHub App 身份验证支持。
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Access the GitHub API, enabling file operations, repository management, search functionality, and…
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with GitHub repositories, issues, pull requests, code, and more through a comprehensive set of tools.-
- FlicenseNot gradedqualityBmaintenanceEnables AI assistants to interact with GitHub issues, pull requests, and Actions workflows through MCP tools.-
- AlicenseNot gradedqualityBmaintenanceEnables MCP-compatible AI clients to manage GitHub repositories and issues and trigger repository dispatch events via tools and a REST API.MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to interact with GitHub repositories and issues through MCP tools, supporting listing repositories, listing and searching issues, and retrieving specific issues via the GitHub REST API.-