git-mcp
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., "@git-mcppush current changes and sync to GitHub"
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.
Git MCP — 代码管理服务
Skill(工作流规范)+ MCP(增量存储 + GitHub 同步)双层架构
这是什么
所有 OpenClaw agent 和测试服务器的代码统一管理入口:
Skill — 教 agent 什么时候该 push、pull、sync,怎么写 commit message
git-mcp — 增量存储所有代码变更,需要时再推 GitHub,绝不覆盖
Related MCP server: Git MCP
核心设计
agent push 代码 → git-mcp 本地增量存储(永不覆盖) ──→ git_sync → GitHub
测试服务器代码 → repo_sync(rsync) → git-mcp 本地 → 算 SHA → code-review三个关键点:
增量不覆盖 — 每次 push 是一个独立的 commit,MCP 本地有完整历史
GitHub 推送是单独操作 —
git_sync你决定什么时候推,不会意外覆盖SHA 溯源 — 代码审查报告标 snapshot_sha,机械审计、人工审核、安全检查看同一版代码
文件结构
skills/git-operations/
└── SKILL.md # Skill 主文档
mcp/git-mcp/
├── src/
│ ├── server.ts # Express HTTP 服务器
│ ├── config.ts # 配置管理
│ ├── db.ts # SQLite 数据库(仓库/版本/审计/同步状态)
│ └── tools/
│ └── gitOps.ts # 全部 18 个工具实现(单文件)
├── package.json
├── tsconfig.json
└── git-mcp.service # systemd 配置工具清单(18 个)
仓库管理
工具 | 说明 |
| 注册代码库(名称、GitHub URL、描述) |
| 搜索/列出所有仓库 |
| 仓库详情 + 最新版本 + 未同步 commits 数 |
| 在 GitHub 上创建新仓库 + 自动注册 |
日常开发
场景 | 流程 |
改代码并推送 |
|
查看状态 |
|
切换分支 |
|
提交历史 |
|
版本发布
工具 | 说明 |
| 创建版本标签(如 v1.2.0) |
| 列出所有版本标签 |
| 推送本地 commits 到 GitHub(可选同步打 tag) |
审计追踪
工具 | 说明 |
| 谁什么时候 push/pull/clone/checkout 了什么 |
| 哪些仓库有未推送到 GitHub 的 commits |
测试服务器代码同步
工具 | 说明 |
| rsync 从测试服务器拉代码到 MCP(排除 node_modules/.git/venv),返回 SHA |
| 获取当前代码 SHA,不重新同步(供 code-review 溯源用) |
代码质量门禁
工具 | 说明 |
| build + lint + guardFiles + 合约 program_id 验证,push 前强制执行 |
部署
cd mcp/git-mcp
pnpm install && pnpm build
# 数据库自动创建在 ~/.git-mcp/data.db
# 仓库代码存储在 ~/repos/ (或配置的 repoBasePath)
# GitHub token(推送需要)
export GIT_TOKEN=ghp_xxxxxxxxxxxx
mkdir -p ~/.git-mcp
cat > ~/.git-mcp/config.json << 'EOF'
{
"port": 3082, "host": "127.0.0.1",
"repoBasePath": "/home/ubuntu/repos",
"dbPath": "/home/ubuntu/.git-mcp/data.db",
"githubOrg": "sftgroup"
}
EOF
sudo cp git-mcp.service /etc/systemd/system/
sudo systemctl enable --now git-mcp
curl http://127.0.0.1:3080/health前置要求: Node.js 22+、pnpm、Git、SSH 密钥(repo_sync 需要免密登录测试服务器)
Skill 安装
openclaw skills install git:sftgroup/agent@master#skills/git-operations --as git-operations数据库
SQLite 单文件,3 张表:
表 | 字段 |
| name, github_url, local_path, default_branch, guard_config |
| repo_id, tag, commit_sha, created_at |
| repo_id, action, branch, commit_sha, message, status |
| repo_id, commit_sha, status(pending/synced), synced_at |
与 code-review-mcp 协作
1. repo_sync("team3", "43.156.50.6", "/path") → sha: abc123
2. code-review-mcp review_all("/opt/mcp/repos/team3", "all")
3. 报告标注 snapshot_sha: abc123This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- 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/sftgroup/git-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server