Git MCP Server: local repos for clients without a shell
A reference server from the MCP project: status, diffs, log, staging, commits and branches as structured tools, for clients like Claude Desktop with no shell.
Project and installation docs
View projecthttps://github.com/modelcontextprotocol/servers
Terminal agents like Claude Code and Codex can just run git. Chat clients such as Claude Desktop have no shell, so the model can’t even look at what changed in a local repository. mcp-server-git wraps everyday Git operations as structured tools: the model calls them with parameters and gets back status, diffs and commit history. It’s one of the reference implementations in the Model Context Protocol project’s official servers repository, written in Python.
What it does
- Status and diffs:
git_status,git_diff_unstaged,git_diff_stagedandgit_diffcover the working tree, the index and comparisons between branches. - History:
git_logfilters by time range (ISO 8601 or relative values like “2 weeks ago”), andgit_showprints a commit. - Writes:
git_addstages,git_commitcommits andgit_resetunstages. - Branches:
git_branchlists local or remote branches,git_create_branchcreates one andgit_checkoutswitches. - Several ways to run it: besides
uvx, you canpip install mcp-server-gitand runpython -m mcp_server_git, or use the repo’s Docker config, mounting your workspace so the container can see the repo.
Who it’s for
- Developers using Claude Desktop to read diffs and draft commit messages.
- People building their own MCP clients or agent frameworks who want a clean Git tool layer.
Setup
Run it through uv’s uvx with nothing to install, pointing --repository at your repo:
"mcpServers": {
"git": {
"command": "uvx",
"args": ["mcp-server-git", "--repository", "path/to/git/repo"]
}
}
Alternatively pip install mcp-server-git and run python -m mcp_server_git. The README also has a Docker config.
Our take
Coding agents that already have a terminal don’t need it; calling git directly is more flexible. It earns its place in shell-less clients and home-built agents, with clear tool boundaries, simple parameters and readable reference code. It does write: it can commit, reset the index and switch branches, so a wrong checkout or a stray committed file is yours to clean up. There’s no push tool, so nothing reaches a remote on its own. The README calls it early-stage with tools still changing, and it currently requires MCP Python SDK 1.x (mcp>=1.29.0,<2), with the port to 2.0 still in progress. Pair it with Fetch MCP Server when the agent also needs to read remote pages or docs; both are reference implementations in the protocol’s own repository. Licensed MIT, with the MCP project as a whole moving to Apache-2.0.