Git (cyanheads)

Developer tools

Comprehensive Git MCP server enabling native git tools including clone, commit, worktree, & more.

Your AI app calls the Git (cyanheads) MCP server, which does the developer tools work and sends the result back to the chat.

About Git (cyanheads)

Git (cyanheads) is a community MCP server from cyanheads, filed in our directory under developer tools. Comprehensive Git MCP server enabling native git tools including clone, commit, worktree, & more.

Git (cyanheads) runs on your own machine: your AI app starts it with the command npx -y @cyanheads/git-mcp-server@2.15.3 run and talks to it over standard input and output.

Git (cyanheads) is listed in the official MCP registry as io.github.cyanheads/git-mcp-server, version 2.15.3.

At a glance

Publisher
cyanheads (community)
Runs
Locally on your machine
Install from
Node.js package on npm: @cyanheads/git-mcp-server
Written in
TypeScript
License
Apache-2.0
GitHub stars
246
Official MCP registry
io.github.cyanheads/git-mcp-server

How to set up Git (cyanheads)

  1. Install Node.js on the machine that runs your AI app, because Git (cyanheads) starts with npx and downloads its package on first run.
  2. Check the Git (cyanheads) README for keys or settings; the registry lists none that Git (cyanheads) requires.
  3. Add Git (cyanheads) to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Git (cyanheads) tools to confirm the connection.
  5. Run one read-only task with Git (cyanheads) first, and keep your app asking before each tool call until the results look right.

Git (cyanheads) compared with similar servers

  • OnCo by judegomila has fewer GitHub stars than Git (cyanheads) (246 against 246); both are community servers, and both run locally.
  • Toolport by btsouth has more GitHub stars than Git (cyanheads) (247 against 246); both are community servers, and both run locally.
  • Prompt by gdli6177 has fewer GitHub stars than Git (cyanheads) (246 against 246); both are community servers, and both run locally.

Before you connect Git (cyanheads)

  • Give Git (cyanheads) its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Git (cyanheads) tool call until you trust what it does with them.
  • Treat text that Git (cyanheads) fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Git (cyanheads) on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Git (cyanheads)

How marketing and sales teams put Git (cyanheads) to work, by company size. Pick the size closest to yours and start Git (cyanheads) on one use case.

Small business

  • A small business with a developer can use Git (cyanheads) to ship site and tracking fixes faster, with the AI reading the code it changes.
  • Technical founders can ask Git (cyanheads) to explain and fix a marketing site issue without context switching between tools.
  • Git (cyanheads) runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Growth engineers can use Git (cyanheads) to build landing pages, tracking and integrations in fewer cycles, with reviews kept in the normal flow.
  • Marketing ops engineers can connect Git (cyanheads) to keep scripts and automations documented and versioned as they change.
  • Start Git (cyanheads) on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprise engineering teams can roll out Git (cyanheads) with repo scopes and audit logs, so agents work only where they are allowed.
  • Platform teams can standardize on Git (cyanheads) so web and marketing engineering share one reviewed way of working with AI.
  • Git (cyanheads) is a community server, so have security review the code and pin a version before Git (cyanheads) touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Git (cyanheads) README

From cyanheads/git-mcp-server on GitHub, shared under its Apache-2.0 license. Images are left out; the original has them.

README.md

@cyanheads/git-mcp-server

A Git MCP server for AI agents. STDIO & Streamable HTTP. 28 Tools · 1 Resource · 1 Prompt

Tools

28 git operations organized into seven categories:

Category Tools Description
Repository Management git_init, git_clone, git_status, git_clean Initialize repos, clone from remotes, check status, clean untracked files
Staging & Commits git_add, git_commit, git_diff Stage changes, create commits, compare changes
History & Inspection git_log, git_show, git_blame, git_reflog View commit history, inspect objects, trace authorship, view ref logs
Analysis git_changelog_analyze Gather git context and instructions for LLM-driven changelog analysis
Branching & Merging git_branch, git_checkout, git_merge, git_rebase, git_cherry_pick Manage branches, switch contexts, integrate changes, apply specific commits
Remote Operations git_remote, git_fetch, git_pull, git_push Configure remotes, fetch updates, synchronize repositories, 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 (list/create/delete/verify), stash changes, reset state, manage worktrees, set/clear session directory

