Git MCP Server
Provides comprehensive Git repository operations through MCP. Read commit history, view diffs, search logs, manage branches, and inspect repository state without direct CLI access.
MCP Server Configuration
{ "mcpServers": { "git": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-git"] } } }
Available Tools
| Tool | Description |
|---|---|
git_status | Show working tree status |
git_diff_unstaged | Show unstaged changes |
git_diff_staged | Show staged changes |
git_diff | Show diff between branches or commits |
git_commit | Create a new commit |
git_add | Stage files for commit |
git_reset | Unstage files |
git_log | View commit history |
git_create_branch | Create a new branch |
git_checkout | Switch branches |
git_show | Show commit details |
git_init | Initialize a new repository |
git_clone | Clone a remote repository |
Example Operations
# View recent commits with details
git_log: { repo_path: "/path/to/repo", max_count: 10 }
# Check current changes
git_status: { repo_path: "/path/to/repo" }
# View diff between branches
git_diff: { repo_path: "/path/to/repo", target: "main...feature-branch" }
# Create and switch to new branch
git_create_branch: { repo_path: "/path/to/repo", branch_name: "feat/new-feature" }
# Stage and commit
git_add: { repo_path: "/path/to/repo", files: ["src/index.ts"] }
git_commit: { repo_path: "/path/to/repo", message: "feat: add new feature" }
Setup
- Add the configuration to
.claude/settings.json - Git must be installed and available in PATH
- No API keys required
- Works with any local Git repository
Use Cases
- Code review β View diffs, check commit history, understand changes
- Branch management β Create, switch, and compare branches
- Commit workflow β Stage, commit, and track changes
- History analysis β Search commits, understand evolution of code
Security Notes
- Only operates on local repositories β no remote push/pull operations
- No credentials stored or managed
- Repository path must be explicitly provided for each operation
- Does not modify git config or hooks
- Safe for read-heavy workflows β write operations (commit, reset) require explicit action
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Database MCP Integration
MCP server configuration for connecting Claude Code to PostgreSQL, MySQL, and MongoDB databases. Enables schema inspection, query building, and migration generation.
Elevenlabs Server
Streamline your workflow with this official, elevenlabs, text, speech. Includes structured workflows, validation checks, and reusable patterns for audio.
Browser Use Portal
Powerful mcp for server, enables, agents, control. Includes structured workflows, validation checks, and reusable patterns for browser_automation.