
A Model Context Protocol server for Git repository interaction and automation. This server provides
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.
·
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.
Source: https://github.com/modelcontextprotocol/servers/tree/main/src/git
Requires MCP Python SDK 2.x (mcp>=2.3,<3). The server is built on the SDK's high-level MCPServer: each tool is a typed Python function, and the SDK derives its input schema from the signature.
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 commit without --allow-empty), except while a merge is in progress (MERGE_HEAD present), where git also allows an empty commit. While a merge is in progress the commit concludes it: its parents are HEAD and every MERGE_HEAD commit, and the merge state is clearedgit_add
repo_path (string): Path to Git repositoryfiles (string[]): Non-empty array of file paths to stage; ["."] stages everythinggit_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)start_timestamp (string, optional): Start timestamp for filtering commits. Accepts ISO 8601 format (e.g., '2024-01-15T14:30:25'), relative dates (e.g., '2 weeks ago', 'yesterday'), or absolute dates (e.g., '2024-01-15', 'Jan 15 2024')end_timestamp (string, optional): End timestamp for filtering commits. Accepts ISO 8601 format (e.g., '2024-01-15T14:30:25'), relative dates (e.g., '2 weeks ago', 'yesterday'), or absolute dates (e.g., '2024-01-15', 'Jan 15 2024')git_create_branch
repo_path (string): Path to Git repositorybranch_name (string): Name of the new branchbase_branch (string, optional): Base branch to create from (defaults to current branch)git_checkout
repo_path (string): Path to Git repositorybranch_name (string): Name of branch to checkoutHEAD is now detached at <short sha> when branch_name is not a branch (a sha, tag or other revision)git_showrepo_path (string): Path to Git repositoryrevision (string): The revision (commit hash, branch name, tag) or object spec (HEAD:path/to/file) to showgit_branchrepo_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 specifiedThe server speaks both eras of the Model Context Protocol over stdio, with nothing to configure: a 2026-07-28 client (discovered with server/discover, no session) and a 2025-11-25 client (the initialize handshake). The client's first request decides which. Tools behave the same in both.
Roots is deprecated in 2026-07-28, and this server never asks a client for Roots in either era: repository access comes from --repository alone, or, with no --repository, from each tool call's repo_path. Methods the 2026-07-28 specification removes, such as ping, are answered only on a 2025-11-25 connection.
isError: true whose text is Error executing tool <name>: <message>, so the model can read it and correct the call. This covers git errors (an unknown revision, a failed command), a repo_path that is not a repository or is outside --repository, the flag-injection guards, and arguments that do not match the tool's input schema.-32602 (Unknown tool: <name>), as the specification requires in both eras. Before 2.0.0 it was an isError result.When 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-gitAfter installation, you can run it as a script using:
python -m mcp_server_git--repository (-r) accepts any path inside a Git working tree. At startup the server walks up to the enclosing repository root, the way git rev-parse --show-toplevel does, so --repository . works when a shared config is launched from any subdirectory of the repository. A path inside the repository therefore allows tool calls anywhere in that repository, not only under the subdirectory given. A path that does not exist, or is not inside a Git repository, is logged as a one-line error at startup.
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, you can configure the MCP server using one of these methods:
Method 1: User Configuration (Recommended)
Add the configuration to your user-level MCP configuration file. Open the Command Palette (Ctrl + Shift + P) and run MCP: Open User Configuration. This will open your user mcp.json file where you can add the server configuration.
Method 2: Workspace Configuration
Alternatively, you can add the configuration to a file called .vscode/mcp.json in your workspace. This will allow you to share the configuration with others.
For more details about MCP configuration in VS Code, see the official VS Code MCP documentation.
{
"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 ToolsAdd Custom MCPInstall 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-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.
The test suite drives serve() in-process through an MCP ClientSession
(see tests/conftest.py), and tests/test_eras.py runs a Client against it
as a 2026-07-28 and as a 2025-11-25 client. From src/git:
uv run --frozen pytest # the tests
uv run --frozen pytest --cov --cov-report=term-missing --cov-report=jsonThe second command adds branch coverage of src/mcp_server_git, printed per
file and written to coverage.json (ignored by git). Every file must stay at
or above 90% of its lines and 90% of its branches. Code that cannot be reached
is marked # pragma: no cover # <reason> rather than lowering that bar.
There are two ways to try your changes in a client:
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.
Pick your client and paste the snippet. Each one is the same server, written the way that client expects it.
claude mcp add git -- uvx mcp-server-git{
"mcpServers": {
"git": {
"args": [
"mcp-server-git"
],
"command": "uvx"
}
}
}code --add-mcp '{"name":"git","args":["mcp-server-git"],"command":"uvx"}'[mcp_servers.git]
command = "uvx"
args = ["mcp-server-git"]Runs locally on your device. Your client starts the server itself, so nothing has to be hosted.
Paste this prompt into your agent. It reads this page and does the setup for you.
Read https://aiagentslisting.com/mcp/git-mcp-server to learn what the "Git MCP Server" MCP server does and how to install it. Add it to my coding agent's MCP configuration as documented on that page, then confirm the server connects and list the tools it exposes.Agents can also browse this directory over MCP at https://aiagentslisting.com/api/mcp
npx @modelcontextprotocol/inspector uvx mcp-server-git
npx @modelcontextprotocol/inspector uv run mcp-server-gitThis server runs locally, so we can't read its tool list over the web yet.
Maintain this server? Claiming proves you own the listing and earns the last 4 points.
Claim this listingPaste this line near the top of your repository's README. The badge always renders the current score.
[](https://aiagentslisting.com/mcp/git-mcp-server)Welcome to the Storybook MCP Addon monorepo! This project enables AI agents to work more efficiently
Good Earth — region-scoped farm climate analytics, monetized with Tollbooth DPYC
Command relay for remote shells. Push commands from an LLM, CI runner, or any HTTP client to a
v2.0.0Release notesv1.0.0Release notes2026.8.31Release 2026.8.31Release notes2026.8.18Release 2026.8.18Release notes2026.7.10Release 2026.7.10Release notes2026.7.4Release 2026.7.4Release notes2026.1.26Release 2026.1.26Release notes2026.1.14Release 2026.1.14Release notes2025.12.18Release 2025.12.18Release notes2025.11.25Release 2025.11.25Release notes2025.9.25Release 2025.9.25Release notes2025.8.4Release 2025.8.4Release notes2025.7.1Release 2025.7.1Release notes2025.4.24Release 2025.4.24Release notes2025.4.6Release 2025.4.6Release notes2025.1.17Release 2025.1.17Release notes2025.1.14Release 2025.1.14Release notestypescript-servers-0.6.2Release notespython-servers-0.6.2Release notestypescript-servers-0.6.1Release notesConnect to the AI Agents Listing MCP server at https://aiagentslisting.com/api/mcp using the HTTP transport and complete the sign-in when it asks. Then call the submit_review tool for the listing "git-mcp-server" with a rating from 1 to 5 and a short note on what worked and what did not.No reviews yet
Be the first to share your experience with this tool.
Welcome to the Storybook MCP Addon monorepo! This project enables AI agents to work more efficiently
Developer Tools
Good Earth — region-scoped farm climate analytics, monetized with Tollbooth DPYC
Developer Tools
Command relay for remote shells. Push commands from an LLM, CI runner, or any HTTP client to a
Developer Tools
One email a week. New agents, MCP servers and skills, and what is actually getting traction.