PTS security notes / MCP servers / Git MCP server

Is Git MCP server safe to install?

By PTS · Based on public source as of December 5, 2026

Short answer

It can read a repository and also add, commit, reset, branch, check out and merge in it. Without --repository it can operate on any repo the process can reach. It has no push, pull or clone tool, but its advisory list is long: GitHub lists 33 advisories, including critical ones where a repository's own config could run a program, all fixed by 2026.12.5. Pin 2026.12.5 or later, always pass --repository, and do not point it at repositories you did not create.

What it is

The Git server is a reference implementation from the MCP project. It exposes Git commands as tools for a repository you name with --repository, or, with no flag, for any repo_path a tool call supplies.

Maintainer
Reference server (MCP project)MCP project reference servers (github.com/modelcontextprotocol)
Source
modelcontextprotocol/servers92,573 GitHub stars · not stated on GitHub licence
Transport
stdio (default), Streamable HTTP (optional)
Packages
mcp-server-git pypi · latest 2026.12.5 · 462,665 downloads last month
Latest release
v2.7.0 2026-12-05
Public advisories
33GitHub and OSV, as of December 5, 2026

What it can do

Read from the public tool definitions in the source, not from a live run. A capability marked "yes" means at least one tool can do it.

The advisories describe Git itself running programs named in a repository's own configuration (hooks, filters, gpg.program) when a tool touched that repository. That is why it matters whose repository you open.

ToolWhat it can doNotes
git_statusReads
git_diff_unstagedReads
git_diff_stagedReads
git_diffReads
git_logReads
git_showReads
git_branchReadsLists branches.
git_remoteReadsLists remotes with credentials redacted.
git_addWritesStages files.
git_commitWritesRecords a commit.
git_resetWrites, DeletesUnstages changes.
git_create_branchWrites
git_checkoutWrites, DeletesSwitches branch and can overwrite working files.
git_mergeWrites, DeletesMerges and can overwrite working files.

Counted from the GitTools enum and the tool registrations in src/git/src/mcp_server_git/server.py. No push, pull, fetch or clone tool was found.

Credentials and least privilege

No credential. It runs Git locally with whatever identity and config your Git already has.

Public security advisories

Advisories published on GitHub or OSV for this project, as of December 5, 2026. Fixed issues are a normal part of a maintained project. What matters is that the version you run is not in an affected range. Showing the 12 highest severity of 33, newest first within a level. See the full list on GitHub.

AdvisorySeveritySummaryAffectedFixed in
GHSA-crwj-9h86-9238Criticalmcp-server-git: unexpandable sparse index lets submodule filter drivers run< 2026.12.52026.12.5
GHSA-3r4g-w7c3-fqrxCriticalmcp-server-git runs a repo's gpg.program via git_merge and git_branch< 2026.12.52026.12.5
GHSA-xg98-h8vw-5545Criticalmcp-server-git --repository: checks a bare repo but runs a hidden .git's filter< 2026.12.52026.12.5
GHSA-72h3-v69g-xwxjCriticalgit_add runs submodule filter commands when gitlink mode is not 160000< 2026.12.52026.12.5
GHSA-pjvq-3c9r-6h2qCriticalgit: harden_repo ignores core.worktree, so repository-defined filters run< 2026.12.52026.12.5
GHSA-33p6-82cm-6c2cHighmcp-server-git executes a nested submodule transport helper through git_add2026.11.272026.12.5
GHSA-j4hr-p3xr-v32qHighmcp-server-git: a repository's config-based hooks (Git 2.54+) run a program on git_status despite the hook hardening<= 2026.11.272026.12.5
GHSA-f3r7-67gq-3pp6HighConfigured Git repository root can be retargeted through a symlink2026.11.272026.12.5
GHSA-v8h9-x96f-6g9wHighgit_checkout writes outside --repository via .git symlinks into the working tree< 2026.12.52026.12.5
GHSA-6c7c-7g2v-v7qxHighSubmodule index symlink lets git_add overwrite an index outside --repository< 2026.12.52026.12.5
GHSA-jc92-w368-24f3Highgit: fake Git dir in a clone can set the --repository root to any path< 2026.12.52026.12.5
GHSA-c3ph-h254-3cg4Highgit: hooks symlink exemption lets git_merge write outside --repository< 2026.12.52026.12.5

What stands out

Safe-install checklist

Install command from the project's docs: uvx mcp-server-git --repository path/to/repo.

  1. Pin the version. Use an exact version, not latest: uvx mcp-server-git==2026.12.5 --repository path/to/repo. Use 2026.12.5 or later, the release that fixed the most recent advisories.
  2. Keep secrets out. Start it with a clean environment, so it does not inherit your shell's keys.
  3. Always pass --repository and point it at a repository you created. Do not let an agent run Git on a freshly cloned repository from someone else.
  4. Use 2026.12.5 or later and re-check the advisory list before each upgrade.
  5. Deny git_reset, git_checkout and git_merge if the agent only needs history and diffs, and keep your remote credentials in a helper the agent cannot read.
  6. Deny the tools you do not need. In Claude Code, deny rules in .claude/settings.json use the form mcp__<server name>__<tool>, where the server name is whatever you called it in your config. Example, if you named it git:
    {
      "permissions": {
        "deny": [
          "mcp__git__git_add",
          "mcp__git__git_commit",
          "mcp__git__git_reset",
          "mcp__git__git_create_branch",
          "mcp__git__git_checkout",
          "mcp__git__git_merge"
        ]
      }
    }
  7. Snapshot the tool list. Save the tools/list output right after you install, then compare it before every upgrade with the free PTS MCP tool diff checker. It runs in your browser and flags new tools and changed descriptions or schemas.
  8. Watch for fixes. Watch the project's security advisories and upgrade on purpose, after the diff.

For the general version of this list, see the MCP server security checklist. Not sure about a server that is not listed here? Read Is an MCP server safe to install?

Quick follow-ups

What can Git MCP server do on my machine or accounts?

Based on its public tool definitions, it can: reads local files or data; creates or changes files, records or settings; deletes or destroys data. The advisories describe Git itself running programs named in a repository's own configuration (hooks, filters, gpg.program) when a tool touched that repository. That is why it matters whose repository you open.

Does Git MCP server need a token or API key?

No credential. It runs Git locally with whatever identity and config your Git already has.

Has Git MCP server had public security advisories?

Yes. 33 public advisories (GitHub or OSV) listed for it as of December 5, 2026. Each one is linked on this page with its affected and fixed versions, so you can check the version you run. Fixed issues are normal for active projects. Running a current, pinned version is what matters.

How do I keep Git MCP server from changing under me?

Pin the version, for example uvx mcp-server-git==2026.12.5 --repository path/to/repo. Then save its tool list (name, description, input schema) with the free PTS MCP tool diff checker and compare it before each upgrade.

Sources

This page is a factual summary of public information about the software. It is not a verdict on the maintainers and not an audit. Check the project's own docs for your version before you rely on it. Educational, not legal or security advice.

Get the free checklist

A 9-page worksheet plus starter files for Claude Code and Codex. It maps what your agent can reach and shrinks it. Download it on Gumroad. This site does not collect email.

Get the free checklist

Before you install anything, try the MCP tool diff checker. See all 54 servers.

More server pages