Skip to main content
MCP server CX Codex

git-mcp-server — Claude Code MCP server: what it does, how to install

Exposes 28 Git tools to AI agents, covering branching, commits, worktrees, and changelog analysis. Useful when delegating repository workflows directly to models.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add --env MCP_LOG_LEVEL=<MCP_LOG_LEVEL> --env GIT_BASE_DIR=<GIT_BASE_DIR> --env MCP_HTTP_HOST=<MCP_HTTP_HOST> --env MCP_HTTP_PORT=<MCP_HTTP_PORT> --env MCP_HTTP_ENDPOINT_PATH=<MCP_HTTP_ENDPOINT_PATH> --transport stdio git-mcp-server -- npx -y @cyanheads/git-mcp-server
Open on GitHub

What git-mcp-server does

The server equips coding agents with 28 Git tools. It handles staging, commits, branch creation, merges, and cherry-picking. For repository history, it provides git_blame, reflogs, and an inspection utility named git_changelog_analyze. That tool extracts commit diffs for release summaries.

Beyond file tracking, it includes a session resource at git://working-directory and a workflow prompt called Git Wrap-up. This protocol helps models review, record, and tag updates before closing a task. Connection happens over stdio or Streamable HTTP.

You need Node.js 20.0.0 or Bun 1.2.0 at minimum. Runtime is detected automatically. Without configuring GIT_USERNAME and GIT_EMAIL in the environment block, commit generation will fail.

What it helps with

  • Stage files, generate commits, and push changes from prompts
  • Trace code authorship with git_blame without leaving the chat
  • Prepare commit context for automated changelog generation
  • Switch branches and isolate parallel experiments using worktrees

Example prompts for the agent

  • Commit all staged modifications with the message "fix: handle edge cases"
  • Show recent commit history using git_log and explain the last patch
  • Run git_changelog_analyze to summarize changes since the previous tag

How to install git-mcp-server

Platform CLI

claude mcp add --env MCP_LOG_LEVEL=<MCP_LOG_LEVEL> --env GIT_BASE_DIR=<GIT_BASE_DIR> --env MCP_HTTP_HOST=<MCP_HTTP_HOST> --env MCP_HTTP_PORT=<MCP_HTTP_PORT> --env MCP_HTTP_ENDPOINT_PATH=<MCP_HTTP_ENDPOINT_PATH> --transport stdio git-mcp-server -- npx -y @cyanheads/git-mcp-server

Replace <…> with your own values. 1 more environment variable is in the server README

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about git-mcp-server

How do I install git-mcp-server in Claude Code?

Run claude mcp add git-mcp-server -- npx -y @cyanheads/git-mcp-server in your terminal.

What does git-mcp-server do?

It connects 28 Git commands to your coding assistant, covering commits, diffs, branch merges, remote synchronization, and worktree directories.

Which runtime and transport options are supported?

It runs on Node.js (version 20.0.0 or newer) and Bun (version 1.2.0 or newer), communicating via stdio or Streamable HTTP on a designated port.

Similar MCP servers

Everything for Git and GitHub →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor