Git MCP Server
Full Git repository operations for AI agents — read history, diff, commit, branch
The Git MCP Server exposes Git repository operations directly to AI agents. Agents can read commit history, inspect diffs, create branches, stage files, and commit changes — all without needing shell access. This makes it the foundation of any AI coding workflow where version control matters.
Unlike the GitHub MCP Server (which talks to GitHub's API), this server operates on local Git repositories on disk and supports any Git host — GitHub, GitLab, Bitbucket, or self-hosted.
Installation & Configuration
Add this block to your claude_desktop_config.json:
{
"mcpServers": {
"git": {
"command": "uvx",
"args": ["mcp-server-git", "--repository", "/path/to/your/repo"]
}
}
}
To allow the agent to work across multiple repositories, omit --repository and let tools accept a path argument per call.
Config file location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/claude/claude_desktop_config.json
Available Tools (13)
git_statusgit_diff_unstagedgit_diff_stagedgit_diffgit_commitgit_addgit_resetgit_loggit_create_branchgit_checkoutgit_showgit_initgit_clone
Use Cases
- AI-assisted code review — ask Claude to summarize what changed in the last 10 commits
- Automated commit message generation — stage files and let the agent write a meaningful commit
- Branch management — create feature branches and check out work automatically
- Pre-deploy audits — diff main vs release branch before shipping
- Bug archaeology — search commit history for when a specific line was introduced
Source & Documentation
GitHub Repository: https://github.com/modelcontextprotocol/servers/tree/main/src/git
Protocol: Model Context Protocol (MCP) — modelcontextprotocol.io