Git MCP Server

Anthropic's reference server for local Git operations — read files, search commits, view diffs, and inspect history without API keys.

Language: TypeScript Transport: stdio License: MIT Stars: 15,000 Updated: Feb 2026 Setup: Easy

Client Compatibility

Claude Desktop
Cursor
Claude Code
VS Code
Windsurf
Cline

What It Does

Gives Claude read access to any local Git repository. Search commits, view diffs, read files at specific revisions, inspect branch history, and navigate the repository structure. Pure local operations — no API keys, no network calls, no authentication.

This is distinct from GitHub MCP (which uses the GitHub API for remote operations) and GitLab MCP (which connects to GitLab’s platform). Git MCP works with the repository on your filesystem, regardless of where it’s hosted.

What It Does Well

  • Zero configuration beyond pointing at a repo. No API keys, no tokens, no environment variables, no accounts. Pass the repository path as an argument and Claude has full read access to the Git history. The simplest MCP server in our database category to set up.
  • Actively maintained reference server. Unlike several other Anthropic reference servers that have been archived (Puppeteer, Brave Search, Slack), the Git server remains in the active servers repository. It gets updates alongside the MCP specification itself.
  • Complements rather than competes with GitHub/GitLab MCP. Use Git MCP for local repo inspection (commit history, diffs, file reading) and GitHub/GitLab MCP for platform operations (issues, PRs, CI/CD). They solve different problems and work well together.

What It Doesn’t Do Well

  • Read-only with no write operations. Claude can inspect your repository but can’t create commits, switch branches, or modify files through this server. For write operations you need the Filesystem MCP or a tool like Desktop Commander.
  • Single repository per server instance. Each MCP config entry points to one repository. If you work across multiple repos, you either reconfigure between projects or run multiple instances with different names. Not a dealbreaker, but less flexible than servers that support dynamic repository switching.

Setup Notes

Install is one line. The only decision is which repository path to point at. Pass it as the --repository argument. Claude will have read access to the entire Git history of that repository — all branches, all commits, all files at any revision.

If you’re on Windows, use forward slashes or escaped backslashes in the path.

Config

{
  "mcpServers": {
    "git": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-git",
        "--repository",
        "C:/Projects/your-repo"
      ]
    }
  }
}

Tested With

  • Claude Desktop on Windows 11
Config — paste into your client
{
  "mcpServers": {
    "git-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-git",
        "--repository",
        "C:/path/to/your/repo"
      ]
    }
  }
}

Prerequisites

  • Node.js 18+
  • Git installed locally

View on GitHub · npx -y @modelcontextprotocol/server-git

Reviewed by J-Dub · February 22, 2026

Related Servers