ClaudeCodeMod

All shelves / MCP servers

Git

modelcontextprotocol/servers · 85.8k stars · TypeScript

MCP server A Model Context Protocol server for Git repository interaction and automation. This server provides tools to read, search, and manipulate Git repositories via Large Language Models.

Install

In your shell
pip install mcp-server-git

These repos do not share one command. When an entry shows a command, it was copied as published. Check the repo's README before you run it.

Open the repo

Files

src/git/README.md

mcp-server-git: A git MCP server

Overview

A Model Context Protocol server for Git repository interaction and automation. This server provides tools to read, search, and manipulate Git repositories via Large Language Models.

Source: https://github.com/modelcontextprotocol/servers/tree/main/src/git

Requires MCP Python SDK 1.x (mcp>=1.29.0,<2). SDK 2.0 renamed APIs this server uses. The port to v2 is in progress.

Please note that mcp-server-git is currently in early development. The functionality and available tools are subject to change and expansion as we continue to develop and improve the server.

Tools

  1. git_status
  • Shows the working tree status
  • Input:
  • repo_path (string): Path to Git repository
  • Returns: Current status of working directory as text output
  1. git_diff_unstaged
  • Shows changes in working directory not yet staged
  • Inputs:
  • repo_path (string): Path to Git repository
  • context_lines (number, optional): Number of context lines to show (default: 3)
  • Returns: Diff output of unstaged changes
  1. git_diff_staged
  • Shows changes that are staged for commit
  • Inputs:
  • repo_path (string): Path to Git repository
  • context_lines (number, optional): Number of context lines to show (default: 3)
  • Returns: Diff output of staged changes
  1. git_diff
  • Shows differences between branches or commits
  • Inputs:
  • repo_path (string): Path to Git repository
  • target (string): Target branch or commit to compare with
  • context_lines (number, optional): Number of context lines to show (default: 3)
  • Returns: Diff output comparing current state with target
  1. git_commit
  • Records changes to the repository
  • Inputs:
  • repo_path (string): Path to Git repository
  • message (string): Commit message
  • Returns: Confirmation with new commit hash
  1. git_add
  • Adds file contents to the staging area
  • Inputs:
  • repo_path (string): Path to Git repository
  • files (string[]): Array of file paths to stage
  • Returns: Confirmation of staged files
  1. git_reset
  • Unstages all staged changes
  • Input:
  • repo_path (string): Path to Git repository
  • Returns: Confirmation of reset operation
  1. git_log
  • Shows the commit logs with optional date filtering
  • Inputs:
  • repo_path (string): Path to Git repository
  • max_count (number, optional): Maximum number of commits to show (default: 10)
  • start_timestamp (string, optional): Start timestamp for filtering commits. Accepts ISO 8601 format (e.g., '2024-01-15T14:30:25'), relative dates (e.g., '2 weeks ago', 'yesterday'), or absolute dates (e.g., '2024-01-15', 'Jan 15 2024')
  • end_timestamp (string, optional): End timestamp for filtering commits. Accepts ISO 8601 format (e.g., '2024-01-15T14:30:25'), relative dates (e.g., '2 weeks ago', 'yesterday'), or absolute dates (e.g., '2024-01-15', 'Jan 15 2024')
  • Returns: Array of commit entries with hash, author, date, and message
  1. git_create_branch
  • Creates a new branch
  • Inputs:
  • repo_path (string): Path to Git repository
  • branch_name (string): Name of the new branch
  • base_branch (string, optional): Base branch to create from (defaults to current branch)
  • Returns: Confirmation of branch creation
  1. git_checkout
  • Switches branches
  • Inputs:
  • repo_path (string): Path to Git repository
  • branch_name (string): Name of branch to checkout
  • Returns: Confirmation of branch switch
  1. git_show
  • Shows the contents of a commit
  • Inputs:
  • repo_path (string): Path to Git repository
  • revision (string): The revision (commit hash, branch name, tag) to show
  • Returns: Contents of the specified commit
  1. git_branch
  • List Git branches
  • Inputs:
  • repo_path (string): Path to the Git repository.
  • branch_type (string): Whether to list local branches ('local'), remote branches ('remote') or all branches('all').
  • contains (string, optional): The commit sha that branch should contain. Do not pass anything to this param if no commit sha is specified
  • not_contains (string, optional): The commit sha that branch should NOT contain. Do not pass anything to this param if no commit sha is specified
  • Returns: List of branches

