by modelcontextprotocol
A Model Context Protocol server for Git repository interaction and automation.
mcp-server-git is a Model Context Protocol server designed for seamless interaction and automation with Git repositories. It provides a suite of tools that allow users to read, search, and manipulate Git repositories through Large Language Models. The project is currently in early development, with ongoing expansion of its functionalities and tools.
Installation can be done using uv
(recommended) or pip
.
mcp-server-git
using uvx
.pip install mcp-server-git
and run using python -m mcp_server_git
.Configuration for various platforms like Claude Desktop, VS Code, Zed, and Zencoder is provided, detailing how to integrate mcp-server-git
using uvx
, Docker, or pip installations.
The server offers the following Git-related tools:
git_status
: Shows the working tree status.git_diff_unstaged
: Displays unstaged changes in the working directory.git_diff_staged
: Shows changes staged for commit.git_diff
: Compares differences between branches or commits.git_commit
: Records changes to the repository with a commit message.git_add
: Adds file contents to the staging area.git_reset
: Unstages all staged changes.git_log
: Retrieves commit logs with options for maximum count.git_create_branch
: Creates a new branch.git_checkout
: Switches between branches.git_show
: Displays the contents of a specific commit.git_init
: Initializes a new Git repository.git_branch
: Lists local, remote, or all branches with filtering options.npx @modelcontextprotocol/inspector uvx mcp-server-git
. For local development, navigate to the project directory and run npx @modelcontextprotocol/inspector uv run mcp-server-git
. Logs can be monitored via ~/Library/Logs/Claude/mcp*.log
.Local development can be tested using the MCP inspector or by integrating with the Claude desktop app. Docker images can be built using docker build -t mcp/git .
after navigating to the src/git
directory. The repository is available on GitHub at https://github.com/modelcontextprotocol/servers.
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.
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.
git_status
repo_path
(string): Path to Git repositorygit_diff_unstaged
repo_path
(string): Path to Git repositorycontext_lines
(number, optional): Number of context lines to show (default: 3)git_diff_staged
repo_path
(string): Path to Git repositorycontext_lines
(number, optional): Number of context lines to show (default: 3)git_diff
repo_path
(string): Path to Git repositorytarget
(string): Target branch or commit to compare withcontext_lines
(number, optional): Number of context lines to show (default: 3)git_commit
repo_path
(string): Path to Git repositorymessage
(string): Commit messagegit_add
repo_path
(string): Path to Git repositoryfiles
(string[]): Array of file paths to stagegit_reset
repo_path
(string): Path to Git repositorygit_log
repo_path
(string): Path to Git repositorymax_count
(number, optional): Maximum number of commits to show (default: 10)git_create_branch
repo_path
(string): Path to Git repositorybranch_name
(string): Name of the new branchstart_point
(string, optional): Starting point for the new branchgit_checkout
repo_path
(string): Path to Git repositorybranch_name
(string): Name of branch to checkoutgit_show
repo_path
(string): Path to Git repositoryrevision
(string): The revision (commit hash, branch name, tag) to showgit_init
repo_path
(string): Path to directory to initialize git repogit_branch
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 specifiednot_contains
(string, optional): The commit sha that branch should NOT contain. Do not pass anything to this param if no commit sha is specifiedWhen using uv
no specific installation is needed. We will
use uvx
to directly run mcp-server-git.
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
Add this to your claude_desktop_config.json
:
"mcpServers": {
"git": {
"command": "uvx",
"args": ["mcp-server-git", "--repository", "path/to/git/repo"]
}
}
"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"]
}
}
For quick installation, use one of the one-click install buttons below...
For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing Ctrl + Shift + P
and typing Preferences: Open Settings (JSON)
.
Optionally, you can add it to a file called .vscode/mcp.json
in your workspace. This will allow you to share the configuration with others.
Note that the
mcp
key is not needed in the.vscode/mcp.json
file.
{
"mcp": {
"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"
]
}
}
}
}
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"]
}
}
},
Agent Tools
Add Custom MCP
Install
button{
"command": "uvx",
"args": ["mcp-server-git", "--repository", "path/to/git/repo"]
}
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
npx @modelcontextprotocol/inspector uv run mcp-server-git
Running tail -n 20 -f ~/Library/Logs/Claude/mcp*.log
will show the logs from the server and may
help you debug any issues.
If you are doing local development, there are two ways to test your changes:
Run the MCP inspector to test your changes. See Debugging for run instructions.
Test using the Claude desktop app. Add the following to your claude_desktop_config.json
:
{
"mcpServers": {
"git": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"--mount", "type=bind,src=/Users/username/Desktop,dst=/projects/Desktop",
"--mount", "type=bind,src=/path/to/other/allowed/dir,dst=/projects/other/allowed/dir,ro",
"--mount", "type=bind,src=/path/to/file.txt,dst=/projects/path/to/file.txt",
"mcp/git"
]
}
}
}
{
"mcpServers": {
"git": {
"command": "uv",
"args": [
"--directory",
"/<path to mcp-servers>/mcp-servers/src/git",
"run",
"mcp-server-git"
]
}
}
}
Docker build:
cd src/git
docker build -t mcp/git .
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by zed-industries
A high‑performance, multiplayer code editor designed for speed and collaboration.
by modelcontextprotocol
Model Context Protocol Servers
by modelcontextprotocol
A Model Context Protocol server that provides time and timezone conversion capabilities.
by cline
An autonomous coding assistant that can create and edit files, execute terminal commands, and interact with a browser directly from your IDE, operating step‑by‑step with explicit user permission.
by continuedev
Enables faster shipping of code by integrating continuous AI agents across IDEs, terminals, and CI pipelines, offering chat, edit, autocomplete, and customizable agent workflows.
by upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
by GLips
Provides Figma layout and styling information to AI coding agents, enabling one‑shot implementation of designs in any framework.
by idosal
Provides a remote Model Context Protocol server that transforms any public GitHub repository into an up‑to‑date documentation hub, enabling AI assistants to fetch live code and docs, dramatically reducing hallucinations.
by executeautomation
Provides browser automation capabilities using Playwright, enabling language models to interact with web pages, capture screenshots, generate test code, scrape content, and execute JavaScript in a real browser environment.