Git MCP
Read, diff, stage and commit in local Git repos
BestMCPTools
Git MCP
bestmcptools.org
Last verified: October 27, 2026
Maintenance status
ActiveReference server in the official modelcontextprotocol/servers repository, listed under Reference Servers (not archived) on October 27, 2026. Latest PyPI release 2026.10.19, uploaded October 19, 2026, now on MCP Python SDK 2.x.
How to Install Git MCP
$uvx mcp-server-git --repository path/to/git/repoCompatible with: Claude Desktop, VS Code, Zed, Zencoder, any MCP client.
Setup by client
Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"git-mcp": {
"command": "uvx",
"args": [
"mcp-server-git",
"--repository",
"path/to/git/repo"
]
}
}
}Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"git-mcp": {
"command": "uvx",
"args": [
"mcp-server-git",
"--repository",
"path/to/git/repo"
]
}
}
}VS Code (.vscode/mcp.json)
{
"servers": {
"git-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"mcp-server-git",
"--repository",
"path/to/git/repo"
]
}
}
}Claude Code (terminal)
claude mcp add git-mcp -- uvx mcp-server-git --repository path/to/git/repoAdd any API keys or environment variables the server's README lists.
About Git MCP
Git MCP here means mcp-server-git, the Git reference server in the official modelcontextprotocol/servers repository, maintained by the MCP steering group and published on PyPI by Anthropic. It gives an AI client 12 tools for one local Git working tree: check status, read diffs, browse the log, show files at any revision, list and create branches, check out, stage, unstage and commit. It is written in Python, so you run it with uvx or pip, not npx.
It is not GitMCP (gitmcp.io), a separate remote service that turns public GitHub projects into documentation sources, and it does not talk to GitHub or GitLab APIs. It works on whatever repository is checked out on disk, wherever it was cloned from.
Quick facts (as of October 27, 2026)
| Git MCP (mcp-server-git) | |
|---|---|
| Maintainer | MCP steering group; PyPI author Anthropic, PBC |
| Type | Local stdio server |
| Install | uvx mcp-server-git, pip install mcp-server-git, or Docker image mcp/git |
| Latest PyPI version | 2026.10.19 (uploaded October 19, 2026) |
| Python | 3.10 or later |
| MCP SDK | Python SDK 2.x (mcp>=2.3,<3) |
| Protocol | Serves both 2026-07-28 and 2025-11-25 clients over stdio, with nothing to configure |
| Tools | 12 (7 read-only, 5 that change the repository or checkout) |
| Auth | None. It uses the local filesystem and your Git setup |
| Scope control | --repository limits tool calls to one repository |
| License | MIT |
| Price | Free and open source |
| Status | Listed as a reference server (not archived) in the servers repository on October 27, 2026; the README calls it early development |
Tools
All 12 tools take a repo_path argument. The server marks each one with MCP tool hints.
| Tool | What it does | Changes the repo? |
|---|---|---|
git_status | Working tree status | No |
git_diff_unstaged | Diff of changes not yet staged | No |
git_diff_staged | Diff of staged changes | No |
git_diff | Diff against a branch or commit | No |
git_log | Commit history, with optional max_count (default 10) and start or end timestamps | No |
git_show | A commit, or a file or directory at a revision (for example HEAD:path/to/file) | No |
git_branch | List local, remote or all branches, optionally filtered by a commit they contain | No |
git_add | Stage files (["."] stages everything) | Yes |
git_reset | Unstage all staged changes (marked destructive) | Yes |
git_commit | Commit staged changes; also concludes an in-progress merge | Yes |
git_create_branch | Create a branch from the current or a named base | Yes |
git_checkout | Switch branches, or detach HEAD at a commit or tag | Yes |
There is no tool for push, pull, fetch, clone, merge, rebase, tag or blame. The agent can prepare and commit work locally, and a person (or another tool) handles anything that touches a remote.
Setup
With uv installed, nothing else needs installing. The README's Claude Desktop config:
{
"mcpServers": {
"git": {
"command": "uvx",
"args": ["mcp-server-git", "--repository", "path/to/git/repo"]
}
}
}
Other options from the README:
- pip:
pip install mcp-server-git, then use"command": "python"with"args": ["-m", "mcp_server_git", "--repository", "path/to/git/repo"]. - Docker:
docker run --rm -i --mount type=bind,src=/Users/username,dst=/Users/username mcp/git, mounting only the folders you want the server to reach. Docker Hub shows themcp/gitimage was last updated June 16, 2025, so it can lag behind the PyPI release. - VS Code: one-click install buttons in the README, or add
"git": {"command": "uvx", "args": ["mcp-server-git"]}underserversin your usermcp.jsonor.vscode/mcp.json. - Zed and Zencoder: both have config examples in the README.
To debug, run npx @modelcontextprotocol/inspector uvx mcp-server-git. That command starts the MCP Inspector; the Git server itself is not an npm package.
Scoping with --repository
--repository (or -r) accepts any path inside a working tree. At startup the server walks up to the repository root, the same way git rev-parse --show-toplevel does, and every tool call is then checked against that root. Two consequences from the README and source:
- A subdirectory path still opens the whole repository to the agent, not just that folder.
- If you leave
--repositoryout, there is no restriction, and the agent can pass anyrepo_pathon the machine that your user account can read.
The server also rejects branch names, revisions and other arguments that start with - (to block Git flag injection), and git_add refuses paths that resolve outside the repository.
Read vs write access
There is no read-only switch. Five tools are not marked read-only: git_add, git_reset, git_commit, git_create_branch and git_checkout. The server flags read tools with readOnlyHint and git_reset with destructiveHint, but those hints only help if your client uses them to ask before running a tool. If you only want history and diff access, turn off those five tools in your client's tool settings where it allows that.
Use cases
- Writing a commit message or PR description from
git_diff_staged. - Reviewing what changed since a release tag with
git_diffandgit_log. - Reading an older version of a file with
git_showto see why code changed. - Finding which branches contain a fix with
git_branchand itscontainsfilter. - Letting a coding agent stage and commit its own changes on a feature branch.
Limitations
- Local only. No remote operations and no hosting-platform features such as issues or pull requests.
- Reference code. The servers repository says its servers are reference implementations meant as educational examples, not production-ready solutions, and the Git README says tools may change.
- SDK 2 move. Release 2026.10.19 requires MCP Python SDK 2.x; the previous release, 2026.10.10, required SDK 1.x. An unknown tool name now returns a JSON-RPC
-32602protocol error instead of anisErrorresult, and the server never asks the client for Roots: access comes only from--repositoryor each call'srepo_path. - No content search tool. History search is limited to
git_logwith dates and counts; there is no grep or blame tool.
Who it is for
A good fit if:
- You want an agent to read diffs and history and write commits in a repository on your machine.
- You prefer a small, auditable tool set over a broad platform server.
Look elsewhere if:
- You need issues, pull requests or Actions on GitHub. The GitHub MCP server covers the hosting side.
- You use GitLab and want merge requests and issues. The GitLab MCP server is built into GitLab at
https://<your-gitlab>/api/v4/mcp, generally available since GitLab 19.5, and accepts an OAuth token or a fine-grained personal access token. - You need plain file reads and edits outside Git. The Filesystem MCP server does that with directory scoping.
What we could not verify
- Which MCP clients honor the read-only and destructive hints by prompting before a tool runs.
How this page was put together
We read the src/git README, pyproject.toml and server.py source and the commit history of the src/git folder, the servers repository README, the PyPI and Docker Hub entries, and GitLab's MCP server documentation on October 27, 2026. We compared published documentation and code; we did not run the server.
Sources
Pricing
Open Source: from Free
Our Take on Git MCP
A small, readable server for letting an agent work inside one local Git repository: diffs, history, branches and commits, with no push, pull or hosting-platform features. Always pass --repository, because without it the agent can open any repository your account can read, and remember there is no read-only mode. It is a reference implementation, so pair it with the GitHub or GitLab server if you need pull requests or issues.
Alternatives to Git MCP
GitHub's official MCP server: repos, issues, pull requests and Actions, hosted or local
View GitHub MCP →