
Git Mcp Server
io.github.cyanheads由 GitHub 账号 cyanheads 发布v2.15.3更新于 Oct 24, 2026
Comprehensive Git MCP server enabling native git tools including clone, commit, worktree, & more.
概览
本地运行的 Git MCP 服务器,为 AI 助手提供 28 个原生 git 工具,可克隆、提交、分支、合并、推送并查看仓库。
- 可以做什么
- 初始化、克隆、查看状态和清理仓库,并为多仓库工作设置或清除会话工作目录。暂存更改、创建提交并比较差异。读取历史并检查对象:log、show、blame、reflog,以及变更日志分析辅助。管理分支、切换、合并、变基和拣选提交。配置远程、拉取、同步并推送。打标签、暂存、重置和管理工作树,并提供用于审查和提交会话的收尾提示。
- 适用场景
- 适合让助手直接操作本地 Git 仓库:审查更改、编写提交、管理分支或与远程同步,而无需你逐条手动执行命令。
- 运行要求
- 通过 npx(Node.js 20 或更高版本)或 bunx(Bun 1.2 或更高版本)在本地运行。可选环境变量用于配置 git 身份、基础目录、提交签名、日志记录,以及带可选 jwt 或 oauth 认证的 HTTP 传输。
安装
在 SourceWeft 中
- 打开 控制台中的 Git Mcp Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
@cyanheads/git-mcp-server
A Git MCP server for AI agents. STDIO & Streamable HTTP.
Tools
28 git operations organized into seven categories:
Resources
Prompts
Getting started
Runtime
Works with both Bun and Node.js. Runtime is auto-detected.
MCP client configuration
Add the following to your MCP client config (e.g., cline_mcp_settings.json). Update the environment variables to match your setup — especially the git identity fields.
Bun users: replace "command": "npx" with "command": "bunx".
For Streamable HTTP, set MCP_TRANSPORT_TYPE=http and MCP_HTTP_PORT=3015.
Features
Built on mcp-ts-template.
Security
- All file paths are validated and sanitized to prevent directory traversal.
- Optional
GIT_BASE_DIRrestricts operations to a specific directory tree for multi-tenant sandboxing. - Git commands use validated arguments via process spawning — no shell interpolation.
- JWT and OAuth support for authenticated deployments.
- Optional rate limiting via the DI-managed
RateLimiterservice. - All operations are logged with request context for auditing.
Configuration
All configuration is validated at startup in src/config/index.ts. Key environment variables:
Running the server
Via package manager (no install)
Configure through environment variables or your MCP client config.
Local development
Cloudflare Workers
Project structure
Response format
Configure output format and verbosity via MCP_RESPONSE_FORMAT and MCP_RESPONSE_VERBOSITY.
JSON format (default, optimized for LLM consumption):
Markdown format (human-readable):
The LLM always receives the complete structured data via responseFormatter — full file lists, metadata, timestamps — regardless of what the client displays. Verbosity controls how much detail is included: minimal (core fields only), standard (balanced), or full (everything).
Development guide
See AGENTS.md for architecture, tool development patterns, and contribution rules.
Testing
Tests use Bun's test runner with Vitest compatibility.
Roadmap
The server uses a provider-based architecture for git operations:
- CLI provider (current) — Full 28-tool coverage via native git CLI. Requires local git installation.
- Isomorphic git provider (planned) — Pure JS implementation for edge deployment (Cloudflare Workers, Vercel Edge, Deno Deploy). Uses isomorphic-git.
- GitHub API provider (maybe) — Cloud-native operations via GitHub REST/GraphQL APIs, no local repo required.
Contributing
Issues and pull requests are welcome. Run checks before submitting:
License
Apache 2.0. See LICENSE.
Built with the mcp-ts-template
来源:README.md,提交 d34d83a
工具
0版本历史
1- v2.15.3最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分