loading…
Search for a command to run...
loading…
An MCP server that provides Git version control operations for Claude, enabling comprehensive repository management. It allows users to perform tasks such as st
An MCP server that provides Git version control operations for Claude, enabling comprehensive repository management. It allows users to perform tasks such as staging files, committing changes, managing branches, and handling remote operations like pushing and pulling.
A Model Context Protocol (MCP) server that provides Git version control operations for Claude.
Prerequisites:
Install the MCP server:
cd /Users/bard/Code/mcp-git
npm install
Add 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
git_status({ path: "/path/to/repo" })
git_status({ short: true }) // Short format
git_diff() // Unstaged changes
git_diff({ staged: true }) // Staged changes
git_diff({ file: "README.md" }) // Specific file
git_add({ files: ["README.md", "src/index.js"] })
git_add({ files: ["."] }) // Stage all changes
git_commit({ message: "Add new feature" })
git_branch() // List branches
git_branch({ action: "create", name: "feature/new-feature" })
git_branch({ action: "switch", name: "main" })
git_branch({ action: "delete", name: "old-branch" })
git_log() // Last 10 commits, one-line format
git_log({ limit: 20, oneline: false }) // Detailed format
git_push() // Push current branch to origin
git_push({ branch: "main", force: true }) // Force push specific branch
git_pull() // Pull current branch from origin
git_pull({ remote: "upstream", branch: "main" })
git_clone({ url: "https://github.com/user/repo.git" })
git_clone({ url: "[email protected]:user/repo.git", path: "my-repo" })
git_init({ path: "/path/to/new/repo" })
git_init({ bare: true }) // Create bare repository
| Tool | Description | Required Args |
|---|---|---|
git_status |
Show repository status | None |
git_diff |
Show changes | None |
git_add |
Stage files | files |
git_commit |
Create commit | message |
git_branch |
Manage branches | None |
git_log |
Show commit history | None |
git_push |
Push to remote | None |
git_pull |
Pull from remote | None |
git_clone |
Clone repository | url |
git_init |
Initialize repository | None |
The server provides detailed error messages for common issues:
# Run directly
node src/index.js
# Test with sample commands
echo '{"jsonrpc": "2.0", "method": "tools/list", "id": 1}' | node src/index.js
path parameterMIT
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"mcp-git-server": {
"command": "npx",
"args": []
}
}
}