Skip to content
MCP Shelf

Git MCP Server

Status, diffs, history, commits and branches in a local Git repository.

View on GitHub
  • Not yet tested by us
  • ★ 92.2K GitHub stars
  • Last commit 24 Nov 2026

What is Git MCP Server?

Git MCP Server (mcp-server-git) is the Model Context Protocol project's reference server for reading, searching and changing local Git repositories: status, diffs, history, commits, branches and merges.

Tools
14
Runs on
Your computer
Licence
MIT
GitHub stars
92.2K

Good for

  • Asking for a commit message or a review of what you changed
  • Digging through history: when a line changed and what else changed with it
  • Assistants without a terminal, such as Claude Desktop, working on a local repo

You'll need

  • uv, to run it with uvx (or pip install mcp-server-git)
  • Git and a local repository
Works withClaude CodeCursorClaude DesktopVS CodeCodexWindsurfEach has a ready-made config on the Install tab, built from the README.

Not yet tested by usWritten from the project's own documentation. We have not run this config ourselves yet.

Try asking Git MCP Server

Once it is installed, ask your assistant things like:

  • Look at my staged changes and write a commit message for them.
  • What changed on this branch compared with main?
  • Show me the last ten commits that touched src/auth.

MCP Shelf take

We started Git on our own test machine on 24 Nov 2026 and it answered with 14 tools. 8 of the 14 only read; the other 6 can change things. Every tool comes with a useful description, all of them say whether they change things, and the tool list costs about 600 tokens of context before you ask a thing. It sits 2nd of 27 in its category on our shelf by GitHub stars (92.2K).
MCP Shelf tests: numbers from our own runs, not the README · tested on 24 Nov 2026

What can Git MCP Server read and change?

It can read

  • Status, diffs, history and branches of the repository
  • File contents at any revision
  • Remote names and URLs, with credentials hidden

It can change

  • Stages and unstages files and makes commits
  • Creates and checks out branches, which changes files in the working tree
  • Merges branches into the current one

Safer setup: Always pass --repository so it can only reach one repository. It has no push, pull or fetch, never runs the repository's hooks or configured programs, and refuses merges over uncommitted changes.

Git MCP Server in more detail

mcp-server-git is the Git server kept by the Model Context Protocol project. It works on repositories on your own disk: the assistant can check the status, read staged and unstaged diffs, compare branches or commits, read the log and file contents at any revision, and stage, commit, branch, check out and merge. Two prompts write a commit message for staged changes or summarise what changed.

Pass --repository so it only touches the repository you name; without it, it can work on any repository your user account can reach. It never runs hooks or other programs a repository configures, so opening an unfamiliar repo is safe. It has no push or pull, which keeps anything remote in your hands.

Made by
Model Context Protocol project (modelcontextprotocol/servers)
Latest version
2026.11.18 (18 Nov 2026)
PyPI package
mcp-server-git
Last commit
24 Nov 2026
Setup checked
24 Nov 2026
Page updated
24 Nov 2026

What's in the pod

What tools does Git MCP Server have?

We found 14 tools when we started it on 24 Nov 2026. 8 only read. The rest can change things, so keep your app's "ask before each tool call" setting on for them.

How we tested it: Started with uvx and a real empty repository in place of path/to/git/repo.

Changes things6 tools · Can create, edit, send or delete.

ToolWhat it is for
git_addStages files; ["."] stages everything.
git_checkoutSwitches to a branch, or detaches HEAD at a commit or tag.
git_commitCommits the staged changes with a message and returns the new hash.
git_create_branchCreates a branch from the current one or from a branch, tag or commit you name.
git_mergeMerges a branch into the current one, fast-forward only unless you allow a merge commit. A merge with conflicts is aborted.
git_resetUnstages everything that is staged, without touching your files.

Only reads8 tools · Looks things up and changes nothing.

ToolWhat it is for
git_branchLists local, remote or all branches, optionally those that contain a commit.
git_diffCompares the working tree with a branch or commit, or two revisions with a..b or a...b.
git_diff_stagedShows changes staged for the next commit.
git_diff_unstagedShows changes not yet staged.
git_logLists commits, optionally between two dates such as 2 weeks ago and yesterday.
git_remoteLists the remotes and their URLs, with any credentials in them hidden.
git_showShows a commit, or a file or folder as it was at a revision.
git_statusShows the working tree status.

Tool groups

Prompts
git_commit_message asks the model for a commit message from the staged diff, and git_summarize_changes summarises the working tree or the diff against a branch. Clients usually show them as slash commands.

Grouped and described by us. The README on GitHub lists the inputs each tool takes.

How clearly it describes its tools to your assistant

Tools with a description
14 of 14
Say if they change things
14 of 14
Context it takes, at least
~600 tokens

Every tool says whether it only reads or can change things, so a client can ask before the risky ones.

From the tool list it sent us. The token figure counts names, descriptions and input names; the full schemas your client loads add more.

How do I install Git MCP Server?

Quick install

Pick your app and paste this in. It follows the README's own install steps below.

Where it goes: Your terminal, in the project folder

Claude Code
claude mcp add git -- uvx mcp-server-git --repository path/to/git/repo

Claude Code can already run git in its terminal, so this server matters most in chat apps. To add it anyway: claude mcp add git -- uvx mcp-server-git --repository with your repository's path.

Codex, Windsurf, ChatGPT and more →

Install steps from the Git MCP Server README

The project's own instructions, copied from its README on GitHub on 24 Nov 2026 under its MIT licence. They are the source of truth; the ready-made configs further down are built from them. The full README is on GitHub.

Using uv (recommended)

When using uv no specific installation is needed. We will use uvx to directly run mcp-server-git.

Using PIP

Alternatively you can install mcp-server-git via pip:

pip install mcp-server-git

After installation, you can run it as a script using:

python -m mcp_server_git
Usage with Claude Desktop

Add this to your claude_desktop_config.json:

Using uvx
"mcpServers": {
  "git": {
    "command": "uvx",
    "args": ["mcp-server-git", "--repository", "path/to/git/repo"]
  }
}
Using docker
  • Note: replace '/Users/username' with a path that you want to be accessible by this tool
  • Note: the -e lines set the identity git_commit records; see Commit identity
  • Note: the image runs as the unprivileged app user, not root, and trusts every repository mounted into it (safe.directory '*'), since a bind mount rarely shows up owned by that user. On a Linux host, where a bind mount keeps the host's file ownership, add "--user", "1000:1000" (your own id -u and id -g) before mcp/git so the server can write to the repository and its commits leave files you own; with --user, mount a gitconfig at /.gitconfig rather than /home/app/.gitconfig, or use the -e lines. Docker Desktop on macOS and Windows needs neither.
"mcpServers": {
  "git": {
    "command": "docker",
    "args": [
      "run", "--rm", "-i",
      "-e", "GIT_AUTHOR_NAME=Your Name",
      "-e", "GIT_AUTHOR_EMAIL=you@example.com",
      "-e", "GIT_COMMITTER_NAME=Your Name",
      "-e", "GIT_COMMITTER_EMAIL=you@example.com",
      "--mount", "type=bind,src=/Users/username,dst=/Users/username",
      "mcp/git"
    ]
  }
}
Using pip installation
"mcpServers": {
  "git": {
    "command": "python",
    "args": ["-m", "mcp_server_git", "--repository", "path/to/git/repo"]
  }
}
Usage with VS Code

For quick installation, use one of the one-click install buttons below...

For manual installation, you can configure the MCP server using one of these methods:

Method 1: User Configuration (Recommended) Add the configuration to your user-level MCP configuration file. Open the Command Palette (Ctrl + Shift + P) and run MCP: Open User Configuration. This will open your user mcp.json file where you can add the server configuration.

Method 2: Workspace Configuration Alternatively, you can add the configuration to a file called .vscode/mcp.json in your workspace. This will allow you to share the configuration with others.

For more details about MCP configuration in VS Code, see the official VS Code MCP documentation.

{
  "servers": {
    "git": {
      "command": "uvx",
      "args": ["mcp-server-git"]
    }
  }
}

For Docker installation:

{
  "mcp": {
    "servers": {
      "git": {
        "command": "docker",
        "args": [
          "run",
          "--rm",
          "-i",
          "--mount", "type=bind,src=${workspaceFolder},dst=/workspace",
          "mcp/git"
        ]
      }
    }
  }
}

What you need first

  • uv, to run it with uvx (or pip install mcp-server-git)
  • Git and a local repository

Add Git MCP Server to your app

Pick your app for a ready-to-paste snippet and where it goes, built from the steps above.

Where it goes: Your terminal, in the project folder

Claude Code
claude mcp add git -- uvx mcp-server-git --repository path/to/git/repo

Claude Code can already run git in its terminal, so this server matters most in chat apps. To add it anyway: claude mcp add git -- uvx mcp-server-git --repository with your repository's path.

Replace path/to/git/repo with your repository. Commits use your Git config name and email; set GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL and the two GIT_COMMITTER variables in env to choose another identity.

Checked against the project's own install docs on 24 Nov 2026: github.com/modelcontextprotocol/servers/tree/main/src/git, pypi.org/project/mcp-server-git.

Did this work for you?

Projects change their install steps often. If Git MCP Server did not install, or something here no longer matches the project, tell us and we will check it against the README and fix the page.

New to this? See the setup guides for Claude Code, Cursor, Claude Desktop, VS Code, Codex and ChatGPT. If it will not start, test it in MCP Inspector and look up the error in Fixing MCP server errors.

Git MCP Server not working? Common fixes

