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.
- Reads: yes
- Writes: yes
- Deletes: yes
- Runs code: no
- Network: no
- Sends: no
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.
| Tool | What it can do | Notes |
|---|---|---|
git_status | Reads | |
git_diff_unstaged | Reads | |
git_diff_staged | Reads | |
git_diff | Reads | |
git_log | Reads | |
git_show | Reads | |
git_branch | Reads | Lists branches. |
git_remote | Reads | Lists remotes with credentials redacted. |
git_add | Writes | Stages files. |
git_commit | Writes | Records a commit. |
git_reset | Writes, Deletes | Unstages changes. |
git_create_branch | Writes | |
git_checkout | Writes, Deletes | Switches branch and can overwrite working files. |
git_merge | Writes, Deletes | Merges 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.
| Advisory | Severity | Summary | Affected | Fixed in |
|---|---|---|---|---|
| GHSA-crwj-9h86-9238 | Critical | mcp-server-git: unexpandable sparse index lets submodule filter drivers run | < 2026.12.5 | 2026.12.5 |
| GHSA-3r4g-w7c3-fqrx | Critical | mcp-server-git runs a repo's gpg.program via git_merge and git_branch | < 2026.12.5 | 2026.12.5 |
| GHSA-xg98-h8vw-5545 | Critical | mcp-server-git --repository: checks a bare repo but runs a hidden .git's filter | < 2026.12.5 | 2026.12.5 |
| GHSA-72h3-v69g-xwxj | Critical | git_add runs submodule filter commands when gitlink mode is not 160000 | < 2026.12.5 | 2026.12.5 |
| GHSA-pjvq-3c9r-6h2q | Critical | git: harden_repo ignores core.worktree, so repository-defined filters run | < 2026.12.5 | 2026.12.5 |
| GHSA-33p6-82cm-6c2c | High | mcp-server-git executes a nested submodule transport helper through git_add | 2026.11.27 | 2026.12.5 |
| GHSA-j4hr-p3xr-v32q | High | mcp-server-git: a repository's config-based hooks (Git 2.54+) run a program on git_status despite the hook hardening | <= 2026.11.27 | 2026.12.5 |
| GHSA-f3r7-67gq-3pp6 | High | Configured Git repository root can be retargeted through a symlink | 2026.11.27 | 2026.12.5 |
| GHSA-v8h9-x96f-6g9w | High | git_checkout writes outside --repository via .git symlinks into the working tree | < 2026.12.5 | 2026.12.5 |
| GHSA-6c7c-7g2v-v7qx | High | Submodule index symlink lets git_add overwrite an index outside --repository | < 2026.12.5 | 2026.12.5 |
| GHSA-jc92-w368-24f3 | High | git: fake Git dir in a clone can set the --repository root to any path | < 2026.12.5 | 2026.12.5 |
| GHSA-c3ph-h254-3cg4 | High | git: hooks symlink exemption lets git_merge write outside --repository | < 2026.12.5 | 2026.12.5 |
What stands out
--repositoryis the only confinement. The README says that without it, every tool, including the ones that change a repository, works on any repository the process can reach.- GitHub lists 33 advisories for this package. Many are 2026 hardening fixes for
--repositoryescapes through symlinks and submodules, and several are critical issues where a repository-defined filter or program could run. Most were fixed in 2026.11.18, 2026.11.27 and 2026.12.5. git_remoteredacts credentials embedded in URLs, but the project has already fixed one redaction bypass.- CVE-2025-68143 was about an unrestricted
git_inittool.git_initis no longer in the tool list.
Safe-install checklist
Install command from the project's docs: uvx mcp-server-git --repository path/to/repo.
- 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. - Keep secrets out. Start it with a clean environment, so it does not inherit your shell's keys.
- Always pass
--repositoryand point it at a repository you created. Do not let an agent run Git on a freshly cloned repository from someone else. - Use 2026.12.5 or later and re-check the advisory list before each upgrade.
- Deny
git_reset,git_checkoutandgit_mergeif the agent only needs history and diffs, and keep your remote credentials in a helper the agent cannot read. - Deny the tools you do not need. In Claude Code, deny rules in
.claude/settings.jsonuse the formmcp__<server name>__<tool>, where the server name is whatever you called it in your config. Example, if you named itgit:{ "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" ] } } - Snapshot the tool list. Save the
tools/listoutput 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. - 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.
