Git

mcp git tool, implementation with python
  • python

0

GitHub Stars

python

Language

7 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "martinsky999-mcp-git-py": {
      "command": "uvx",
      "args": [
        "mcp-server-git"
      ]
    }
  }
}

You can read, search, and manipulate Git repositories through a dedicated MCP server. This server exposes a set of tools that let you inspect a repo, view changes, create commits, and switch branches, all guided by large language models for automation and workflow simplification.

How to use

Connect to the MCP server from your MCP client and call the available tools to inspect and operate on Git repositories. You can check the working tree status, view diffs, inspect logs, and manage branches and commits. Use the tools to power automated workflows, such as summarizing changes, validating commits, or generating release notes based on repository history.

How to install

Prerequisites: you need Python if you install via package, or you can run the server directly with UVX without a local install. You also need a Git repository you want to manage or a remote server where you will run the MCP server.

# Option 1: Run via UVX (recommended, no local install required)
uvx mcp-server-git

# If you are running a local repository, you can point to it with an argument or environment variable as needed by your setup.

Option 2: Install via Python package and run the server as a module. This requires Python and pip.

pip install mcp-server-git

# Run the server
python -m mcp_server_git --repository path/to/git/repo

Option 3: Run via Docker (deploys the MCP server in a container). This approach is useful for isolating dependencies and sharing a reproducible environment.

docker run --rm -i \
  --mount type=bind,src=/Users/username,dst=/Users/username \
  mcp/git

Configuration

Configure how you run and connect to the MCP server from your client. Examples below show common ways to integrate the server into your environment.

{
  "mcp": {
    "servers": {
      "git": {
        "command": "uvx",
        "args": ["mcp-server-git"]
      }
    }
  }
}

Docker-based deployment example for integration into your tooling.

{
  "mcp": {
    "servers": {
      "git": {
        "command": "docker",
        "args": [
          "run",
          "--rm",
          "-i",
          "--mount", "type=bind,src=/Users/username,dst=/Users/username",
          "mcp/git"
        ]
      }
    }
  }
}

Python package-based deployment example with a repository path.

{
  "mcp": {
    "servers": {
      "git": {
        "command": "python",
        "args": ["-m", "mcp_server_git", "--repository", "path/to/git/repo"]
      }
    }
  }
}

Notes on usage and capabilities

The server provides tools to check status, view unstaged and staged diffs, compare diffs between branches or commits, commit changes, add files to the staging area, reset changes, view log history, create and switch branches, show commit contents, and initialize a repository. These capabilities enable automated workflows that analyze code changes, perform audits before committing, and summarize repository history for release notes.

Troubleshooting and tips

If you encounter issues, check the container or process logs for errors, ensure the repository path is accessible to the MCP server, and verify that the correct command and arguments are being used for your deployment method. Common problems include missing repository paths in the startup command or insufficient permissions to access the repository.

Security and maintenance

Only expose the MCP server to trusted clients, and restrict access to the host system paths used by the repository. Regularly update to the latest MCP server version to benefit from improvements and security fixes.

Available tools

git_status

Shows the working tree status for the repository.

git_diff_unstaged

Shows changes in the working directory that are not yet staged.

git_diff_staged

Shows changes staged for commit.

git_diff

Shows differences between the current state and a target branch or commit.

git_commit

Records changes to the repository with a commit message.

git_add

Adds file contents to the staging area.

git_reset

Unstages all staged changes.

git_log

Shows the commit logs with author, date, and message.

git_create_branch

Creates a new branch.

git_checkout

Switches branches.

git_show

Shows the contents of a commit.

git_init

Initializes a Git repository.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational