Git MCP Server

Official

Run git commands and inspect local repositories from your AI

GitHub8.2k
gitversion-controllocalofficialdiffcommits

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 nameDescription
git_statusShow the working tree status
git_diffShow changes between commits or working tree
git_logShow the commit history
git_showShow details of a specific commit
git_branchList, create, or delete branches
git_addStage files for commit
git_commitCreate a commit with a message
git_checkoutSwitch 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