GitHub MCP Server (Custom)
GitHub MCP Server(自定义)
一个自定义的 Model Context Protocol (MCP) 服务器,为 AI 代理提供对 GitHub 的完整 CRUD 访问:仓库、问题、拉取请求、分支、评论、审查和合并。使用官方 Python mcp SDK(FastMCP)和通过 httpx 的 GitHub REST API 构建。
共 23 个工具 — 完整列表见 server.py。亮点:
领域 | 工具 |
仓库 |
|
问题 |
|
分支 |
|
拉取请求 |
|
审查 |
|
提交 |
|
设置
安装依赖
pip install -r requirements.txt创建 GitHub 令牌
前往 https://github.com/settings/tokens 并创建以下任一类型:
一个具有
repo范围的经典 PAT,或一个细粒度 PAT,将
Contents、Issues、Pull requests和Metadata设置为读取和写入,范围限定为你希望代理访问的仓库。
将令牌设置为环境变量
export GITHUB_TOKEN=ghp_your_token_here独立运行(可选健全性检查)
python server.py它将等待 MCP 客户端通过 stdio 连接——这是预期的,它不是 Web 服务器。
Related MCP server: GitHub MCP Server
将其连接到 Claude Desktop
将此添加到你的 claude_desktop_config.json(Windows 上为 %APPDATA%\Claude\claude_desktop_config.json,macOS 上为 ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"github": {
"command": "python",
"args": ["/absolute/path/to/server.py"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}重启 Claude Desktop,GitHub 工具将出现在工具选择器中。
将其连接到你自己的代理管道(例如 Jira → GitHub → Teams 项目)
由于这是一个标准的 MCP stdio 服务器,任何兼容 MCP 的客户端或 SDK 都可以将其作为子进程启动,并通过 stdin/stdout 与之通信——包括使用 MCP C# SDK 的 .NET 主机,或者如果你的编排器是多语言的,可以使用 Python/TypeScript SDK。将客户端指向:
command: python
args: ["/absolute/path/to/server.py"]
env: { "GITHUB_TOKEN": "<token>" }扩展它
要添加新工具,只需向 server.py 添加一个新的 @mcp.tool() 装饰函数,该函数调用 _request(method, path, ...) 来访问 GitHub REST API。文档字符串将成为显示给模型的工具描述,类型提示将成为输入模式——因此请确保两者准确。
注意事项
所有写操作(
create_*、update_*、delete_*、merge_*)都会在 GitHub 上产生真实更改——没有干运行模式。建议先在临时仓库上进行测试,尤其是merge_pull_request和delete_branch。速率限制遵循 GitHub 的标准 REST API 限制(截至撰写本文时,经过身份验证的请求为每小时 5,000 次)——服务器不进行自己的节流。
来自 GitHub 的错误(身份验证失败、404、合并冲突等)会以
RuntimeError的形式抛出,并包含 API 的响应正文,以便调用代理获得可读的消息来做出反应。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides secure, controlled access to GitHub operations through the Model Context Protocol with enterprise-grade security features including secret detection, vulnerability scanning, rate limiting, and full audit trails. Supports repository management, file operations, branch creation, commits, and GitHub Actions workflows.
- FlicenseNot gradedqualityNot gradedmaintenanceEnables LLMs to interact with GitHub repositories, issues, pull requests, and workflows through the Model Context Protocol. It provides a comprehensive set of tools for repository management, issue tracking, code search, and CI/CD automation.
- AlicenseCqualityDmaintenanceEnables AI assistants to directly operate GitHub repositories, such as listing issues, through the Model Context Protocol.21112Apache 2.0

Tiger GitHub MCP Serverofficial
AlicenseNot gradedqualityCmaintenanceEnables LLMs to interact with GitHub via the Model Context Protocol, providing tools for repository management and other GitHub operations.31Apache 2.0
Related MCP Connectors
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Git-backed platform for skills, tools, and context for AI agents
A Model Context Protocol (MCP) application for automated GitHub PR analysis and issue management.…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/rishav0004/custom-github-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server