Git MCP server for Claude

Use the Git MCP reference server in Claude to inspect a local repository’s history and verify findings against Git before requesting changes.

Published by Model Context Protocol

How to set up the Git MCP server in Claude

  1. Install uv and Git. Replace the sample path in the command and configuration with the full path to a repository you own.
  2. In Claude Code run the matching command. For Claude Desktop, merge the relevant JSON entry into your existing MCP configuration and restart the app.
  3. Confirm the server appears in /mcp in Claude Code or the tools menu in Claude Desktop, then try the small task below.
Claude Code · Add the local server
claude mcp add --transport stdio git -- uvx mcp-server-git --repository "/absolute/path/to/your-test-repo"
Claude Desktop · Local MCP JSON
{
  "mcpServers": {
    "git": {
      "command": "uvx",
      "args": [
        "mcp-server-git",
        "--repository",
        "/absolute/path/to/your-test-repo"
      ]
    }
  }
}
Download configuration

Explain the latest change in a test repository

Ask for the current branch and latest commit summary for one test repository. Compare the branch and commit hash with `git status --short --branch` and `git log -1 --oneline` in your own shell.

Check your configuration and results

The reference server includes tools capable of working-tree changes. Start with status and history queries. Review the selected repository path and scope before asking for staging, commits, or checkout actions.

Claude Code MCP configuration reference

Browse MCP servers