Git MCP Server
Provides 27 tools for managing Git repositories, including init, clone, commit, branch, merge, rebase, push, pull, stash, and more, enabling AI agents to perform comprehensive version control 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., "@Git MCP Servershow the current branch and status"
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.
🛠️ Tools Overview
This server provides 27 comprehensive Git operations organized into six functional categories:
Category | Tools | Description |
Repository Management |
| Initialize repos, clone from remotes, check status, and clean untracked files |
Staging & Commits |
| Stage changes, create commits, and compare changes |
History & Inspection |
| View commit history, inspect objects, trace line-by-line authorship, and view ref logs |
Branching & Merging |
| Manage branches, switch contexts, integrate changes, and apply specific commits |
Remote Operations |
| Configure remotes, download updates, synchronize repositories, and publish changes |
Advanced Workflows |
| Tag releases, stash changes, reset state, manage worktrees, set/clear session directory, and access workflow guidance |
Related MCP server: GitPilot MCP
📦 Resources Overview
The server provides resources that offer contextual information about the Git environment:
Resource | URI | Description |
Git Working Directory |
| Provides the current session working directory for git operations. This is the directory set via |
🎯 Prompts Overview
The server provides structured prompt templates that guide AI agents through complex workflows:
Prompt | Description | Parameters |
Git Wrap-up | A systematic workflow protocol for completing git sessions. Guides agents through reviewing, documenting, committing, and tagging changes. |
|
🚀 Getting Started
Runtime Compatibility
This server works with both Bun and Node.js runtimes:
Runtime | Command | Minimum Version | Notes |
Bun |
| ≥ 1.2.0 | Native Bun runtime (optimal performance) |
Node.js |
| ≥ 20.0.0 | Via npx/bunx (universal compatibility) |
The server automatically detects the runtime and uses the appropriate process spawning method for git operations.
MCP Client Settings/Configuration
Add the following to your MCP Client configuration file (e.g., cline_mcp_settings.json). Clients have different ways to configure servers, so refer to your client's documentation for specifics.
Be sure to update environment variables as needed (especially your Git information!)
Using Bun (bunx)
{
"mcpServers": {
"git-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["git-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info",
"GIT_BASE_DIR": "~/Developer/",
"LOGS_DIR": "~/Developer/logs/git-mcp-server/",
"GIT_USERNAME": "your-username",
"GIT_EMAIL": "your-email@example.com",
"GIT_SIGN_COMMITS": "false"
}
}
}
}Using Node.js (npx)
{
"mcpServers": {
"git-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["git-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info",
"GIT_BASE_DIR": "~/Developer/",
"LOGS_DIR": "~/Developer/logs/git-mcp-server/",
"GIT_USERNAME": "your-username",
"GIT_EMAIL": "your-email@example.com",
"GIT_SIGN_COMMITS": "false"
}
}
}
}Streamable HTTP Configuration
MCP_TRANSPORT_TYPE=http
MCP_HTTP_PORT=3015Important: when running in STDIO mode (or HTTP mode launched without a TTY), the server disables ANSI color output by setting NO_COLOR=1 and FORCE_COLOR=0 to ensure clean MCP client streams. You generally do not need to set these manually.
✨ Server Features
This server provides a comprehensive feature set:
Declarative Tools: Define agent capabilities in single, self-contained files. The framework handles registration, validation, and execution.
Robust Error Handling: A unified
McpErrorsystem ensures consistent, structured error responses.Pluggable Authentication: Secure your server with zero-fuss support for
none,jwt, oroauthmodes.Abstracted Storage: Swap storage backends (
in-memory,filesystem,Supabase,Cloudflare KV/R2) without changing business logic.Full-Stack Observability: Deep insights with structured logging (Pino) and optional, auto-instrumented OpenTelemetry for traces and metrics.
Dependency Injection: Built with
tsyringefor a clean, decoupled, and testable architecture.Edge-Ready Architecture: Built on an edge-compatible framework that runs seamlessly on local machines or Cloudflare Workers. Note: Current git operations use the CLI provider which requires local git installation. Edge deployment support is planned through the isomorphic-git provider integration.
Plus, specialized features for Git integration:
Cross-Runtime Compatibility: Works seamlessly with both Bun and Node.js runtimes. Automatically detects the runtime and uses optimal process spawning (Bun.spawn in Bun, child_process.spawn in Node.js).
Provider-Based Architecture: Pluggable git provider system with current CLI implementation and planned isomorphic-git provider for edge deployment.
Optimized Git Execution: Direct git CLI interaction with cross-runtime support for high-performance process management, streaming I/O, and timeout handling (current CLI provider).
Comprehensive Coverage: 27 tools covering all essential Git operations from init to push.
Working Directory Management: Session-specific directory context for multi-repo workflows.
Configurable Git Identity: Override author/committer information via environment variables with automatic fallback to global git config.
Safety Features: Explicit confirmations for destructive operations like
git cleanandgit_reset --hard.Commit Signing & Identity: Support for controlling commit signing and identity via environment variables (e.g., GIT_USERNAME, GIT_EMAIL, GIT_SIGN_COMMITS) with sensible fallbacks.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/a-g-e-n-t-s/mcp-server-git'
If you have feedback or need assistance with the MCP directory API, please join our Discord server