Git MCP Server
OfficialRun git commands and inspect local repositories from your AI
The official Git MCP server lets your AI assistant interact with local git repositories directly. Read commit history, check diffs, inspect branches, view file status, and understand code changes over time — all without leaving your AI client. Unlike the GitHub server which works with remote repositories, this server works with git repositories on your local machine. Particularly useful for understanding what changed and why.
Install Config
Config file: ~/Library/Application Support/Claude/claude_desktop_config.json· Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"git": {
"command": "uvx",
"args": [
"mcp-server-git",
"--repository",
"/path/to/your/repo"
]
}
}
}Available Tools (8)
| Tool name | Description |
|---|---|
| git_status | Show the working tree status |
| git_diff | Show changes between commits or working tree |
| git_log | Show the commit history |
| git_show | Show details of a specific commit |
| git_branch | List, create, or delete branches |
| git_add | Stage files for commit |
| git_commit | Create a commit with a message |
| git_checkout | Switch branches or restore files |
Example Prompts
- “What files have I changed since the last commit?”
- “Show me the last 10 commits in this repo”
- “What did commit abc123 change?”
- “List all branches in this repository”
- “Show me the diff for the current working tree”
Pros & Cons
Pros
- Works with any local git repository
- No API token required
- Great for understanding code history and changes
Cons
- Requires git to be installed on your machine
- Local only — cannot interact with remote repositories directly
Who Is This For?
- ·Developers who want AI to understand their code history
- ·Anyone reviewing changes before committing
When to use: Use when you want AI to help you understand what changed in your codebase, write commit messages, or review diffs before pushing.
Supported Clients
Related Use Cases
Related Servers
GitHub MCP Server
OfficialManage repos, issues, PRs, and code directly from your AI chat
The official GitHub MCP server gives your AI assistant full access to the GitHub API. Create issues, open pull requests,…
Filesystem MCP Server
OfficialGive your AI read and write access to your local files
The official Filesystem MCP server from Anthropic provides secure, configurable access to your local file system. You sp…