Git
90,704 starsOfficial MCP reference server: lets the agent read and operate local Git repositories — status and diffs, commit history, branch creation and checkout — and includes repository-mutating tools such as git_add, git_commit and git_reset.
- First published:2024-11-19
- data as of:
- 2026-09-30
- Licence:
- MIT / Apache-2.0(repo 正在授權轉移,見 repo LICENSE)
- Transport:
- stdio
- Primitives exposed:
- tools
What it can touch
Full local control of the repo_path you point it at: reads any file content (via diff/log/show), stages, commits, resets (git_reset discards changes) and switches branches. The tool surface is local-only — no push to remotes.
Risk
git_reset and git_checkout discard uncommitted work; an injected agent can quietly rewrite code and commit it, smuggling malicious changes into normal history. Secrets living in the repo (committed keys, internal code) also flow into the model context whenever it reads.
Install prompt
從官方參考 server 倉庫的 Git 目錄取得說明,把 README 的客戶端設定片段(以 uvx 啟動 mcp-server-git,並用 --repository 參數指定倉庫路徑)加進你的 MCP 客戶端設定檔,然後重啟客戶端。Paste this to your agent. It deliberately contains no tool subcommands — check the tool's official docs for commands.