Git MCP Server

Git MCP Server

A secure and scalable Git MCP server giving AI agents powerful version control for local and (soon) serverless environments.

Category
Visit Server

README

<div align="center"> <h1>mcp-server-git</h1> <p><b>A secure and scalable Git MCP server giving AI agents powerful version control for local and (soon) serverless environments. STDIO & Streamable HTTP</b> <div>27 Tools • 1 Resource • 1 Prompt</div> </p> </div>

<div align="center">

Version MCP Spec MCP SDK License Status TypeScript Bun

</div>


🛠️ Tools Overview

This server provides 27 comprehensive Git operations organized into six functional categories:

Category Tools Description
Repository Management git_init, git_clone, git_status, git_clean Initialize repos, clone from remotes, check status, and clean untracked files
Staging & Commits git_add, git_commit, git_diff Stage changes, create commits, and compare changes
History & Inspection git_log, git_show, git_blame, git_reflog View commit history, inspect objects, trace line-by-line authorship, and view ref logs
Branching & Merging git_branch, git_checkout, git_merge, git_rebase, git_cherry_pick Manage branches, switch contexts, integrate changes, and apply specific commits
Remote Operations git_remote, git_fetch, git_pull, git_push Configure remotes, download updates, synchronize repositories, and publish changes
Advanced Workflows git_tag, git_stash, git_reset, git_worktree, git_set_working_dir, git_clear_working_dir, git_wrapup_instructions Tag releases, stash changes, reset state, manage worktrees, set/clear session directory, and access workflow guidance

📦 Resources Overview

The server provides resources that offer contextual information about the Git environment:

Resource URI Description
Git Working Directory git://working-directory Provides the current session working directory for git operations. This is the directory set via git_set_working_dir and used as the default.

🎯 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. changelogPath, skipDocumentation, createTag, and updateAgentFiles.

🚀 Getting Started

Runtime Compatibility

This server works with both Bun and Node.js runtimes:

Runtime Command Minimum Version Notes
Bun bunx git-mcp-server@latest ≥ 1.2.0 Native Bun runtime (optimal performance)
Node.js npx git-mcp-server@latest ≥ 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=3015

Important: 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 McpError system ensures consistent, structured error responses.
  • Pluggable Authentication: Secure your server with zero-fuss support for none, jwt, or oauth modes.
  • 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 tsyringe for 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 clean and git_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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured