Git MCP Server

Developmentstdiov2026.1.26
Repository

Reference MCP server for Git repository operations. Provides tools to read, search, and manipulate Git repositories including viewing commit history, diffs, branches, file contents at specific revisions, and repository status. Enables AI agents to understand code changes and navigate version history without direct filesystem access.

Connect

Add this configuration to .claude/mcp.json

{
  "mcpServers": {
    "git": {
      "command": "uvx",
      "args": [
        "mcp-server-git",
        "--repository",
        "."
      ]
    }
  }
}

Tools (4)

git_log

Show commit history for the repository with messages, authors, and dates.

{
  "type": "object",
  "required": [
    "repo_path"
  ],
  "properties": {
    "branch": {
      "type": "string",
      "description": "Branch name (default current branch)"
    },
    "max_count": {
      "type": "integer",
      "description": "Maximum number of commits to return (default 10)"
    },
    "repo_path": {
      "type": "string",
      "description": "Path to the Git repository"
    }
  }
}

git_diff

Show changes between commits, branches, or working directory.

{
  "type": "object",
  "required": [
    "repo_path"
  ],
  "properties": {
    "target": {
      "type": "string",
      "description": "Commit hash, branch name, or range (e.g. HEAD~3..HEAD)"
    },
    "repo_path": {
      "type": "string",
      "description": "Path to the Git repository"
    }
  }
}

git_status

Show the working tree status including staged, modified, and untracked files.

{
  "type": "object",
  "required": [
    "repo_path"
  ],
  "properties": {
    "repo_path": {
      "type": "string",
      "description": "Path to the Git repository"
    }
  }
}

git_show

Show the contents of a file at a specific commit or branch.

{
  "type": "object",
  "required": [
    "repo_path",
    "path"
  ],
  "properties": {
    "path": {
      "type": "string",
      "description": "File path within the repository"
    },
    "revision": {
      "type": "string",
      "description": "Commit hash or branch name"
    },
    "repo_path": {
      "type": "string",
      "description": "Path to the Git repository"
    }
  }
}

Resources

This server does not expose any resources.

Prompts

This server does not expose any prompts.

Server Information

Author
Anthropic (@modelcontextprotocol)
Repository
https://github.com/modelcontextprotocol/servers
License
Apache-2.0
Version
2026.1.26
Stars
86,206
Last Updated
January 27, 2026