
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 分