# Git (Reference)

Git (Reference) is an MCP server for Claude Code that lets an agent inspect and change Git repositories. It handles diffs, branches, history, staging, and commits.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 92149 repo stars
- Author: modelcontextprotocol
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/modelcontextprotocol/servers/tree/HEAD/src/git
- Updated: 2026-10-25
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/git-reference

## What it does

Git (Reference) exposes typed tools for repository work through MCP. An agent can read the working-tree status, inspect staged or unstaged changes, compare the current state with a branch or commit, view a revision, and retrieve commit history with date filters.

The server also handles repository changes: staging files, clearing the index, creating branches, switching revisions, and recording commits. Calls use `repo_path`; `git_add` takes a non-empty file list, while `git_branch` requires `local`, `remote`, or `all` as the branch type.

Running it requires MCP Python SDK `2.x` under the constraint `mcp>=2.3,<3`. The pip route installs `mcp-server-git`, then starts it with `python -m mcp_server_git`. Without that SDK version range, the server will not run.

## Requirements
- Needs: Docker

## Install

### Claude Code (native platform)

**Install**
- The MCP registry has no launch command for it: see the repository README

## When to use it
- inspect a repository’s working-tree state
- review staged and unstaged diffs
- compare a checkout with a branch or commit
- filter commit history by time
- create a branch and record staged changes

## Example prompts
- Inspect the repository at `repo_path` and explain the current working-tree status.
- Compare the current checkout with `main`, then summarize the resulting diff.
- Create branch `feature/login`, stage `src/login.ts` and `tests/login.test.ts`, and commit them with message `Add login flow`.

## Similar
- [git-notes](https://affpapa.org/en/nevibecode/skills/git-notes.md) — skill · 1200 installs
- [git-workflow](https://affpapa.org/en/nevibecode/skills/bobmatnyc-git-workflow.md) — skill · 574 installs
- [here-be-git](https://affpapa.org/en/nevibecode/skills/here-be-git.md) — skill · 535 installs
- [git-rebase](https://affpapa.org/en/nevibecode/skills/git-rebase.md) — skill · 401 installs
- [git-submodule](https://affpapa.org/en/nevibecode/skills/git-submodule.md) — skill · 368 installs
- [atxp-git](https://affpapa.org/en/nevibecode/skills/atxp-git.md) — skill · 281 installs

From the same set: [modelcontextprotocol/servers](https://affpapa.org/en/nevibecode/by/modelcontextprotocol/servers.md) — 19 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
