▌BestMCPTools.org
Git MCP logo

Git MCP

Read, diff, stage and commit in local Git repos

Developer ToolsOpen SourceClaude DesktopVS CodeZedZencoderany MCP clientEasy✓ Verified

Last verified: October 27, 2026

Own Git MCP? Boost it to the top.✦ Upgrade to Featured

Maintenance status

Active
Last code update: October 24, 2026License: MITChecked October 27, 2026

Reference 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/repo

Compatible 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/repo

Add 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)
MaintainerMCP steering group; PyPI author Anthropic, PBC
TypeLocal stdio server
Installuvx mcp-server-git, pip install mcp-server-git, or Docker image mcp/git
Latest PyPI version2026.10.19 (uploaded October 19, 2026)
Python3.10 or later
MCP SDKPython SDK 2.x (mcp>=2.3,<3)
ProtocolServes both 2026-07-28 and 2025-11-25 clients over stdio, with nothing to configure
Tools12 (7 read-only, 5 that change the repository or checkout)
AuthNone. It uses the local filesystem and your Git setup
Scope control--repository limits tool calls to one repository
LicenseMIT
PriceFree and open source
StatusListed 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.

ToolWhat it doesChanges the repo?
git_statusWorking tree statusNo
git_diff_unstagedDiff of changes not yet stagedNo
git_diff_stagedDiff of staged changesNo
git_diffDiff against a branch or commitNo
git_logCommit history, with optional max_count (default 10) and start or end timestampsNo
git_showA commit, or a file or directory at a revision (for example HEAD:path/to/file)No
git_branchList local, remote or all branches, optionally filtered by a commit they containNo
git_addStage files (["."] stages everything)Yes
git_resetUnstage all staged changes (marked destructive)Yes
git_commitCommit staged changes; also concludes an in-progress mergeYes
git_create_branchCreate a branch from the current or a named baseYes
git_checkoutSwitch branches, or detach HEAD at a commit or tagYes

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 the mcp/git image 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"]} under servers in your user mcp.json or .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 --repository out, there is no restriction, and the agent can pass any repo_path on 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_diff and git_log.
  • Reading an older version of a file with git_show to see why code changed.
  • Finding which branches contain a fix with git_branch and its contains filter.
  • 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 -32602 protocol error instead of an isError result, and the server never asks the client for Roots: access comes only from --repository or each call's repo_path.
  • No content search tool. History search is limited to git_log with 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

Filesystem MCPFile System

Let AI read and write files in directories you choose

View Filesystem MCP →
GitHub MCPDeveloper Tools

GitHub's official MCP server: repos, issues, pull requests and Actions, hosted or local

View GitHub MCP →

Frequently Asked Questions

Tags