MCP servers / Git
Git MCP server: setup for Claude Code, Claude Desktop and Cursor
The Git server lets your AI look at a local repository (status, diffs, history) and also make changes to it: stage files, commit, create branches and switch between them.
It works on the repository folder you name, on your machine. In the version we tested it has no push, pull or fetch tool, so nothing leaves your computer through this server.
- Runs with
- uvx (uv, for Python)
- Package
- mcp-server-git on PyPI
- Needs
- Python tooling: it runs through
uvx, which comes with uv. - Tools
- 12 (7 read-only, 5 can change things)
- Source
- modelcontextprotocol/servers
- Last checked
- 2026-09-20 (server reported version 1.30.0)
Config for Git
Generated by the same code as the free builder, so it matches what you get there. Pick your client, then copy.
Needs uv installed (provides uvx). It can stage, commit, reset and switch branches, not just read. Replace /path/to/your/repo with your repository.
Claude Code
Save as .mcp.json in your project root. Claude Code asks you to approve it the first time.
{
"mcpServers": {
"git": {
"command": "uvx",
"args": [
"mcp-server-git",
"--repository",
"/path/to/your/repo"
]
}
}
}
Or add it from a terminal instead (single quotes work in bash, zsh and PowerShell; more on this command):
claude mcp add git -- uvx mcp-server-git --repository /path/to/your/repo
Claude Desktop
Merge into claude_desktop_config.json (Settings → Developer → Edit Config), then fully quit and restart Claude Desktop.
{
"mcpServers": {
"git": {
"command": "uvx",
"args": [
"mcp-server-git",
"--repository",
"/path/to/your/repo"
]
}
}
}
Cursor
Save as .cursor/mcp.json in your project, or ~/.cursor/mcp.json for all projects.
{
"mcpServers": {
"git": {
"command": "uvx",
"args": [
"mcp-server-git",
"--repository",
"/path/to/your/repo"
]
}
}
}
What it can do
These are all 12 tools the server reported when we started it and asked on 2026-09-20. The labels come from the hints each tool declares about itself.
git_statusread-only
Shows the working tree statusgit_diff_unstagedread-only
Shows changes in the working directory that are not yet stagedgit_diff_stagedread-only
Shows changes that are staged for commitgit_diffread-only
Shows differences between branches or commitsgit_commitcan change things
Records changes to the repositorygit_addcan change things
Adds file contents to the staging areagit_resetcan change things
Unstages all staged changesgit_logread-only
Shows the commit logsgit_create_branchcan change things
Creates a new branch from an optional base branchgit_checkoutcan change things
Switches branchesgit_showread-only
Shows the contents of a commitgit_branchread-only
List Git branches
Watch out for
- Replace
/path/to/your/repowith your repository folder. The server refuses to start outside a Git repository (we saw this while testing). - It can write, not just read:
git_add,git_commit,git_reset,git_create_branchandgit_checkoutall change the repository. - Commits are local until you push them yourself, so they are easy to review or undo before they go anywhere.
- If the path is wrong the server exits at startup. With a folder that does not exist we got
NoSuchPathError, and with a folder that is not a repository, "is not a valid Git repository". See fixing connection errors.
Try asking
- “Show me what changed since the last commit and summarize it in two sentences.”
- “Look at the last 10 commits and tell me which files change most often.”
- “Stage only the test files and write a commit message for them. Do not commit anything else.”
Related servers
- GitHub: Work with repositories, issues and pull requests on GitHub.
- Filesystem: Let the AI read and edit files in folders you allow.
Building a full setup? Combine this with other servers in the config builder. Trouble connecting? See fixing connection errors.