ChatGPT GitHub MCP App
Provides tools for interacting with GitHub repositories, allowing AI agents to read files, list repository contents, view pull requests, create multi-file atomic changes as branches and PRs, comment on PRs, and optionally merge PRs or delete branches, with security restrictions like white-listed repos and protected paths.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ChatGPT GitHub MCP AppRead repo my-org/my-app, analyze structure, and create a PR with a small fix."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ChatGPT GitHub MCP App
这是一个自建 GitHub 写入桥接服务:你在 ChatGPT 网页端添加这个远程 MCP App 后,就可以直接和 ChatGPT 对话,让它读取 GitHub 仓库、修改代码、创建提交和 Pull Request。
默认安全策略:只允许白名单仓库;写入时创建
chatgpt/*分支和 PR;默认禁止直推默认分支、禁止自动合并、禁止修改.github/workflows、禁止读写.env/私钥类文件。
它能做什么
ChatGPT 连接后会看到这些工具:
工具 | 作用 | 默认权限 |
| 列出允许访问的仓库 | 读 |
| 查看仓库信息 | 读 |
| 查看仓库文件树 | 读 |
| 读取文本文件 | 读 |
| 查看 PR 列表 | 读 |
| 查看 PR 和变更文件 | 读 |
| 多文件原子提交并创建 PR | 写 |
| 给 PR 评论 | 写 |
| 合并 PR,仅 | 高危 |
| 删除 | 高危 |
Related MCP server: Git PR MCP Server
运行要求
Node.js 22+
一个 GitHub App
一个公网 HTTPS 域名,ChatGPT 需要能访问你的
/mcp地址
1. 创建 GitHub App
在 GitHub 进入 Settings → Developer settings → GitHub Apps → New GitHub App。
推荐权限:
Repository permissions
Contents: Read and write
Pull requests: Read and write
Metadata: Read-only,默认自带
Webhook 可以先关闭或留空。本项目主动调用 GitHub API,不依赖 webhook。
创建后:
记录 App ID。
点击 Generate a private key 下载
.pem。安装 GitHub App 到你要让 ChatGPT 操作的仓库。
2. 配置项目
cp .env.example .env
npm install
npm run generate:secretsgenerate:secrets 会输出:
OAUTH_SIGNING_SECRETOAUTH_ADMIN_PASSWORD_HASH
把输出值填入 .env。
推荐把 GitHub App 私钥放到:
mkdir -p secrets
cp your-github-app-private-key.pem secrets/github-app-private-key.pem
chmod 600 secrets/github-app-private-key.pem然后在 .env 中配置:
GITHUB_APP_ID=你的AppID
GITHUB_PRIVATE_KEY_PATH=/run/secrets/github-app-private-key.pem
GITHUB_ALLOWED_REPOSITORIES=你的用户名/你的仓库
PUBLIC_BASE_URL=https://你的域名3. 本地开发运行
npm run dev健康检查:
curl http://localhost:3000/healthz本地只能用于开发。生产环境必须用 HTTPS,否则 ChatGPT 无法稳定连接 OAuth/MCP。
4. Docker 部署
cp .env.example .env
# 编辑 .env
mkdir -p data secrets
cp your-github-app-private-key.pem secrets/github-app-private-key.pem
docker compose up -d --build检查:
curl https://你的域名/healthz首页会显示 MCP 地址:
https://你的域名/mcp5. Nginx 反代
示例文件在:
deploy/nginx.conf.example重点:必须保留原始 Host,并通过 HTTPS 转发:
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto https;6. 接入 ChatGPT 网页端
在 ChatGPT 网页端添加自定义 MCP App,填入:
https://你的域名/mcp首次连接时会跳转到本服务的授权页面。输入你部署时生成的管理员密码即可批准连接。
连接成功后,你可以直接对 ChatGPT 说:
读取 owner/repo 这个仓库,帮我分析项目结构。然后把 xxx 功能改好,创建一个 PR,不要直接合并。7. 推荐使用方式
比较稳的提示词:
请使用我的 GitHub MCP App 操作 owner/repo。
先列出项目结构并读取相关文件;
然后说明你准备修改哪些文件;
最后用一次 github_create_change 提交所有相关文件并创建 PR。
不要修改 .env、私钥、GitHub Actions 工作流,也不要合并 PR。8. 安全开关说明
环境变量 | 默认值 | 说明 |
| 空 | 允许访问的仓库白名单,生产强烈建议设置 |
|
| 是否允许全部已安装仓库 |
|
| ChatGPT 创建分支的前缀 |
|
| 是否允许直推默认分支,不推荐 |
|
| 是否注册 PR 合并工具 |
|
| 是否注册删除分支工具 |
|
| 是否允许改 |
|
| 禁止读写的路径匹配 |
|
| 单次最多改多少文件 |
|
| 单文件写入大小限制 |
|
| 单次总写入大小限制 |
9. 审计日志
默认写入:
data/audit.jsonl每条记录包含:工具名、仓库、分支、路径、结果、错误摘要等。不要把这个日志公开。
10. 开发与测试
npm run typecheck
npm run test
npm run build
npm run check当前测试覆盖:
安全策略:仓库白名单、敏感路径、工作流保护、分支保护
GitHub 核心:多文件提交失败回滚
MCP:工具注册、读写权限、危险工具开关
HTTP/OAuth:动态客户端注册、PKCE 授权、token 交换、refresh rotation
11. 打包
bash scripts/package-release.sh输出:
release/chatgpt-github-mcp-app.zip12. 重要提醒
这个服务需要公网 HTTPS 才适合接入 ChatGPT。
不要把 GitHub App 私钥、
.env、data/oauth-store.json、data/audit.jsonl上传到公开仓库。第一次使用建议只给测试仓库授权,确认流程没问题后再扩大仓库白名单。
默认不会自动合并 PR;你可以在 GitHub 网页端 review 后手动合并。
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
- AlicenseCqualityAmaintenanceA MCP server that bridges LLMs with GitHub repository management, enabling automated analysis of pull requests, issue management, tag creation, and release management through natural language.246Apache 2.0
- Flicense-qualityDmaintenanceAn MCP server that enables Git repository operations and GitHub PR workflows, allowing users to manage repositories, create branches, commit changes, and create pull requests through natural language.2
- Alicense-qualityDmaintenanceAn MCP server that enables AI agents to directly manage GitHub repositories, including PRs, issues, and code search, using natural language.MIT
- Flicense-qualityBmaintenanceMCP server that enables AI agents to perform GitHub operations like creating repositories, issues, and commits through natural language.
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
A MCP server built for developers enabling Git based project management with project and personal…
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
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/fellipegoncalvesleite/chatgpt-github-mcp-app'
If you have feedback or need assistance with the MCP directory API, please join our Discord server