Resources

Resource URI Description
Git Working Directory git://working-directory The current session working directory, set via git_set_working_dir.

Prompts

Prompt Description Parameters
Git Wrap-up Workflow protocol for completing git sessions: review, document, commit, and tag changes. changelogPath, createTag.

Getting started

Runtime

Works with both Bun and Node.js. Runtime is auto-detected.

Runtime Command Minimum Version
Node.js npx @cyanheads/git-mcp-server@latest >= 20.0.0
Bun bunx @cyanheads/git-mcp-server@latest >= 1.2.0
MCP client configuration

Add the following to your MCP client config (e.g., cline_mcp_settings.json). Update the environment variables to match your setup, especially the git identity fields.

{
  "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": "casey@caseyjhand.com",
        "GIT_SIGN_COMMITS": "true"
      }
    }
  }
}

Bun users: replace "command": "npx" with "command": "bunx".

For Streamable HTTP, set MCP_TRANSPORT_TYPE=http and MCP_HTTP_PORT=3015.

Features

Built on mcp-ts-template.

Feature Details
Declarative tools Define capabilities in single, self-contained files. The framework handles registration, validation, and execution.
Error handling Unified McpError system for consistent, structured error responses.
Authentication Supports none, jwt, and oauth modes.
Pluggable storage Swap backends (in-memory, filesystem, Supabase, Cloudflare KV/R2) without changing business logic.
Observability Structured logging (Pino) and optional auto-instrumented OpenTelemetry for traces and metrics.
Dependency injection Built with tsyringe for decoupled, testable architecture.
Cross-runtime Auto-detects Bun or Node.js and uses the appropriate process spawning method.
Provider architecture Pluggable git provider system. Current: CLI. Planned: isomorphic-git for edge deployment.
Working directory management Session-specific directory context for multi-repo workflows.
Configurable git identity Override author/committer info via environment variables, with fallback to global git config.
Commit signing GPG/SSH signing (enabled by default) for commits, merges, rebases, cherry-picks, and tags. Silent fallback to unsigned on failure with signed/signingWarning fields in responses.
Safety Destructive operations (git clean, git reset --hard) require explicit confirmation flags.

Security

  • All file paths are validated and sanitized to prevent directory traversal.
  • Optional GIT_BASE_DIR restricts operations to a specific directory tree for multi-tenant sandboxing.
  • Git commands use validated arguments via process spawning, no shell interpolation.
  • JWT and OAuth support for authenticated deployments.
  • Optional rate limiting via the DI-managed RateLimiter service.
  • All operations are logged with request context for auditing.

Configuration

All configuration is validated at startup in src/config/index.ts. Key environment variables:

Variable Description Default
MCP_TRANSPORT_TYPE Transport: stdio or http. stdio
MCP_SESSION_MODE HTTP session mode: stateless, stateful, or auto. auto
MCP_RESPONSE_FORMAT Response format: json (LLM-optimized), markdown (human-readable), or auto. json
MCP_RESPONSE_VERBOSITY Detail level: minimal, standard, or full. standard
MCP_HTTP_PORT HTTP server port. 3015
MCP_HTTP_HOST HTTP server hostname. 127.0.0.1
MCP_HTTP_ENDPOINT_PATH MCP request endpoint path. /mcp
MCP_AUTH_MODE Authentication mode: none, jwt, or oauth. none
STORAGE_PROVIDER_TYPE Storage backend: in-memory, filesystem, supabase, cloudflare-kv, r2. in-memory
OTEL_ENABLED Enable OpenTelemetry. false
MCP_LOG_LEVEL Minimum log level: debug, info, warn, error. info
GIT_SIGN_COMMITS GPG/SSH signing for commits, merges, rebases, cherry-picks, and tags. Falls back to unsigned on failure (see response signed/signingWarning). true
GIT_AUTHOR_NAME Git author name. Aliases: GIT_USERNAME, GIT_USER. Falls back to global git config. (none)
GIT_AUTHOR_EMAIL Git author email. Aliases: GIT_EMAIL, GIT_USER_EMAIL. Falls back to global git config. (none)
GIT_BASE_DIR Absolute path to restrict all git operations to a specific directory tree. (none)
GIT_WRAPUP_INSTRUCTIONS_PATH Path to custom markdown file with workflow instructions. (none)
MCP_AUTH_SECRET_KEY Required for jwt auth. 32+ character secret key. (none)
OAUTH_ISSUER_URL Required for oauth auth. OIDC provider URL. (none)

