# Git [Verified] [Health: Active]

**Category:** 🔄 Version Control  
**Repository:** https://github.com/modelcontextprotocol/servers/tree/main/src/git  
**GitHub Stars:** 91814  
**Views:** 69  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/git

## Description
Tools to read, search, and manipulate Git repositories.

## Tools
Capabilities this server exposes over MCP:

- **repo_path**
- **context_lines**
- **target**
- **message**
- **MERGE_HEAD**
- **HEAD**
- **files**
- **max_count**
- **start_timestamp**
- **end_timestamp**
- **branch_name**
- **base_branch**
- **revision**
- **branch_type**
- **contains**
- **not_contains**

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "git": {
    "command": "uvx",
    "args": ["installations"]
  }
}
```

## Documentation

## What Git does

Git MCP server gives an MCP client tools for reading, searching, and modifying Git repositories. Read operations cover working-tree status, unstaged and staged diffs, comparisons against a branch or commit, commit history, branch listings, and the contents of commits, files, or directories at a revision.

Write operations include staging selected paths, unstaging all staged changes, creating commits, creating branches, and switching branches. Commit calls require staged changes unless a merge is in progress and Git permits an empty merge commit. Branch listings can be limited to local, remote, or all branches and can filter by whether a commit is contained.

## How it works

The server communicates over stdio and uses the MCP Python SDK 2.x. Each operation is exposed as a typed tool whose inputs are derived from its Python function signature. Tools generally take `repo_path`; comparison, history, branch, and revision operations add parameters suited to the requested Git query.

Diff tools accept an optional context-line count. Log queries can limit the number of commits and filter by start or end timestamps using ISO 8601, relative, or absolute date expressions. Branch creation can start from the current branch, a tag, another branch, or a commit. Checkout accepts a branch name or another revision, including a commit or tag.

Tool failures are returned as MCP error results with text describing the failed operation, allowing the calling model to adjust its request. Invalid repository paths, Git command failures, schema mismatches, and guarded arguments are handled this way.

## Setup and configuration

With uv, run the package directly through `uvx`:

```text
uvx mcp-server-git --repository path/to/git/repo
```

Alternatively, install the package with pip and start it as a Python module:

```text
pip install mcp-server-git
python -m mcp_server_git
```

The optional `--repository` or `-r` setting confines tool calls to the enclosing Git repository. The supplied path may be a subdirectory; startup resolves it to the repository root. Each tool's `repo_path` must remain inside that repository. This restriction also checks Git metadata such as linked worktrees, `commondir`, and `core.worktree` paths.

Without `--repository`, calls can read or write any Git repository reachable by the server process, including for operations that change files or history. Use the option when prompts or other input cannot be fully trusted.

Claude Desktop can launch the server with a stdio entry using `uvx`, for example:

```json
{
  "mcpServers": {
    "git": {
      "command": "uvx",
      "args": ["mcp-server-git", "--repository", "path/to/git/repo"]
    }
  }
}
```

## Tools and capabilities

- Inspect working-tree status with `git_status`.
- Review staged, unstaged, or target-based differences with the diff tools.
- Stage paths, unstage changes, and create commits.
- Read commit history with count and date filters.
- Create branches from branches, tags, or commits.
- Check out branches or other revisions.
- Show a commit, file, or directory at a specified revision.
- List local, remote, or all branches with optional commit-containment filters.

## Limitations and notes

The server is in early development, so its tools and behavior may change. It does not request client Roots; repository access is controlled by `--repository` and by each call's `repo_path`. A path inside the configured repository grants access across that repository rather than only beneath the named subdirectory.

_Full upstream README: https://allmcps.com/mcp/git/readme_

