← Back to directory
G

Git MCP Server

Community
A comprehensive Git MCP server for AI agents.
Category
Dev Tools #108 of 438
Stars
★ 242 Very popular
Transport
stdio (local process) · Streamable HTTP
Runtime
Node.js 20+ · Bun 1.2+
Credentials
No credential needed
License
Apache-2.0
Last commit
Tools
28
61FMRS · C

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.

Strongest · Documentation 14/20 Weakest · Reliability 10/20

Reliability
10/20
Security and permissions
13/20
Maintenance
11/20
Documentation
14/20
Setup experience
13/20
Why each score
Reliability 10/20
The README lists 28 tools, a resource, and a prompt, and describes unified errors, configuration validation, and test commands. However, the supplied material contains no actual source files, CI workflows, or test-coverage evidence, so initialization, tool-list handshaking, runtime dependencies, and key edge behavior cannot be verified. The manifest also declares a Bun runtime and uses “bun run,” while the README primarily presents direct npx/Node execution, creating startup reproducibility uncertainty. The score therefore remains below the static ceiling of 12.
Security and permissions 13/20
The material describes path validation, optional GIT_BASE_DIR scoping, non-shell argument spawning, JWT/OAuth support, audit logging, and explicit confirmation for git clean and git reset --hard. However, HTTP authentication defaults to none, GIT_BASE_DIR is optional, clone/fetch/pull/push and other Git operations can cause network or repository side effects, and signing failures silently fall back to unsigned operations. Permission boundaries, detailed authentication configuration, and data-flow evidence are missing, so substantial points are deducted; no red-line risk is shown by the supplied material.
Maintenance 11/20
Version 2.15.1, an Apache-2.0 license, non-archived status, a public GitHub repository, a stable-status claim, nine open issues, and a roadmap suggest ongoing maintenance. The material does not show commit cadence, release history, dependency-update practice, a security-response channel, or maintainer governance, so only a moderate score is justified.
Documentation 14/20
The README covers runtimes, installation, STDIO/HTTP configuration, environment variables, tool categories, security claims, response formats, development, and testing commands, with a client configuration example. It lacks per-tool parameters and limits, authenticated-deployment procedures, troubleshooting, cost or network-impact disclosure, and independently reviewable implementation evidence. Some README configuration variables are absent from the manifest, adding uncertainty.
Setup experience 13/20
The README provides npx and bunx installation paths, minimum runtime versions, a STDIO client configuration example, HTTP port settings, and basic development commands, making mainstream-client setup reasonably clear. However, the manifest requires Bun and passes “run start:*,” while the README presents direct npx/bunx execution without explaining the difference. HTTP authentication and remote deployment still require manual configuration, and platform-compatibility evidence is limited.

Static review · not runListed 2026-07-30

Read the FMRS scoring method →

Fit and risk

What it can accessReads local filesWrites / deletes local filesRuns commands or codeUses the network

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.

Setup

Before you start

Runtime:Node.js 20+ · Bun 1.2+

MCP_AUTH_SECRET_KEY optionalsecret 32+ character secret required for jwt auth; sensitive.
Other optional settings (20)
MCP_TRANSPORT_TYPE optional Transport type: stdio or http; defaults to stdio.
MCP_LOG_LEVEL optional Minimum log level (debug/info/warn/error); defaults to info.
MCP_SESSION_MODE optional HTTP session mode: stateless, stateful, or auto.
MCP_RESPONSE_FORMAT optional Response format: , markdown, or auto.
MCP_RESPONSE_VERBOSITY optional Response detail level: minimal, standard, or full.
MCP_HTTP_PORT optional HTTP server port; defaults to 3015.
MCP_HTTP_HOST optional HTTP hostname; defaults to 127.0.0.1.
MCP_HTTP_ENDPOINT_PATH optional MCP endpoint path; defaults to /mcp.
MCP_AUTH_MODE optional Auth mode: none, jwt, or oauth; defaults to none.
STORAGE_PROVIDER_TYPE optional Storage backend: in-memory, filesystem, supabase, cloudflare-kv, r2.
OTEL_ENABLED optional Enable OpenTelemetry; defaults to false.
GIT_SIGN_COMMITS optional Enable GPG/SSH signing for commits, merges, tags; defaults to true.
GIT_AUTHOR_NAME optional Git author name; aliases GIT_USERNAME/GIT_USER, falls back to global git config.
GIT_AUTHOR_EMAIL optional Git author email; aliases GIT_EMAIL etc., falls back to global git config.
GIT_BASE_DIR optional Optional absolute path restricting all git operations to that directory tree for sandboxing.
GIT_WRAPUP_INSTRUCTIONS_PATH optional Path to a custom markdown file with wrap-up workflow instructions.
OAUTH_ISSUER_URL optional OIDC provider URL required for oauth auth.
LOGS_DIR optional Log output directory (used in the example config).
GIT_USERNAME optional Alias of GIT_AUTHOR_NAME; sets the git username.
GIT_EMAIL optional Alias of GIT_AUTHOR_EMAIL; sets the git email.

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.

cline_mcp_settings.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"}}}}

Shown for Cline. Other clients may use a different file or key (VS Code uses "servers") — the configurator below converts it.

.vscode/mcp.json
{
  "servers": {
    "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"
      }
    }
  }
}

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

Terminal
claude mcp add git-mcp-server -e MCP_TRANSPORT_TYPE=stdio -e MCP_LOG_LEVEL=info -e 'GIT_BASE_DIR=~/Developer/' -e 'LOGS_DIR=~/Developer/logs/git-mcp-server/' -e GIT_USERNAME=cyanheads -e [email protected] -e GIT_SIGN_COMMITS=true -- npx @cyanheads/git-mcp-server@latest

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

After startup, the client's tool list should show the 28 git_* tools such as git_status and git_add; calling git_status and getting back branch and file status confirms the connection works.

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.

Things to try

Once connected, you can ask your AI assistant things like:

  • Show the git status of the current repo, listing staged and unstaged files
  • Stage my changes in src/ and commit them with the message “fix login bug”
  • Analyze the recent commit history of this repo and draft a changelog
  • Create a new branch called release/v2 and switch to it

Tools 28

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

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

Cline

Listed from the project's documentation, not tested by this site.

Overview

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

Similar servers

Context7 80 · B

Upstash's official server providing up-to-date third-party library docs for AI coding assistants

★ 63.3k · Tools 2 Compare with this →

Source revision d34d83af201d Data synced 2026-10-19 Read the FMRS scoring method