MCP Git Server
Provides tools to read, search, and manipulate Git repositories, enabling operations like viewing status, creating commits, managing branches, staging files, viewing repository history, and initializing repositories.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Git Server show me the git status of my project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
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
git_statusShows the working tree status
Input:
repo_path(string): Path to Git repository
Returns: Current status of working directory as text output
git_diff_unstagedShows changes in working directory not yet staged
Input:
repo_path(string): Path to Git repository
Returns: Diff output of unstaged changes
git_diff_stagedShows changes that are staged for commit
Input:
repo_path(string): Path to Git repository
Returns: Diff output of staged changes
git_diffShows differences between branches or commits
Inputs:
repo_path(string): Path to Git repositorytarget(string): Target branch or commit to compare with
Returns: Diff output comparing current state with target
git_commitRecords changes to the repository
Inputs:
repo_path(string): Path to Git repositorymessage(string): Commit message
Returns: Confirmation with new commit hash
git_addAdds file contents to the staging area
Inputs:
repo_path(string): Path to Git repositoryfiles(string[]): Array of file paths to stage
Returns: Confirmation of staged files
git_resetUnstages all staged changes
Input:
repo_path(string): Path to Git repository
Returns: Confirmation of reset operation
git_logShows the commit logs
Inputs:
repo_path(string): Path to Git repositorymax_count(number, optional): Maximum number of commits to show (default: 10)
Returns: Array of commit entries with hash, author, date, and message
git_create_branchCreates a new branch
Inputs:
repo_path(string): Path to Git repositorybranch_name(string): Name of the new branchstart_point(string, optional): Starting point for the new branch
Returns: Confirmation of branch creation
git_checkout
Switches branches
Inputs:
repo_path(string): Path to Git repositorybranch_name(string): Name of branch to checkout
Returns: Confirmation of branch switch
git_show
Shows the contents of a commit
Inputs:
repo_path(string): Path to Git repositoryrevision(string): The revision (commit hash, branch name, tag) to show
Returns: Contents of the specified commit
git_init
Initializes a Git repository
Inputs:
repo_path(string): Path to directory to initialize git repo
Returns: Confirmation of repository initialization
Related MCP server: git-mcp-server
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-gitAfter installation, you can run it as a script using:
python -m mcp_server_gitConfiguration
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 the 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, 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
mcpkey is not needed in the.vscode/mcp.jsonfile.
{
"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"
]
}
}
}
}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"]
}
}
},Debugging
You can use the MCP inspector to debug the server. For uvx installations:
npx @modelcontextprotocol/inspector uvx mcp-server-gitOr 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-gitRunning tail -n 20 -f ~/Library/Logs/Claude/mcp*.log will show the logs from the server and may
help you debug any issues.
Development
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:
Docker
{
"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"
]
}
}
}UVX
{
"mcpServers": {
"git": {
"command": "uv",
"args": [
"--directory",
"/<path to mcp-servers>/mcp-servers/src/git",
"run",
"mcp-server-git"
]
}
}Build
Docker build:
cd src/git
docker build -t mcp/git .License
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.
Available Tools
12 toolsgit_addC
Adds file contents to the staging area
Inputs: repo_path (required), files (required).
git_checkoutC
Switches branches
Inputs: repo_path (required), branch_name (required).
git_commitC
Records changes to the repository
Inputs: repo_path (required), message (required).
git_create_branchC
Creates a new branch from an optional base branch
Inputs: repo_path (required), branch_name (required), base_branch.
git_diffC
Shows differences between branches or commits
Inputs: repo_path (required), target (required).
git_diff_stagedC
Shows changes that are staged for commit
Inputs: repo_path (required).
git_diff_unstagedB
Shows changes in the working directory that are not yet staged
Inputs: repo_path (required).
git_initC
Initialize a new Git repository
Inputs: repo_path (required).
git_logC
Shows the commit logs
Inputs: repo_path (required), max_count.
git_resetC
Unstages all staged changes
Inputs: repo_path (required).
git_showC
Shows the contents of a commit
Inputs: repo_path (required), revision (required).
git_statusC
Shows the working tree status
Inputs: repo_path (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Each tool has a clearly distinct purpose with no ambiguity. The tools map directly to specific Git commands (add, checkout, commit, diff, etc.) with clear boundaries between operations like git_diff, git_diff_staged, and git_diff_unstaged that target different states of changes.
All tools follow a perfect and consistent verb_noun pattern with the 'git_' prefix (e.g., git_add, git_checkout, git_commit). There are no deviations in naming conventions, making the set highly predictable and readable.
With 12 tools, this is well-scoped for a Git server covering core version control operations. Each tool earns its place by addressing essential Git workflows (e.g., staging, committing, branching, diffing, logging), without being overly sparse or bloated.
The tool surface provides complete coverage of the Git domain for basic to intermediate operations. It includes initialization (git_init), staging (git_add), committing (git_commit), branching (git_create_branch, git_checkout), diffing (git_diff variants), history (git_log, git_show), and status management (git_status, git_reset), with no obvious gaps for core workflows.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
A MCP server built for developers enabling Git based project management with project and personal…
Related MCP Servers
- AlicenseBqualityBmaintenanceA 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.14115,976 PyPI92,139MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol server that enables Large Language Models to interact with Git repositories through a robust API, supporting operations like repository initialization, cloning, file staging, committing, and branch management.284,408 npm245Apache 2.0
- AlicenseCqualityBmaintenanceA Model Context Protocol server that enables LLMs to interact with Git repositories, providing tools to read, search, and manipulate Git repositories through commands like status, diff, commit, and branch operations.224MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol server that provides Git version control operations as structured tools for AI coding agents. It enables LLMs to programmatically manage repositories through actions like committing changes, rolling back code, and comparing diffs.10Apache 2.0