Model Context Protocol Git Server

2026.1.14 · active · verified Sat Apr 11

mcp-server-git is a Model Context Protocol (MCP) server designed to enable Large Language Models (LLMs) and AI agents to interact with Git repositories programmatically. It provides tools for reading, searching, and manipulating Git repositories. As of version 2026.1.14, it is actively developed, though still in early stages, with frequent updates often addressing security and functionality enhancements.

Warnings

Install

Imports

Quickstart

To use `mcp-server-git`, install it and then run it as a server process, typically from within a Git repository you wish to expose. MCP clients (like VS Code or Claude Desktop) are then configured to connect to this running server. The example above shows how to run the server from the command line and a typical JSON configuration snippet for an MCP client to establish the connection and provide a repository context.

# Start the mcp-server-git in a Git repository context
# (Replace /path/to/your/git/repo with an actual Git repository path)
cd /path/to/your/git/repo
mcp-server-git

# Example MCP client configuration (e.g., for VS Code .vscode/mcp.json or user mcp.json)
# This tells an MCP-compatible client how to connect to the server.
# Note: The 'command' path might need to be absolute depending on your environment.
{
  "servers": {
    "git": {
      "command": "mcp-server-git",
      "args": [],
      "env": {
        "GIT_DEFAULT_PATH": "${input:git_repo_path}"
      }
    }
  },
  "inputs": [
    {
      "type": "promptString",
      "id": "git_repo_path",
      "description": "Path to Git Repository",
      "default": "/path/to/your/git/repo"
    }
  ]
}

view raw JSON →