home / mcp / git mcp server

Git MCP Server

MCP server for local git repositories

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "kjozsa-git-mcp": {
      "url": "https://example-mcp-server.local/mcp",
      "headers": {
        "GIT_REPOS_PATH": "/path/to/your/git/repositories"
      }
    }
  }
}

You can manage local Git repositories through a dedicated MCP server that exposes a set of operations for listing repositories, inspecting tags, and manipulating commits and tags. This server runs locally and can be connected to via an MCP client to perform common Git actions in a structured, scriptable way.

How to use

Connect your MCP client to the Git MCP server to access a focused set of Git operations. You can list repositories, inspect the latest tags, view commits since the last tag, create or push tags, and refresh a repository by checking out the main branch and pulling from remotes. Use these endpoints to automate Git workflows in your applications or scripts without invoking Git directly.

How to install

Prerequisites: ensure Node.js and npm or a compatible runtime are installed on your machine. You will also need tooling to run the MCP server (see steps below).

# Option 1: Install via Smithery (automatic client integration)
npx -y @smithery/cli install @kjozsa/git-mcp --client claude
# Option 2: Install manually (manual server setup)
uvx install git-mcp

Additional sections

Configuration is provided as a JSON snippet that defines how to run the Git MCP server and where to locate your repositories.

{
  "mcpServers": {
    "git-mcp": {
      "command": "uvx",
      "args": ["git-mcp"],
      "env": {
        "GIT_REPOS_PATH": "/path/to/your/git/repositories"
      }
    }
  }
}

Troubleshooting

If you encounter issues, verify that the GIT_REPOS_PATH points to an existing directory containing Git repositories. If no tags are found, the repository simply hasn’t created any tags yet.

Available tools

list_repositories

Lists all Git repositories in the configured path.

get_last_git_tag

Finds the last Git tag in the specified repository, returning the tag and its date.

list_commits_since_last_tag

Lists commit messages between the last Git tag and HEAD for a given repository, with an optional maximum count.

create_git_tag

Creates a new Git tag in the specified repository, supporting annotated or lightweight tags.

push_git_tag

Pushes an existing tag to the default remote for the repository.

refresh_repository

Refreshes a repository by checking out the main branch and pulling from all remotes.