What it is
mcp-server-git is a Model Context Protocol server for Git repository interaction and automation. It exposes 12 tools that let Large Language Models read, search and manipulate Git repositories. The README notes it is in early development, so its functionality and tools are subject to change and expansion.
Who it's for
- Developers who want an LLM client such as Claude Desktop, VS Code, Zed or Zencoder to inspect and modify Git repositories
- Developers who want to automate Git operations like staging, committing and branching through an MCP-enabled assistant
- Contributors who want to debug or extend an MCP server using the MCP inspector
Requirements
Requirements
- MCP Python SDK 1.x (
mcp>=1.29.0,<2); SDK 2.0 renamed APIs this server uses and the port to v2 is in progress uv/uvx(recommended), or pip, or Docker to run the server- An MCP-capable client such as Claude Desktop, VS Code, Zed or Zencoder
Setup
Run with uvx (recommended)
When using uv no specific installation is needed; uvx runs mcp-server-git directly. Add this to your claude_desktop_config.json for Claude Desktop.
json"mcpServers": { "git": { "command": "uvx", "args": ["mcp-server-git", "--repository", "path/to/git/repo"] } }Install via pip
Alternatively, install the package with pip.
bashpip install mcp-server-gitRun the pip-installed server as a script
After installing with pip, run it as a module.
bashpython -m mcp_server_gitRun with Docker (Claude Desktop)
Replace '/Users/username' with a path that you want to be accessible by this tool.
json"mcpServers": { "git": { "command": "docker", "args": ["run", "--rm", "-i", "--mount", "type=bind,src=/Users/username,dst=/Users/username", "mcp/git"] } }Configure for VS Code (uvx)
Add to your user mcp.json (via
MCP: Open User Configuration) or to.vscode/mcp.jsonin your workspace.json{ "servers": { "git": { "command": "uvx", "args": ["mcp-server-git"] } } }Build the Docker image
Build the image locally from the repository.
bashcd src/git docker build -t mcp/git .
Examples
Debug with the MCP inspector (uvx)
bashnpx @modelcontextprotocol/inspector uvx mcp-server-gitWhat it does: Launches the MCP inspector against a uvx installation to test and debug the server.
Debug a local development checkout
bashcd path/to/servers/src/git
npx @modelcontextprotocol/inspector uv run mcp-server-gitWhat it does: Runs the inspector against the package in a specific directory when developing on it.
Check server logs
bashtail -n 20 -f ~/Library/Logs/Claude/mcp*.logWhat it does: Shows logs from the server, which may help debug issues when used with Claude Desktop.
Filter commit history by date
PromptUse git_log on path/to/git/repo with max_count 10 and start_timestamp '2 weeks ago' to show recent commits.Expected output: git_log accepts max_count and start_timestamp/end_timestamp, which can be ISO 8601, relative (e.g. '2 weeks ago', 'yesterday') or absolute dates.
Pros & cons
Pros
- Pro:Covers a full basic Git workflow: status, diffs, add, reset, commit, log, show, branch listing, branch creation and checkout
- Pro:git_log supports date filtering with ISO 8601, relative and absolute date formats
- Pro:Multiple run options (uvx, pip, Docker) with documented configs for Claude Desktop, VS Code, Zed and Zencoder
- Pro:MIT licensed, with MCP inspector support for debugging
Cons
- Con:Described as in early development; functionality and tools are subject to change
- Con:Requires MCP Python SDK 1.x (
mcp>=1.29.0,<2); the port to SDK 2.0 is still in progress - Con:The tool list documents no push, pull or merge operations
Images
