Git MCP Server
A reference MCP server that runs Git commands — status, diff, log, commit, branch — against a local repository so an agent can inspect and manage version control without shelling out.
Add to Claude Code
claude mcp add git -- uvx mcp-server-git --repository /path/to/repo
Source: https://github.com/modelcontextprotocol/servers/tree/main/src/git
About
The Git MCP server wraps common Git operations — status, diff, log, add, commit, branch creation and checkout — as callable tools scoped to one local repository path. Instead of an agent guessing at raw shell commands, it gets structured, predictable outputs for each Git action.
It's part of the official Model Context Protocol reference servers, written in Python, and is commonly paired with the Filesystem and GitHub servers to give an agent a complete local-to-remote version control workflow.
Key features
- Inspect status, diffs, and commit history for a repository
- Stage files and create commits with a message
- Create, list, and check out branches
- Read and compare specific commits
Use cases
- Let an agent review its own uncommitted changes before committing
- Generate a commit message from a diff automatically
- Check which branch a repository is on before making changes
Available tools
git_status
Shows the working tree status — staged, unstaged, and untracked files.
git_diff
Shows changes between the working directory, staging area, or commits.
git_commit
Commits staged changes with a given message.
git_log
Shows commit history for the repository or a specific file.
git_create_branch
Creates a new branch from a specified starting point.
Frequently asked questions
Does it push to a remote?
The reference server focuses on local operations — status, diff, commit, branching. Pushing and pulling typically stay a manual step or are handled by the GitHub MCP server for remote operations.
What do I need installed to run it?
Python and the uv package manager — the server ships as a Python package (mcp-server-git) run via uvx, with Git itself installed on the host machine.