# Git MCP server

Read, search and manipulate Git repositories: inspect history and diffs, stage changes and commit from the conversation.

## At a glance

Git is the official MCP reference server in the Dev Tools & Git category. It runs locally over stdio via `uvx mcp-server-git`, and declares no required credentials. It exposes 12 tools, including git_status, git_diff_unstaged and git_diff_staged. It scores A (93/100) on the MCP Skills Hub health score as of Oct 28, 2026.

## Install

### How to install Git in Claude Code

1. Add the server

```bash
claude mcp add git -- uvx mcp-server-git
```

2. Verify it's connected

```bash
claude mcp list
```

3. Sharing it with your team?

   Add `--scope project` to write it to .mcp.json in the repository root, which you can commit (with the secrets left as environment variables).

4. Use it in a session

   Ask Claude to use the tools this server exposes (e.g. git_status, git_diff_unstaged, git_diff_staged). It discovers them automatically.

### How to install Git in Claude Desktop

1. Open your MCP config

   macOS: ~/Library/Application Support/Claude/claude_desktop_config.json · Windows: %APPDATA%\Claude\claude_desktop_config.json

2. Add this server

```json
{
  "mcpServers": {
    "git": {
      "command": "uvx",
      "args": [
        "mcp-server-git"
      ]
    }
  }
}
```

3. Restart Claude Desktop

   The tools appear under the 🔌 menu once the app reloads.

### How to install Git in Cursor

1. Create / edit .cursor/mcp.json in your project

```json
{
  "mcpServers": {
    "git": {
      "command": "uvx",
      "args": [
        "mcp-server-git"
      ]
    }
  }
}
```

2. Enable it

   Cursor Settings → MCP → toggle the server on. Tools become available to the Composer/Agent.

### How to install Git in Codex CLI

1. Add to ~/.codex/config.toml

```toml
[mcp_servers.git]
command = "uvx"
args = ["mcp-server-git"]
```

2. Run Codex

   Codex loads MCP servers from config.toml on startup and exposes their tools to the agent.

### How to install Git in Windsurf

1. Edit ~/.codeium/windsurf/mcp_config.json

```json
{
  "mcpServers": {
    "git": {
      "command": "uvx",
      "args": [
        "mcp-server-git"
      ]
    }
  }
}
```

2. Reload

   Windsurf → Cascade → refresh MCP servers. Cascade can now call the tools.

### How to install Git in Cline

1. Open Cline → MCP Servers → Configure

   Adds to cline_mcp_settings.json.

2. Add the server

```json
{
  "mcpServers": {
    "git": {
      "command": "uvx",
      "args": [
        "mcp-server-git"
      ]
    }
  }
}
```

### How to install Git in VS Code

1. Create .vscode/mcp.json

```json
{
  "servers": {
    "git": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mcp-server-git"
      ]
    }
  }
}
```

2. Start it

   VS Code shows a ▶ Start action above the server entry. Agent mode (Copilot Chat) can then use the tools.

## Tools

- `git_status` — Shows the working tree status
- `git_diff_unstaged` — Shows changes in working directory not yet staged
- `git_diff_staged` — Shows changes that are staged for commit
- `git_diff` — Shows differences between branches or commits
- `git_commit` — Records changes to the repository
- `git_add` — Adds file contents to the staging area
- `git_reset` — Unstages all staged changes
- `git_log` — Shows the commit logs with optional date filtering
- `git_create_branch` — Creates a new branch
- `git_checkout` — Switches branches
- `git_show` — Shows the contents of a commit, or of a file or directory at a revision
- `git_branch` — List Git branches

Source repository: https://github.com/modelcontextprotocol/servers

---

Source: https://mcp-skills-hub.vercel.app/mcps/official-git · MCP Skills Hub · data as of 2026-10-28T12:31:05Z
