Git MCP Server logo

Git MCP Server

Expose Git repository operations to AI agents through 28 MCP tools over STDIO or Streamable HTTP.

Install Git MCP Server

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "git-mcp-server-2": {
      "command": "npx",
      "args": [
        "-y",
        "@cyanheads/git-mcp-server@latest"
      ],
      "env": {
        "MCP_TRANSPORT_TYPE": "YOUR_VALUE_HERE",
        "MCP_LOG_LEVEL": "YOUR_VALUE_HERE",
        "MCP_HTTP_PORT": "YOUR_VALUE_HERE",
        "GIT_BASE_DIR": "YOUR_VALUE_HERE",
        "LOGS_DIR": "YOUR_VALUE_HERE",
        "GIT_USERNAME": "YOUR_VALUE_HERE",
        "GIT_EMAIL": "YOUR_VALUE_HERE",
        "GIT_SIGN_COMMITS": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Automated check passed— started and listed 28 tools correctly (9d ago).

Overview

The git-mcp-server MCP server exposes native Git operations to AI agents through STDIO or Streamable HTTP. It supports repository setup, staging, commits, history inspection, branching, remotes, tags, worktrees, and working-directory management. The server runs with Node.js or Bun, uses the Git CLI provider, and can maintain a session-specific repository directory. Reach for it when an agent needs to inspect or modify Git repositories rather than only read project files.

Use cases

  • Clone repositories and inspect their status
  • Stage changes and create signed commits
  • Review history, diffs, authorship, and reflogs
  • Manage branches, merges, rebases, and worktrees
  • Fetch, pull, push, tag, and clean repositories

Key features

  • 28 Git tools
  • STDIO and Streamable HTTP transports
  • Node.js and Bun runtime detection
  • Session-specific working directories
  • GPG and SSH commit signing
  • Confirmation for destructive operations

Tools28

What Git MCP Server lets your agent do. Expand a tool for its parameters.

Verified live~8.4k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

7/7 checks healthy over the last 29d

Supply-chain signal

1 high-severity advisory on record for this package. Most advisories affect transitive dependencies and may not be exploitable in this server's actual usage — this is a directional signal, not a security audit.

Critical 0High 1Medium 0Low 0

Scanned 15d ago via OSV.dev · @cyanheads/git-mcp-server@latest (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars242Stargazers on the source repository.
npm downloads12kPackage downloads in the last 30 days.
Last commit26d agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed28Callable tools this server registers over MCP.
Directory activity5 viewsConfig copies, upvotes, and views on AllMCPs.

How Git MCP Server works

What the git-mcp-server MCP server does

The git-mcp-server MCP server gives AI agents access to 28 Git operations through the Model Context Protocol. Its tools cover the repository lifecycle, from initialization and cloning through staging, committing, synchronization, and cleanup. It also exposes one resource, git://working-directory, and one prompt for a structured Git session wrap-up.

Supported operations include:

  • Repository initialization, cloning, status checks, and cleanup of untracked files.
  • Staging, commits, diffs, logs, object inspection, blame, and reflogs.
  • Branch creation and management, checkout, merge, rebase, and cherry-pick.
  • Remote configuration, fetch, pull, and push.
  • Tags, stashes, resets, and worktrees.
  • Setting and clearing the working directory used by a session.

The current provider uses the Git CLI. The repository describes isomorphic-git as a planned provider for edge deployment, not as a current implementation.

How it works

The git-mcp-server MCP server can communicate over STDIO or Streamable HTTP. Runtime detection selects the appropriate process-spawning behavior for Node.js or Bun. Node.js requires version 20 or newer, while Bun requires version 1.2 or newer.

A session can set a working directory with git_set_working_dir; that location is also available through the git://working-directory resource. This supports workflows that move between repositories or worktrees without treating one fixed directory as the only context.

Git identity can be supplied through environment variables, with fallback to the global Git configuration. Commit signing supports GPG and SSH for commits, merges, rebases, cherry-picks, and tags. If signing fails, the operation can fall back to an unsigned result and report signing fields in its response.

Destructive actions such as git clean and git reset --hard require explicit confirmation flags. File paths are validated and sanitized to help prevent directory traversal.

Setup and configuration

Run the package with npx @cyanheads/git-mcp-server@latest under Node.js or bunx @cyanheads/git-mcp-server@latest under Bun. Add the command to an MCP client configuration as a STDIO server. For HTTP transport, set MCP_TRANSPORT_TYPE to http and provide MCP_HTTP_PORT, such as 3015.

Configuration can include GIT_BASE_DIR for the base location, LOGS_DIR for logs, GIT_USERNAME and GIT_EMAIL for identity, and GIT_SIGN_COMMITS to control commit signing. MCP_LOG_LEVEL sets the logging level. The example configuration uses stdio transport and enables signing.

Tools and capabilities

The tools are organized into repository management, staging and commits, history and inspection, analysis, branching and merging, remote operations, and advanced workflows. The git_changelog_analyze tool gathers Git context and instructions for LLM-driven changelog analysis. The Git Wrap-up prompt accepts changelogPath and createTag parameters to guide review, documentation, commits, and optional tagging.

The framework provides structured error responses, Pino logging, optional OpenTelemetry instrumentation, and pluggable storage options including in-memory, filesystem, Supabase, and Cloudflare KV/R2. Authentication modes include none, jwt, and oauth.

Limitations and notes

The server operates through the Git CLI provider, so Git must be available to the runtime environment. The material does not document a current isomorphic-git implementation. Authentication, storage, and HTTP deployment details beyond the listed modes and transport settings are not specified. Signing is supported, but failures may produce unsigned commits, merges, rebases, cherry-picks, or tags with a warning rather than stopping the operation.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Git MCP Server

git-mcp-server is an MCP server that connects AI agents to Git repositories through the Git CLI. Its main tools cover cloning, status, staging, commits, diffs, history, branches, merges, rebases, remotes, tags, stashes, resets, and worktrees over STDIO or Streamable HTTP.

Install it by running `npx @cyanheads/git-mcp-server@latest` with Node.js 20 or newer, or `bunx @cyanheads/git-mcp-server@latest` with Bun 1.2 or newer. Add that command as a STDIO server in your MCP client configuration.

Set `MCP_TRANSPORT_TYPE=http` and define `MCP_HTTP_PORT`, such as `3015`. The server also supports STDIO transport, which uses `MCP_TRANSPORT_TYPE=stdio` in the example configuration.

Yes. git-mcp-server uses standard MCP transports, including STDIO and Streamable HTTP, so it can be configured in Cursor as an MCP server. The README provides a client configuration example using the same standard server settings.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewGit MCP Server AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/git-mcp-server-2?style=directory)](https://allmcps.com/mcp/git-mcp-server-2)
HTML Embed
<a href="https://allmcps.com/mcp/git-mcp-server-2"><img src="https://allmcps.com/api/badge/git-mcp-server-2?style=directory" alt="Git MCP Server on AllMCPs" /></a>