Provides comprehensive Git version control operations, enabling users to manage repositories, track changes, stage files, commit updates, and perform branch, push, pull, and clone operations.
Click on "Install 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 Servershow me the status of the repository and the last 5 commits"
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 Git Server
A Model Context Protocol (MCP) server that provides Git version control operations for Claude.
Features
๐ Repository Status: Check git status and working tree state
๐ View Changes: Show diffs for staged and unstaged changes
โ Stage Files: Add files to the staging area
๐พ Commit Changes: Create commits with messages
๐ฟ Branch Operations: List, create, switch, and delete branches
๐ View History: Show commit logs
โฌ๏ธ Push Changes: Push commits to remote repositories
โฌ๏ธ Pull Changes: Pull updates from remote repositories
๐ฆ Clone Repositories: Clone remote repositories
๐ Initialize Repos: Create new git repositories
Installation
Prerequisites:
Node.js 18+ installed
Git installed and configured
Install the MCP server:
cd /Users/bard/Code/mcp-git npm installAdd to Claude Desktop config: Edit
~/Library/Application Support/Claude/claude_desktop_config.json:{ "mcpServers": { "git": { "command": "node", "args": ["/Users/bard/Code/mcp-git/src/index.js"] } } }Restart Claude Desktop
Usage
Check Repository Status
View Changes
Stage Files
Commit Changes
Branch Operations
View Commit History
Push and Pull
Clone Repository
Initialize Repository
Tool Reference
Tool | Description | Required Args |
| Show repository status | None |
| Show changes | None |
| Stage files |
|
| Create commit |
|
| Manage branches | None |
| Show commit history | None |
| Push to remote | None |
| Pull from remote | None |
| Clone repository |
|
| Initialize repository | None |
Error Handling
The server provides detailed error messages for common issues:
Repository not found
Uncommitted changes
Merge conflicts
Authentication failures
Network issues
Development
Testing the server:
Common Issues
"Not a git repository": Ensure you're in a git repository or provide the
pathparameterAuthentication errors: Configure git credentials or SSH keys
Push/pull failures: Check network connection and remote repository access
License
MIT