
Git MCP, the reference server for Git repos on your computer
Lets Claude, Cursor or VS Code read your local Git history, review changes and make commits. It cannot push or pull.
This server lets Claude or another AI assistant work with a Git repository on your own computer. It can show changes, stage files, write commits, switch branches and read history. It has no push or pull, so for issues, pull requests and Actions on GitHub, use the GitHub server instead. Always set the repository option, or it can reach every repo you can.
Good for
- Developers who want the assistant to review a diff and write the commit message
- Anyone who wants to ask about a repo's history, such as who changed what and when
- People who use GitLab, Bitbucket or a private host and want plain Git, not a GitHub tie-in
- Developers who want a small, readable example of an MCP server
Works in
2 supported · 1 with issues · 9 should work
Tap an app to see how to set it up and any known problems.
The README covers it: add the server to claude_desktop_config.json, with the repository option set. GitHub
One-click buttons and an mcp.json example; add the repository option yourself, since the example leaves it out. GitHub
The README's Zed settings example needs fixing before you paste it.
Known problems
- Open
The README's Zed config is not valid JSON and fails when pasted into settings
Workaround: Make context_servers an object with { } instead of [ ], as in the README's pip example.
Since Oct 2026 · GitHub
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Client does not support this transport.
Client does not support this transport.
Install git MCP
Claude Code
- 1
Copy this prompt.
Add the git MCP server to Claude Code. Run this command: claude mcp add git -- uvx mcp-server-git Then check that it loaded and tell me if I need to sign in or restart.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires uv (Python).
Without --repository, this server can read and write any Git repository your user account can reach, including commits, resets and branch changes. Add --repository path/to/repo to the args to confine it to one repository. Set it whenever you use the server with content you do not fully trust. Docker (mcp/git) and pip install mcp-server-git are also documented.
Built from the package data we hold. Not yet tested by us.
Tools
Shows what has changed in your working copy
Lists modified, staged and untracked files in a repository. Use it first to see where things stand before committing.
Try: “What is the status of my repo at ~/code/app?”
Files ·
git_statusLists recent commits, with date filters
Shows commit history with hash, author, date and message, up to a count you set, and optionally between two dates. Use it to see what changed recently.
Try: “Show the last 10 commits in ~/code/app from the past 2 weeks.”
Files ·
git_logShows a commit or a file at a revision
Displays the contents of a commit, or a file or folder as it was at a given commit, branch or tag. Use it to inspect old versions.
Try: “Show README.md as it was at tag v1.0.”
Files ·
git_showShows edits not yet staged
Returns the diff of changes in your working directory that are not staged, with a configurable number of context lines.
Try: “What have I changed but not staged yet?”
Files ·
git_diff_unstagedShows edits staged for commit
Returns the diff of everything currently staged, so you can review what the next commit will contain.
Try: “Show me what is staged for my next commit.”
Files ·
git_diff_stagedCompares your state with a branch or commit
Shows the differences between the current state and a branch or commit you name. Use it to review how your work differs from main.
Try: “Diff my current branch against main.”
Files ·
git_diffLists local, remote or all branches
Lists branches, optionally only those that contain or do not contain a given commit. Use it to find which branches have a fix.
Try: “List remote branches that contain commit abc1234.”
Files ·
git_branchStages files for the next commit
Adds the files you name to the staging area; passing a dot stages everything. Run it before committing.
Try: “Stage src/app.py and tests/test_app.py.”
Write ·
git_addCommits the staged changes
Records the staged changes as a commit with the message you give and returns the new commit hash. Fails if nothing is staged.
Try: “Commit the staged changes with the message "Fix login redirect".”
Write ·
git_commitUnstages everything
Removes all files from the staging area without discarding your edits. Use it when you staged too much.
Try: “Unstage everything I added.”
Write ·
git_resetCreates a new branch
Creates a branch from the current branch, or from a branch, tag or commit you specify. It does not switch to it.
Try: “Create a branch called fix-login from main.”
Write ·
git_create_branchSwitches to a branch
Switches the working copy to another branch. If you give a commit or tag instead, you end up in a detached HEAD state.
Try: “Switch to the fix-login branch.”
Write ·
git_checkout
Read from the source code
Pros and cons
Good
- Works on plain Git, so GitHub, GitLab, Bitbucket and private hosts all work.
- Needs no account, token or sign-in.
- Maintained by the MCP team, with quick fixes.
- Can run in Docker with only the folders you mount.
Watch out
- No push, pull, fetch, remote or merge tool.
- No read-only mode, so commits and branch changes always stay available.
- Unconfined unless you set the repository option, and some README examples omit it.
- Five medium-severity security fixes so far; keep it updated.
- Runs only on your computer, not as a hosted server.
- Python package: no npm install.
Permissions
medium risk · 4 things to watch · 5 advisories
Medium risk
Without the repository option, your assistant can commit to, reset and switch branches in every Git repo your account can reach. Always set the repository option, and approve each change in your app instead of auto-allowing it.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It can reach every repo unless you set one
Without the repository option, every Git repo your account can reach is in scope, for writes too. The README's VS Code and Zed examples leave it out, so add it. github.com
Older versions could be chained into running code
Researchers combined older versions with the Filesystem server, using planted text, to run code. Fixed in 2025.12.18, so keep both servers updated. theregister.com
It changes local history but cannot push
It can stage, commit, unstage, branch and check out in your working copy. It has no push or network tools, so nothing leaves your machine through it. github.com
Reference code, not a hardened product
The maintainers call these servers educational examples, not production-ready. Add your own safeguards. github.com
Security advisories
5 known advisories, all fixed in a newer version.
- A crafted folder inside your allowed repo could let the assistant work on a different repository on your diskmedium · Fixed in 2026.10.28 · GHSA-w766-5x43-whvw
- Files outside the repository could be staged, and then committed and pushed out by other meansmedium · Fixed in 2026.1.14 · GHSA-vjqx-cfc4-9h6v / CVE-2026-27735
- Limiting the server to one repository did not stop it working on other repositories on your machinemedium · Fixed in 2025.12.18 · GHSA-j22h-9j4x-23w5 / CVE-2025-68145
- A crafted diff or checkout request could overwrite or empty files on your machinemedium · Fixed in 2025.12.18 · GHSA-9xwc-hfwc-8w59 / CVE-2025-68144
- The assistant could turn any folder into a Git repo, a step in a known code-execution attackmedium · Fixed in 2025.9.25 · GHSA-5cgr-j3jf-jw3v / CVE-2025-68143
Technical details
| Turning on read-only | No read-only flag. --repository limits which repository it can touch, but commit, add, reset, branch and checkout stay available; rely on your client's per-tool approval to block them. |
|---|
Alternatives
Use this server for your local working copy: diffs, commits, branches and history. Use the GitHub server for issues, pull requests and Actions, or cyanheads' git-mcp-server if you need push, pull and merge.
| Server | Official | Runs | Can change things | GitHub stars |
|---|---|---|---|---|
| For Git | ||||
| Git (reference)This page | Community | Local | Yes | – |
| GitMCP | Community | – | No | 8.5K |
| Other tools for the same job | ||||
| GitHub MCP ServerFor GitHub | Official | HostedLocal | Yes | 34.1K |
| git-mcp-server (cyanheads) | Community | Local | Yes | 243 |
| gitlab-mcpFor GitLab | Community | – | – | 2.1K |
What people say
People value plain, host-neutral Git and the fast fixes, and they miss push and merge.
What people like
- Plain Git works the same on GitHub, GitLab and Bitbucket, with no GitHub server needed.
- Maintainers now fix reported bugs quickly and publish advisories with fixed versions.
Common complaints
- No push, pull or remote tools, so you need another server or the shell to get a branch onto GitHub.
- No merge tool, and one user says the model tried to fake a merge with commits.
- Security researchers found flaws in this reference server that worked out of the box.
In their words
“I am using another mcp to open pull requests, that mcp needs the branch to exist remotely first”digitalbuddhaGitHub issueApr 2025
“I don't want to limit it to GH / BB / GL - when I use git locally I don't care, and I don't want the entire GH MCP server just to be able to push across forks”nimrodkorNewsJan 2026
“If security boundaries break down even in the reference implementation, it's a signal that the entire MCP ecosystem needs deeper scrutiny. These are not edge cases or exotic configurations, they work out of the box.”Shahar Tal, Cyata
Questions
Should I use the Git server or the GitHub server?
Use Git for your local working copy: status, diffs, staging, commits, branches and history. Use the GitHub server for anything on github.com, such as issues, pull requests and Actions. Many people run both, because Git cannot push.
Can it push, pull or merge?
No. It has no push, pull, fetch, remote or merge tool. Maintainers closed the push request as out of scope for a reference server.
Is it safe to use?
Only with limits. It can change your local history, and without the repository option it can reach every repo you can. Set that option and approve changes one by one.
How do I limit it to one repository?
Start it with the repository option and a path inside the repo. The server widens it to the repo root. Without the option it can read and write every Git repo your account can reach.
Is it free?
Yes. It is open source under the MIT licence and needs no account or token.
Is it still maintained or archived?
It is maintained. It is one of seven reference servers the MCP team still keeps in the main servers repo. Older reference servers such as GitHub and GitLab moved to an archive with no security guarantees.
Was it affected by security vulnerabilities?
Yes, five medium-severity advisories, all fixed. The latest, about a nested repo escaping the repository limit, was fixed in 2026.10.28, so update to that version or newer.
Is there an npm package?
No. It is a Python package called mcp-server-git. Installs that try npm fail with a 404.
Why does my Windows path fail with "Connection closed"?
JSON treats a single backslash as an escape, so c:\temp turns into a tab. Write the path with double backslashes or forward slashes.
How do I set the commit author name and email?
Set the standard Git author and committer environment variables, GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_COMMITTER_NAME and GIT_COMMITTER_EMAIL, in the server's env block.
Examples
Review what changed before committing
Show me the staged and unstaged changes in this repo and point out anything that looks like a mistake.
SourceWrite a commit message from the staged diff
Look at the staged diff and commit it with a short conventional-commit message.
Summarise recent history
List the commits from the last two weeks and summarise what changed.
SourceStart a feature branch
Create a branch called fix/login-timeout from main and switch to it.
Read a file as it was in an older commit
Show me src/config.py as it was at the v1.2.0 tag.
Source
Information
updated Nov 3, 2026
- Publisher
- Community
- Package
mcp-server-git- Registry
- PyPI
- Transport
- stdio
- Auth
- None
- Version
- 2026.10.28
- License
- MIT
- Last commit
- Oct 29, 2026
- Open issues
- 26
- Listed in
- Docker MCP Catalog
Other Git MCP servers
Sources
Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.
Show all 17Hide
- mcp-server-git README · github.com
- github.com · github.com
- github.com · github.com
- github.com · github.com
- thehackernews.com · thehackernews.com
- www.theregister.com · theregister.com
- github.com · github.com
- github.com · github.com
- github.com · github.com
- github.com · github.com
- github.com · github.com
- github.com · github.com
- github.com · github.com
- github.com · github.com
- github.com · github.com
- github.com · github.com
- github.com · github.com