It exits saying path/to/git/repo does not exist
Replace the example path after --repository with the path of a real repository on your machine. Any folder inside the working tree works; the server finds the root itself.
Commits show the wrong name, or something like app@3f2a1b9c
The server falls back to the system user when no identity is set, which happens in Docker. Set GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_COMMITTER_NAME and GIT_COMMITTER_EMAIL in env, or mount your .gitconfig.
A tool call says repo_path is outside the repository
With --repository set, every call must point inside that repository. Start a second server entry for another repository, or remove --repository if you accept the wider access.
git_merge fails
It refuses a detached HEAD, uncommitted changes and a merge already in progress, and it aborts on conflicts and names the files. Commit or reset first, then resolve conflicts yourself.

How do I configure Git MCP Server?

Names are exactly as the project spells them. Required ones are marked.

SettingWhat it does
--repository (-r)Command line flagLimits the server to one repository. Without it, each tool call names its own repo_path and can reach any repository your user can.--repository path/to/git/repo
GIT_AUTHOR_NAME and GIT_AUTHOR_EMAILEnvironment variableThe author git_commit records. Without them it uses your Git config's user.name and user.email.
GIT_COMMITTER_NAME and GIT_COMMITTER_EMAILEnvironment variableThe committer, resolved separately from the author, so set all four together.
--transport streamable-httpCommand line flagRuns it as a local HTTP service instead of over stdio.

Git MCP Server FAQ

Is the Git MCP Server official?

Yes. mcp-server-git is a reference server from the Model Context Protocol project, in the modelcontextprotocol/servers repository, published on PyPI and on Docker Hub as mcp/git. It is still described as early development, so tools may change.

Can the Git MCP Server push to GitHub?

No. It has no push, pull or fetch, so nothing leaves your machine. For GitHub itself, such as pull requests and issues, use the GitHub MCP server.

Is it different from GitMCP?

Yes. GitMCP is a hosted service that reads the docs of public GitHub repositories. mcp-server-git works on Git repositories on your own disk, including uncommitted changes.

Why should I pass --repository?

Without it, the model chooses a repo_path on every call and can read and change any repository your account can reach. With --repository, it is held to the one you name.

Is it safe to open a repository I did not write?

It is built for that. It never runs a repository's hooks, filters, diff drivers or other programs its config names, and refuses repositories that point outside themselves.

How do I add the Git MCP Server to Claude Desktop?

In claude_desktop_config.json, add an entry named git with the command uvx and the args mcp-server-git, --repository and the path to your repository, then restart Claude Desktop.

How do I add the Git MCP Server to Cursor?

Add an entry named git to ~/.cursor/mcp.json with the command uvx and the args mcp-server-git, --repository and your repository's path.

Can I use the Git MCP Server in VS Code?

Yes, with GitHub Copilot in Agent mode. Add a server named git running uvx mcp-server-git to .vscode/mcp.json, and add --repository with the workspace path to keep it to that repository.

Does the Git MCP Server work with Codex?

Yes. Run codex mcp add git -- uvx mcp-server-git --repository followed by the path, or add the same command and args as an [mcp_servers.git] table in ~/.codex/config.toml.

Two peas, one chat

Chat with AI about Git

Opens a chat primed with Git’s README and setup docs from this page, or add it in Cursor to use its tools.

The Cursor button opens Cursor and asks before it adds the server. Fill in any keys it needs in Cursor’s MCP settings.

Peas in a pod

What are the alternatives to Git MCP Server?

How Git MCP Server lines up against its neighbours on the shelf. See every developer tools server.

  • Git MCP ServerThis pea

    Status, diffs, history, commits and branches in a local Git repository.

    Tools
    14
    Runs on
    Your computer
    Licence
    MIT
    Stars
    92.2K
  • Desktop Commander

    A terminal, file search and surgical file edits for your assistant.

    Tools
    25
    Runs on
    Your computer
    Licence
    MIT
    Stars
    10.2K
  • Serena

    IDE-style "find symbol" and "edit symbol" for an agent, backed by language servers.

    Tools
    3 (REPL)
    Runs on
    Your computer
    Licence
    GPL-3.0
    Stars
    30.8K
  • GitHub

    GitHub's own server for repos, issues, pull requests and Actions.

    Tools
    46
    Runs on
    Hosted or your computer
    Licence
    MIT
    Stars
    34K
  • Filesystem MCP Server

    Read, write, edit and search files, only inside the folders you name.

    Tools
    16
    Runs on
    Your computer
    Licence
    Apache-2.0 and MIT
    Stars
    92.2K
  • jCodeMunch

    Indexes your code so an agent can fetch one function instead of reading whole files.

    Tools
    6
    Runs on
    Your computer
    Licence
    LicenseRef-jCodeMunch-Dual-Use-1
    Stars
    2.8K
Full docs on GitHubmodelcontextprotocol/servers

Something wrong on this page? Tell us.

For bots & AI agents

Machine-readable versions of Git MCP Server and MCP Shelf. Fetch these instead of parsing this page.

This listing (.md)llms.txtllms-full.txtai.txtFull catalog (.md)API specMCP serverMCP manifestDeveloper docs