git
A Model Context Protocol (MCP) server providing comprehensive Git operations for Claude Code and other MCP clients
claude mcp add --transport stdio danyelkirsch-git-mcp-server npx -y git-mcp-server
How to use
This MCP server exposes Git operations to MCP clients (for example Claude Desktop) by automatically contextually operating on the Git repository in your current working directory. It provides a range of commands for repository inspection and manipulation, including status, branch listing and switching, diffs, logs, viewing file contents at specific commits, staging, committing, and remote interactions like pull and fetch. The server is designed to work across multiple projects, detecting the appropriate repository based on where you run the commands from, and routing requests accordingly. Once running, you can issue high-level Git operations through your MCP client and the server will translate them into the underlying Git commands while returning MCP-friendly results and error messages.
How to install
Prerequisites:
- Node.js 18+ (LTS recommended)
- npm or yarn
- Git installed on your system
Option 1: Global Installation (Recommended)
npm install -g git-mcp-server
Option 2: Local Development Setup
- Clone and install:
git clone https://github.com/yourusername/git-mcp-server.git
cd git-mcp-server
npm install
- Build the project (if using TypeScript sources):
npm run build
Start the server (after installation):
git-mcp-server
Additional notes
Tips and notes:
- The server auto-detects the Git repository based on your current working directory. Ensure you run the server from within a Git-enabled project or configure your MCP client to target the correct server instance.
- If you encounter permission or path issues on macOS or Linux, ensure the global npm bin directory is in your PATH.
- The server supports multiple projects by analyzing the current directory; if you need explicit control, start separate server instances pointing at different working directories.
- When integrating with Claude Desktop or other MCP clients, ensure the client configuration points to the appropriate command (git-mcp-server) and that any required environment variables are set if you extend functionality (no mandatory env vars are required for the default setup).
- For troubleshooting, try running the server in a repository directory and test basic commands like status, branches, and diff via your MCP client to confirm responses are returned in MCP-compatible formats.
Related MCP Servers
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.