Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

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

README.md

<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](./CHANGELOG.md) ![MCP Spec](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-06-18/changelog.mdx) ![MCP SDK](https://modelcontextprotocol.io/) ![License](./LICENSE) ![Status](https://github.com/dadavidtseng/mcp-server-git/issues) ![TypeScript](https://www.typescriptlang.org/) ![Bun](https://bun.sh/)

</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.

---

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Developer Tools servers.