Registry / llm-agents / mcp-server-git

mcp-server-git

JSON →
library2026.8.18pypypi✓ verified 22d ago

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.

pip install mcp-server-git
INSTALL
IMPORT
SIG · MCP-SERVER-GIT
M
mcp-server-git
llm-agentspythonv2026.8.18
Install
6.3s avg
Import
Disk
59MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2026.8.18 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 7.8s
py 3.11
✓ —
✓ 6.5s
py 3.12
✓ —
✓ 5.3s
py 3.13
✓ —
✓ 5.4s
py 3.9
✕ build_error
✕ build_error
59MB installed
● package 59MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mcp-server-git
The library is primarily a server process, not intended for direct programmatic import by end-user applications for its core functionality. It is run as a standalone service.
Users typically run 'mcp-server-git' as a command-line tool or through an MCP host configuration, rather than importing classes from it for direct Python application logic.

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" } ] }
mcp-server-git --version
Debug
Known issues
breakingThe `git_init` tool was removed due to a path traversal vulnerability. The server is now intended to operate exclusively on *existing* Git repositories, not to initialize new ones at arbitrary filesystem locations.
fix
Upgrade to version 2025.9.25 or later. Do not rely on `mcp-server-git` to initialize new repositories; create them separately.
affects: <2025.9.25
breakingArgument injection vulnerabilities were present in `git_diff` and `git_checkout` functions, allowing user-controlled arguments to be interpreted as CLI options, potentially leading to arbitrary file overwrites.
fix
Upgrade to version 2025.12.18 or later. The fix adds validation to reject flag-like arguments and ensures arguments resolve to valid Git refs.
affects: <2025.12.18
gotchaPath traversal vulnerability in `git_add` allowed staging files outside the designated repository boundaries using relative paths (e.g., `../`). This could enable exfiltration of sensitive files via subsequent Git operations.
fix
Upgrade to version 2026.1.14 or later. This version includes boundary checks to prevent `git_add` from staging files outside the repository's working tree.
affects: <2026.1.14
gotchaMissing path validation when the server was started with the `--repository` flag. This allowed tool calls to operate on repositories outside the explicitly configured path.
fix
Upgrade to version 2025.12.18 or later. The fix adds path validation to ensure all operations are restricted to the configured repository path.
affects: <2025.12.18
gotchaThe library is explicitly stated to be in 'early development', meaning functionality and available tools are subject to frequent change and expansion.
fix
Anticipate potential API changes and breaking updates. Regularly review release notes and test against new versions.
affects: All versions
Upgrade
Version history
2026.8.18latest on PyPI · released Aug 18, 2026
Audit
Dependencies
clickrequiredCommand-line interface toolkit
pydanticrequiredData validation and settings management
mcprequiredCore Model Context Protocol SDK
gitpythonrequiredPython library for Git interaction
Agent activity
15 hits · last 30 days
node
12
OpenAI (training)
1
Resources
mcp-server-git — pip install mcp-server-git · libregistry