github-mcp
github-mcp
一个极简的自托管 MCP 服务器,将 GitHub 写入权限以工具形式暴露出来,让已连接的 Claude 账号无需每次人工手动执行 git push 即可推送代码。
功能
工具 | 功能说明 |
| 获取默认分支、私有标志、最近推送时间 |
| 列出分支 |
| 列出指定路径下的文件/文件夹 |
| 获取文件解码后的内容 + blob sha |
| 在单个提交中原子化地创建/更新一个或多个文件(Git Data API:blobs → tree → commit → ref update)—— 用它一次性推送整个文件夹 |
Related MCP server: GitHub MCP Server
安全 — 部署前请阅读
GITHUB_TOKEN 必须作为环境变量,直接写入 Docker 仪表盘(或 Render)的环境变量 UI 中——绝不要粘贴到与 AI 助手的对话中,绝不要提交到本仓库,绝不要作为工具参数传递。服务器只会从 process.env 中读取它。如果某个 token 曾被粘贴到对话中,请把它视为已泄露并立即撤销——直接在仪表盘中生成一个新的并设置好。
建议的 token 范围:细粒度 PAT,Contents: Read & write,且限定在需要使用的具体仓库。避免使用 classic / 全仓库 token。
环境变量
GITHUB_TOKEN— 细粒度 PAT,Contents: Read & write,限定于目标仓库PORT— 默认 8080
本地运行
npm install
npm start
curl localhost:8080/api/health部署
将此仓库推送到 GitHub(第一次推送必须手动完成——这是自举问题,本服务器无法把自己推送到克 MS),然后:
Manufact:deploy (point at the repo)Manufact 会自动根据 Dockerfile 构建。部署后在 Manufact 的环境变量 UI 中设置 GITHUB_TOKEN,然后重新生成服务。
将 Claude 账号连接到本服务器
添加一个自定义连接器,指向 https://<your-manufact-domain>/mcp。
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…
Create, deploy, and operate MCP servers directly from your GitHub repositories.
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceConnects Claude Desktop to GitHub repositories, enabling users to perform git operations and GitHub API interactions through natural conversation.480 npm-
- AlicenseNot gradedqualityNot gradedmaintenanceConnects Claude Desktop directly to GitHub repositories and git commands, enabling users to clone repos, check status, commit changes, push code, create repositories, and manage GitHub resources through natural conversation.480 npm-
- FlicenseNot gradedqualityDmaintenanceEnables to interact with GitHub repositories directly from Claude, supporting actions like viewing repos, checking status, committing and pushing changes, and managing pull requests.-
- AlicenseNot gradedqualityDmaintenanceConnects Claude directly to GitHub repositories for reading code, making changes, committing, and managing branches and pull requests.118 npmMIT