Home / MCP / Git MCP Server

Git MCP Server

Provides tools to read, compare, and modify Git repositories via MCP with local or containerized execution

other
74.1kstars
Installation
Add the following to your MCP client configuration file.

Configuration

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

You can interact with Git repositories through this MCP server to read, search, and manipulate code using large language models. It exposes a set of Git-focused tools that let you inspect status, view diffs, commit changes, manage branches, and more, all via MCP client requests.

How to use

Connect to the MCP server from your MCP client and choose the Git MCP server configuration that matches how you want to run it. You can perform operations like checking the working tree status, viewing diffs for unstaged or staged changes, creating and switching branches, and inspecting commit history. Use the available tools to read repository state, apply changes, and verify results before finalizing commits.

How to install

Choose an execution method that fits your environment. The server can be run locally using UVX, Python, or Docker.

Additional notes

The MCP server provides a range of tools designed for Git repository interaction and automation. When configuring your client, you can point to a local repository and execute common Git operations through these endpoints. For debugging, you can inspect server logs or use debugging utilities to verify behavior during development and integration.

Available tools

git_status

Shows the working tree status for the repository at the given path.

git_diff_unstaged

Displays changes in the working directory that have not yet been staged, with optional context lines.

git_diff_staged

Shows changes that have been staged for commit, with optional context lines.

git_diff

Compares differences between the current state and a target branch or commit, with optional context lines.

git_commit

Records changes to the repository with a commit message and returns the new commit hash.

git_add

Adds specified files to the staging area for the next commit.

git_reset

Unstages all changes that have been staged.

git_log

Shows commit logs with optional filtering by count and timestamps.

git_create_branch

Creates a new branch from a base branch or the current branch.

git_checkout

Switches the working tree to the specified branch.

git_show

Shows the contents of a specific commit revision.

git_branch

Lists local, remote, or all branches with optional constraints on contained commits.