Running the server

Via package manager (no install)
npx @cyanheads/git-mcp-server@latest

Configure through environment variables or your MCP client config.

Local development
# Build and run
npm run rebuild
npm run start:stdio   # or start:http

# Dev mode with hot reload
npm run dev:stdio     # or dev:http

# Checks and tests
npm run devcheck      # lint, format, typecheck
npm test
Cloudflare Workers
npm run build:worker   # Build the worker bundle
npm run deploy:dev     # Run locally with Wrangler
npm run deploy:prod    # Deploy to Cloudflare

Project structure

Directory Purpose
src/mcp-server/tools Tool definitions (*.tool.ts). Git capabilities live here.
src/mcp-server/resources Resource definitions (*.resource.ts). Git context data sources.
src/mcp-server/transports HTTP and STDIO transport implementations, including auth.
src/storage StorageService abstraction and provider implementations.
src/services Git service provider (CLI-based git operations).
src/container DI container registrations and tokens.
src/utils Logging, error handling, performance, security utilities.
src/config Environment variable parsing and validation (Zod).
tests/ Unit and integration tests, mirroring src/ structure.

Response format

Configure output format and verbosity via MCP_RESPONSE_FORMAT and MCP_RESPONSE_VERBOSITY.

JSON format (default, optimized for LLM consumption):

{
  "success": true,
  "branch": "main",
  "staged": ["src/index.ts", "README.md"],
  "unstaged": ["package.json"],
  "untracked": []
}

Markdown format (human-readable):

# Git Status: main

## Staged (2)
- src/index.ts
- README.md

## Unstaged (1)
- package.json

The LLM always receives the complete structured data via responseFormatter, full file lists, metadata, timestamps, regardless of what the client displays. Verbosity controls how much detail is included: minimal (core fields only), standard (balanced), or full (everything).

Development guide

See AGENTS.md for architecture, tool development patterns, and contribution rules.

Testing

Tests use Bun's test runner with Vitest compatibility.

bun test              # Run all tests
bun test --coverage   # With coverage
bun run devcheck      # Lint, format, typecheck, audit

Roadmap

The server uses a provider-based architecture for git operations:

  • CLI provider (current), Full 28-tool coverage via native git CLI. Requires local git installation.
  • Isomorphic git provider (planned), Pure JS implementation for edge deployment (Cloudflare Workers, Vercel Edge, Deno Deploy). Uses isomorphic-git.
  • GitHub API provider (maybe), Cloud-native operations via GitHub REST/GraphQL APIs, no local repo required.

Contributing

Issues and pull requests are welcome. Run checks before submitting:

npm run devcheck
npm test

License

Apache 2.0. See LICENSE.

Built with the mcp-ts-template

Sponsor this project · Buy me a coffee

Questions about Git (cyanheads)

What is the Git (cyanheads) MCP server?

Comprehensive Git MCP server enabling native git tools including clone, commit, worktree, & more. Git (cyanheads) is maintained by cyanheads on GitHub at cyanheads/git-mcp-server, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Git (cyanheads) MCP server?

Add Git (cyanheads) to your AI app's MCP config with the command npx -y @cyanheads/git-mcp-server@2.15.3 run start:stdio. In Claude Code, run claude mcp add --transport stdio git -- npx -y @cyanheads/git-mcp-server@2.15.3 run start:stdio. To run Git (cyanheads) this way you need Node.js installed.

Does Git (cyanheads) need an API key?

The registry lists no required keys for Git (cyanheads). Check the Git (cyanheads) README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Git (cyanheads) an official MCP server?

No. Git (cyanheads) is a community server maintained by cyanheads. Community servers can be excellent; read the code and the open issues before you give Git (cyanheads) access to company data.

What license is Git (cyanheads) under?

Git (cyanheads) is released under the Apache-2.0 license, according to its GitHub repository. The license covers the code of Git (cyanheads); the service it connects to has its own terms.