# Git

> Git is an open-source MCP server for developer tools. MCP server giving AI clients read and write access to local Git repositories. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, Linux, macOS, Windows, Self-hosted
- **Repository:** https://github.com/modelcontextprotocol/servers/tree/HEAD/src/git
- **MCP Registry name:** io.github.modelcontextprotocol/server-git
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-27

## About

Exposes everyday Git operations to an AI client through the Model Context Protocol. A model can inspect a working tree, review staged and unstaged diffs, browse commit history, stage files, create commits, manage branches and merge, all by naming a repository path on each call.

The server runs over stdio by default and can also be started as a standalone HTTP service. Its tools return plain text results, and failed calls report errors the model can read and correct. Two prompts build commit-message and change-summary requests from the current repository state.

It suits developers who want an assistant to work directly with local repositories. Because each call can target any repository the process can reach unless a --repository root is set, it is best run with that flag when the prompts or content are not fully trusted.

## Features

- **Repository status and diffs:** Shows the working tree status and diffs for unstaged changes, staged changes, or between branches, commits and revision ranges.
- **Commit history browsing:** Lists recent commits with hash, author, date and message, with optional date-range filters.
- **Staging and committing:** Stages files, unstages changes and records commits, using the configured Git identity.
- **Branch management:** Lists branches with containment filters, creates branches, switches branches and merges with fast-forward control.
- **Safe remote listing:** Lists remotes while redacting credentials embedded in URLs.
- **Guarded execution:** Blocks repository hooks, external diff and filter programs, and optional --repository confinement limits which repositories are used.

## Good for

- Asking an AI assistant to review unstaged or staged changes before a commit
- Drafting commit messages from the currently staged diff
- Summarizing what changed on a branch compared with another branch or commit
- Searching recent history for commits within a date range
- Creating a feature branch and staging a set of files from an assistant session

## Install

### Claude Code: Add with the CLI (Terminal)

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

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

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

### Claude Desktop (claude_desktop_config.json)

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

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

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

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

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

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add server-git -- uvx mcp-server-git
```

### Codex: Or add to config.toml (~/.codex/config.toml)

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

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

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

Or run: gemini mcp add -s user server-git uvx -- mcp-server-git

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

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

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

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

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

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

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

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

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

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

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

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

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

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

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

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

## Tools

From the tool list in its README, going by the names, 4 of 14 tools change data; 8 names don't say. From the server's own tool labels and tool names; not verified by us.

- `git_status` (name suggests: reads): 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, or across a revision range
- `git_commit` (name suggests: changes): Records changes to the repository
- `git_add` (name suggests: changes): Adds file contents to the staging area
- `git_reset`: Unstages all staged changes
- `git_log`: Shows the commit log, newest commit first
- `git_create_branch` (name suggests: changes): Creates a new branch
- `git_checkout`: Switches branches
- `git_merge` (name suggests: changes): Merges a branch into the current branch, or changes nothing
- `git_show` (name suggests: reads): Shows the contents of a commit, or of a file or directory at a revision
- `git_branch`: List Git branches
- `git_remote`: Lists the repository's remotes with their fetch and push URLs

## FAQ

### How do I install Git?

Run it with uvx mcp-server-git or install the mcp-server-git package with pip and start it with python -m mcp_server_git.

### Can Git confine access to one repository?

Yes. Passing --repository limits tool calls to that Git repository, including any repository it sits inside. Without it, the server can access any repository the process can reach.

### Which Git identity is used for commits?

It uses the GIT_AUTHOR and GIT_COMMITTER variables if set, otherwise user.name and user.email from Git config, falling back to the operating-system user.

### Does Git support a remote HTTP transport?

Yes. With --transport streamable-http it runs as an HTTP service on 127.0.0.1:3001 by default, configurable with HOST and PORT.

### Is Git free?

Yes. Git is open source, so you can use and self-host it for free.

### How do I add Git to Claude Code?

Run this command in your terminal: claude mcp add server-git -- uvx mcp-server-git

### What are the best alternatives to Git?

The closest alternatives to Git are Git, Git MCP, MCP Git Enhanced, GitHub-AI-MCP and Git Enhanced.

## Where this comes from

- Description: written from the project's README and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Git](https://ai-powered.com/mcp/git-2): Git is an open-source MCP server for developer tools.
- [Git MCP](https://ai-powered.com/mcp/git-mcp): Git MCP is an open-source MCP server for developer tools.
- [MCP Git Enhanced](https://ai-powered.com/mcp/mcp-git-enhanced): MCP Git Enhanced is an open-source MCP server for developer tools.
- [GitHub-AI-MCP](https://ai-powered.com/mcp/github-ai-mcp): GitHub-AI-MCP is an open-source MCP server for developer tools.
- [Git Enhanced](https://ai-powered.com/mcp/git-enhanced): Git Enhanced is an open-source MCP server for developer tools.
- [Git History](https://ai-powered.com/mcp/git-history): Git History is an open-source MCP server for developer tools.
- [Git Summary](https://ai-powered.com/mcp/git-summary): Git Summary is an open-source MCP server for developer tools.
- [GitHub](https://ai-powered.com/mcp/github-5): GitHub is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/git-4
