mcp-github-push
mcp-github-push
轻量级 MCP 服务器,让 Claude(或其他 MCP 客户端)能够直接将项目推送到 GitHub,无需在电脑上执行 git clone/git pull。作为 GitHub 连接器的替代方案,更节省 token,且不会占用本地存储。
采用终端 CLI 形式——通过 npm 安装,一次性设置 token,然后注册到你的 MCP 客户端即可。
为什么这与内置的 GitHub 连接器不同?
不会将仓库克隆到磁盘。 所有操作直接通过 GitHub REST/Git Data API 完成,因此不占用本地存储。
一次提交包含多个文件。 使用 Git Data API(blob → tree → commit → ref),将多个文件的更改合并为一次整洁的提交,而不是每个文件都产生一次提交。
推送前必须确认。 必须先调用
github_preview_push工具来显示更改摘要;只有在用户明确同意后,才能调用github_push_confirmed。Token 本地存储,安全。 配置文件权限为
600,仅所有者用户可读。
Related MCP server: github-pr-mcp
安装
选项 A — 无需 Node.js(可直接使用的可执行文件)
完全不需要安装 Node.js。从 Releases 页面 下载适合你操作系统的二进制文件:
Windows:
mcp-github-push-win-x64.exeLinux:
mcp-github-push-linux-x64macOS:
mcp-github-push-macos-x64
从终端运行:
# Windows (PowerShell/CMD)
mcp-github-push-win-x64.exe setup
# Linux/macOS
chmod +x mcp-github-push-linux-x64
./mcp-github-push-linux-x64 setup然后在 MCP 客户端配置中注册 exe 文件的完整路径:
{
"mcpServers": {
"github-push": {
"command": "C:\\path\\ke\\mcp-github-push-win-x64.exe",
"args": ["start"]
}
}
}选项 B — 通过 npm(需要 Node.js 18+)
npx @kintil555/mcp-github-push setup按照说明操作:
创建 Personal Access Token(推荐使用 fine-grained)并授予目标仓库 Contents: Read and write 权限。
在提示时粘贴 token(终端输入会被隐藏)。
Token 会自动验证并保存到
~/.config/mcp-github-push/config.json。
注册到 MCP 客户端
将其添加到你的 MCP 客户端配置中(例如 Claude Desktop 的 claude_desktop_config.json):
{
"mcpServers": {
"github-push": {
"command": "npx",
"args": ["-y", "@kintil555/mcp-github-push", "start"]
}
}
}重启客户端。可供 Claude 使用的工具:
工具 | 功能 |
| 检查 token 是否有效并查看权限范围 |
| 检查仓库是否存在 |
| 创建新仓库 |
| 从仓库读取文件内容 |
| 预览推送前的更改(不进行任何修改) |
| 实际推送——仅在用户同意后执行 |
其他 CLI 命令
npx @kintil555/mcp-github-push status # cek token masih valid
npx @kintil555/mcp-github-push logout # hapus token tersimpan从源码构建
git clone https://github.com/kintil555/mcp-github-push.git
cd mcp-github-push
npm install
npm run buildGitHub Actions 中的 CI 会在每次推送到 main 或 PR 时自动构建并执行类型检查,并在创建新版本标签时发布到 npm。
安全性
Token 保存在
~/.config/mcp-github-push/config.json,权限为600。使用限定到特定仓库的 fine-grained PAT,而不是具有完全访问权限的 classic token。
设置 token 有效期并定期轮换。
github_push_confirmed的设计确保 AI 模型无法在未提供confirmed: true参数的情况下推送——请确保你的 MCP 客户端也在执行前向用户展示工具调用以供审查。
许可证
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
GitHub Copilot MCP: code, repo, PR, workflow tools for AI assistants.
Build, deploy and manage MaShop e-commerce projects from Claude, Cursor or any MCP client.
Host files from coding agents; stage on a branch and attach to GitHub PRs.
Create, deploy, and operate MCP servers directly from your GitHub repositories.
Related MCP Servers
- 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.-
- FlicenseNot gradedqualityBmaintenanceEnables GitHub repository operations (list/read files, create branches, commit files, open/list PRs) via an authless remote MCP server that keeps your GitHub token encrypted on Cloudflare, with access limited to allowed repositories.-
- AlicenseNot gradedqualityDmaintenanceConnects Claude directly to GitHub repositories for reading code, making changes, committing, and managing branches and pull requests.230 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables a connected Claude account to create, update, and commit files to GitHub repositories directly through MCP tools, removing the need for manual git push operations.230 npmMIT