Git MCP Server
Official reference server for reading and working with local Git repositories (status, diff, log, branches and commits). Version 2026.11.27 (Nov 27, 2026, reference servers v2.6.0) fixes six more security flaws, so update to 2026.11.27 or later: with Git LFS installed, a repository's own .git/config can no longer name programs for LFS to run, even from read-only tools such as git_status, and LFS downloads are turned off (GHSA-6663-fm5v-gqm5, high); the --repository root can no longer be pointed at another repository through its .git file, so a root whose .git file names a Git directory elsewhere is now refused (GHSA-3whj-m8jj-x97q); git_remote no longer leaks a credential through a crafted remote name or URL (GHSA-wvv2-676g-r57j); repo_path is taken literally, so $NAME is no longer expanded into environment-variable values (GHSA-f33v-89w7-f9vc); under --repository objects are read only from the repository's own store (GHSA-5pwg-5xfw-x322); and git_merge refuses a merge commit that would overwrite ignored local files such as .env (GHSA-qf89-h82f-h5r5). Version 2026.11.18 (Nov 18, 2026, reference servers v2.5.0) fixed six earlier security flaws: a merge no longer starts Git's automatic maintenance (GHSA-h2g3-rwxm-xfm3), Git no longer fetches missing objects by itself through a repository's promisor settings (GHSA-87qg-cmw8-jc5m), filter and merge drivers are re-checked after a checkout or merge writes files (GHSA-9vjp-x34c-xg6v) and when their name is empty (GHSA-pm7p-vphh-2cg7), a crafted .git/index can no longer expose files outside --repository (GHSA-r2q8-f657-4r56), and a submodule's own config no longer runs programs (GHSA-8wv7-r664-7594). It now needs Git 2.33 or newer for a repository with a checked-out submodule (2.31 otherwise). git_remote now hides query values in remote URLs. Since v2.5.0 every reference server can also serve Streamable HTTP on this computer with --transport streamable-http (127.0.0.1:3001 by default); stdio stays the default. Version 2026.11.11 (Nov 11, 2026, reference servers v2.4.0) is a security update: a repository's own .git/config (core.fsmonitor, diff.external, hooks, filter and merge drivers, signing) can no longer make the server run a program when you call even a read-only tool such as git_status on an untrusted repository (GHSA-6hqx-gqrx-c5r2), and --repository confinement now also covers alternate object stores, linked worktrees and symlinks in the Git directory (GHSA-q74p-4wrc-q7w6; Windows directory junctions are not yet covered). It now refuses to run with Git older than 2.31, so check git --version if the server stops working after updating. Version 2026.11.4 added git_merge, a read-only git_remote tool and revision ranges in git_diff. Without --repository, every repository the server can reach is in scope. uvx keeps a cached copy, so run uvx --refresh mcp-server-git once to update.
Install
uvx mcp-server-git --repository path/to/git/repoExample config (Cursor / Claude Desktop)
{
"mcpServers": {
"git": {
"command": "uvx",
"args": [
"mcp-server-git",
"--repository",
"path/to/git/repo"
]
}
}
}The same mcpServers block works in Cursor, Claude Desktop and Devin Desktop. VS Code (Copilot) uses a "type" field, Claude Code is easiest with claude mcp add, and Codex uses TOML: see the setup guide for your app. On Windows, wrap npx with cmd /c (fix).
At a glance
| Repository | modelcontextprotocol/servers/tree/main/src/git |
| GitHub stars | 92,372 (shared monorepo) |
| Last commit | 2026-11-27 (3 days ago) |
| Status | maintained |
| Security advisories | Latest advisory published 2026-11-27: GHSA-f33v-89w7-f9vc (medium), fixed in 2026.11.27. 19 published advisories found as of 2026-11-30. Details |
| Clients mentioned in README | Claude Desktop, VS Code, Zed |
| Auth | None detected in README |
| Language / License | TypeScript / NOASSERTION |
Security advisories
Latest: GHSA-f33v-89w7-f9vc, published 2026-11-27 medium
mcp-server-git: `repo_path` expands environment variables and the error message discloses their values
Fixed in: 2026.11.27 or later. Update before using it.
19 published advisories found (newest 5 shown)
- 2026-11-27: GHSA-f33v-89w7-f9vc (medium): mcp-server-git: `repo_path` expands environment variables and the error message discloses their values
- 2026-11-27: GHSA-wvv2-676g-r57j (medium): mcp-server-git: git_remote credential redaction bypass via TAB in remote name or prefixed URL exposes host git credentials
- 2026-11-27: GHSA-6663-fm5v-gqm5 (high): mcp-server-git runs programs named by a repository's own .git/config through the Git LFS filter
- 2026-11-27: GHSA-3whj-m8jj-x97q (medium): Configured Git repository root can be retargeted through a .git pointer
- 2026-11-27: GHSA-5pwg-5xfw-x322 (medium): mcp-server-git: git_show can read outside --repository after a concurrent alternates rewrite
Checked 2026-11-30 in the repo's GitHub security advisories and OSV.dev for mcp-server-git (PyPI). This server lives in a shared repository, so only advisories that mention it are counted. No advisory doesn't prove a server is safe. How to stay updated.