← Back to directory
I

io.github.cyanheads/git-mcp-server

Community
A comprehensive Git MCP server for AI agents.
GitHub source repository ↗
★ 229 Stars Category · Dev Tools Very popular
61FMRS · C
Reliability
10/20
Security and permissions
13/20
Maintenance
11/20
Documentation
14/20
Setup experience
13/20

The supplied materials identify version 2.15.1, an Apache-2.0 license, and a Stable status badge. The server provides 28 Git tools spanning repository management, commits, history, branching, remotes, and advanced workflows, with path validation, optional directory sandboxing, and JWT/OAuth support. The materials do not establish that it is an official Git or MCP upstream server.

Read the FMRS scoring method →

@cyanheads/git-mcp-server exposes native Git operations through MCP, including repository initialization, cloning, commits, branches, merges, rebases, remote synchronization, tags, stashes, resets, and worktrees. It supports STDIO and Streamable HTTP transports and provides 28 tools, 1 resource, and 1 prompt. Git operations currently use the local Git CLI, with Bun and Node.js runtime support.

Tools

git_init
Initialize a Git repository.
git_clone
Clone a repository from a remote.
git_status
Inspect repository status.
git_clean
Remove untracked files; explicit confirmation is required.
git_add
Stage changes.
git_commit
Create a Git commit.
git_diff
Compare changes.
git_log
View commit history.
git_show
Inspect Git objects or commit details.
git_blame
Trace authorship for file lines.
git_reflog
View reference logs.
git_changelog_analyze
Gather Git context and instructions for LLM-driven changelog analysis.
git_branch
Manage branches.
git_checkout
Switch branches or contexts.
git_merge
Merge changes.
git_rebase
Perform a rebase.
git_cherry_pick
Apply a selected commit.
git_remote
Configure and inspect remotes.
git_fetch
Fetch updates from a remote.
git_pull
Pull and synchronize remote updates.
git_push
Publish changes to a remote.
git_tag
List, create, delete, or verify tags.
git_stash
Stash working-tree changes.
git_reset
Reset repository state; hard reset requires explicit confirmation.
git_worktree
Manage Git worktrees.
git_set_working_dir
Set the session working directory.
git_clear_working_dir
Clear the session working directory.
git_wrapup_instructions
Provide a Git-session wrap-up workflow covering review, documentation, commits, and tags.

Setup

Run npx @cyanheads/git-mcp-server@latest with Node.js 20.0.0 or newer, or run bunx @cyanheads/git-mcp-server@latest with Bun 1.2.0 or newer. Add the example configuration to an MCP client and adjust environment variables as needed. For HTTP, select the HTTP transport and configure MCP_HTTP_PORT.

claude_desktop_config.json
{"mcpServers":{"git-mcp-server":{"type":"stdio","command":"npx","args":["@cyanheads/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":"cyanheads","GIT_EMAIL":"[email protected]","GIT_SIGN_COMMITS":"true"}}}}

Fit and risk

Best for

  • Development teams needing broad native Git CLI capabilities through MCP.
  • Local or server deployments requiring STDIO or Streamable HTTP.
  • Deployments needing working-directory restrictions, authentication, structured logging, or optional telemetry.

Not for

  • Pure edge environments that do not provide the local Git CLI; the isomorphic-git provider is listed as planned.
  • Cloud-native GitHub API operations without a local repository; the GitHub API provider is listed only as a possible roadmap item.
  • Workflows that expect destructive cleaning or hard resets without confirmation.

Required permissions

  • It needs access to and permission to modify local Git repositories and file paths within the configured scope.
  • A local Git installation is required because the current provider uses the Git CLI.
  • GPG or SSH signing setup is needed if commit signing is enabled; signing is enabled by default.
  • HTTP deployments using JWT or OAuth require the corresponding authentication secret or OIDC issuer URL.

Risks and side effects

  • Commit, push, merge, rebase, cherry-pick, tag, and worktree operations can change repository state or remote content.
  • git clean and git reset --hard are destructive and require explicit confirmation.
  • Without GIT_BASE_DIR, operations may cover a broader accessible directory tree.
  • HTTP authentication defaults to none; authentication and access controls should be configured before public deployment.
  • If signing fails, the server silently falls back to unsigned output and reports signed and signingWarning fields.

Troubleshooting

  1. Confirm Node.js 20.0.0 or newer, or Bun 1.2.0 or newer, is installed.
  2. Confirm Git is installed and check that repository paths and GIT_BASE_DIR use an absolute path within the permitted scope.
  3. For STDIO, verify the npx or bunx command; for HTTP, check MCP_HTTP_HOST, MCP_HTTP_PORT, and MCP_HTTP_ENDPOINT_PATH.
  4. For JWT, check that MCP_AUTH_SECRET_KEY is at least 32 characters; for OAuth, check OAUTH_ISSUER_URL.
  5. Check MCP_LOG_LEVEL and the MCP_RESPONSE_FORMAT and MCP_RESPONSE_VERBOSITY settings.

Use cases

Let AI agents inspect, modify, and commit Git repositories.
Automate branch, merge, rebase, remote synchronization, and tagging workflows.
Use session-specific working directories and worktrees across multi-repository workflows.
Gather Git context for changelog analysis.

Supported clients

ClineFull support