Git MCP Server provides a standardized interface for Large Language Models to interact with Git repositories. Part of the official Model Context Protocol server collection, it enables reading, searching, and manipulating Git repositories through a secure and extensible architecture. Currently in early development stage, this server's functionality continues to expand as the project matures, making repository workflows more accessible to AI systems.
Features
- Complete repository lifecycle management from initialization to advanced operations
- Comprehensive commit handling with staging, diffing, and history tracking
- Branch creation and navigation capabilities
- Detailed repository status reporting and visualization
- Error handling with informative diagnostics
- Multiple installation methods (uv/uvx, pip, Docker)
- Secure command execution with validation
Use cases
- Automating Git operations within AI-powered development workflows
- Creating intelligent code assistants with version control awareness
- Implementing automated code review processes with repository context
- Building history-aware development tools that leverage Git metadata
- Enhancing documentation generation with repository insights
- Streamlining continuous integration workflows with Git automation
- Enabling natural language interfaces for repository management
Tools
git_status
: Shows working tree statusgit_diff_unstaged
: Displays unstaged changes in the working directorygit_diff_staged
: Shows changes staged for commitgit_diff
: Compares differences between branches or commitsgit_commit
: Records changes to the repository with messagegit_add
: Stages file contents for the next commitgit_reset
: Unstages all staged changesgit_log
: Shows commit history with configurable display limitsgit_create_branch
: Creates new branches with optional starting pointsgit_checkout
: Switches between branchesgit_show
: Displays contents of specified commitsgit_init
: Initializes new Git repositories
Integration complexity
3/5 - Moderate. Requires configuration of environment and repository paths, but offers multiple installation methods.
Setup Guide
Using uvx (recommended)
Add to your Claude Desktop configuration:
"mcpServers": {
"git": {
"command": "uvx",
"args": ["mcp-server-git", "--repository", "path/to/git/repo"]
}
}
Using Docker
Add to your Claude Desktop configuration:
"mcpServers": {
"git": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"--mount",
"type=bind,src=/Users/username,dst=/Users/username",
"mcp/git"
]
}
}
Using pip
- Install the package:
pip install mcp-server-git
- Add to your configuration:
"mcpServers": {
"git": {
"command": "python",
"args": ["-m", "mcp_server_git", "--repository", "path/to/git/repo"]
}
}
License
MIT License
Website
https://github.com/modelcontextprotocol/servers/tree/main/src/git