A MCP 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.
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 repositorygit_diff_staged
repo_path
(string): Path to Git repositorygit_diff
repo_path
(string): Path to Git repositorytarget
(string): Target branch or commit to compare withgit_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 repoWhen 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"]
}
}
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"]
}
}
},
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.