Installation

Using uv (recommended)

When using uv no specific installation is needed. We will use uvx to directly run mcp-server-git.

Using PIP

Alternatively you can install mcp-server-git via pip:

pip install mcp-server-git

After installation, you can run it as a script using:

python -m mcp_server_git

Configuration

Usage with Claude Desktop

Add this to your claude_desktop_config.json:

"mcpServers": {
  "git": {
    "command": "uvx",
    "args": ["mcp-server-git", "--repository", "path/to/git/repo"]
  }
}
  • Note: replace '/Users/username' with a path that you want to be accessible by this tool
"mcpServers": {
  "git": {
    "command": "docker",
    "args": ["run", "--rm", "-i", "--mount", "type=bind,src=/Users/username,dst=/Users/username", "mcp/git"]
  }
}
"mcpServers": {
  "git": {
    "command": "python",
    "args": ["-m", "mcp_server_git", "--repository", "path/to/git/repo"]
  }
}

Usage with VS Code

For quick installation, use one of the one-click install buttons below...

For manual installation, you can configure the MCP server using one of these methods:

Method 1: User Configuration (Recommended) Add the configuration to your user-level MCP configuration file. Open the Command Palette (Ctrl + Shift + P) and run MCP: Open User Configuration. This will open your user mcp.json file where you can add the server configuration.

Method 2: Workspace Configuration Alternatively, you can add the configuration to a file called .vscode/mcp.json in your workspace. This will allow you to share the configuration with others.

For more details about MCP configuration in VS Code, see the official VS Code MCP documentation.

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

For Docker installation:

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

Usage with Zed

Add to your Zed settings.json:

"context_servers": [
  "mcp-server-git": {
    "command": {
      "path": "uvx",
      "args": ["mcp-server-git"]
    }
  }
],
"context_servers": {
  "mcp-server-git": {
    "command": {
      "path": "python",
      "args": ["-m", "mcp_server_git"]
    }
  }
},

Usage with Zencoder

  1. Go to the Zencoder menu (...)
  2. From the dropdown menu, select Agent Tools
  3. Click on the Add Custom MCP
  4. Add the name (i.e. git) and server configuration from below, and make sure to hit the Install button
{
    "command": "uvx",
    "args": ["mcp-server-git", "--repository", "path/to/git/repo"]
}

Debugging

You can use the MCP inspector to debug the server. For uvx installations:

npx @modelcontextprotocol/inspector uvx mcp-server-git

Or if you've installed the package in a specific directory or are developing on it:

cd path/to/servers/src/git

Facts

Kind
MCP server
Repo
modelcontextprotocol/servers
Group
Uncategorized
Stars
85.8k
Language
TypeScript
Last push
2026-10-07
Forks
11,769
Homepage
modelcontextprotocol.io

More on this shelf

  1. 1Everythingmodelcontextprotocol/serversThis MCP server attempts to exercise all the features of the MCP protocol. It is not intended to be a useful server, but rather a test server for builders of MCP clients. It implements prompts, tools, resources, sampling, and more to showcase MCP capabilities.85.8k
  2. 2Fetchmodelcontextprotocol/serversA Model Context Protocol server that provides web content fetching capabilities. This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.85.8k
  3. 3Memorymodelcontextprotocol/serversA basic implementation of persistent memory using a local knowledge graph. This lets Claude remember information about the user across chats.85.8k
  4. 4Sequential Thinkingmodelcontextprotocol/serversAn MCP server implementation that provides a tool for dynamic and reflective problem-solving through a structured thinking process.85.8k
  5. 5Timemodelcontextprotocol/serversA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.85.8k
  6. 6Netdataio.github.netdata/mcp-serverReal-time infrastructure monitoring with metrics, logs, alerts, and ML-based anomaly detection.79.1k