An MCP server that exposes Git operations for AI agents over STDIO or Streamable HTTP. It provides tools for repository management, commits, history inspection, branching, remotes, tags, stashing, resets, worktrees, and changelog-related workflows.
From the registry: Comprehensive Git MCP server enabling native git tools including clone, commit, worktree, & more.
Please install the `git-mcp-server` MCP server into my current AI client (that's you).
Required prerequisites (do these first if not already done):
- **Install Node.js** — Required to run the server via npx. The README specifies Node.js 20.0.0 or newer. (https://nodejs.org/)
- **Install Git** — Required by the current CLI-based git provider to perform git operations locally. (https://git-scm.com/)
Canonical MCP server config (stdio transport):
- command: `npx`
- args: ["@cyanheads/git-mcp-server@latest"]
- optional environment variables:
- `MCP_TRANSPORT_TYPE`: Transport mode. Use stdio for MCP client config. (example: `stdio`)
- `MCP_LOG_LEVEL`: Minimum log level: debug, info, warn, or error. (example: `info`)
- `GIT_BASE_DIR`: Absolute path to restrict all git operations to a specific directory tree. (example: `<your-absolute-git-base-dir>`)
- `LOGS_DIR`: Directory for server logs. Shown in the example config, though not documented in the configuration table. (example: `<your-logs-directory>`)
- `GIT_AUTHOR_NAME`: Git author name override. Aliases: GIT_USERNAME, GIT_USER. Falls back to global git config if unset. (example: `<your-git-name>`)
- `GIT_AUTHOR_EMAIL`: Git author email override. Aliases: GIT_EMAIL, GIT_USER_EMAIL. Falls back to global git config if unset. (example: `<your-git-email>`)
- `GIT_SIGN_COMMITS`: Enable GPG/SSH signing for commits, merges, rebases, cherry-picks, and tags. (example: `true`)
- `MCP_RESPONSE_FORMAT`: Response format: json, markdown, or auto. (example: `json`)
- `MCP_RESPONSE_VERBOSITY`: Detail level: minimal, standard, or full. (example: `standard`)
- `GIT_WRAPUP_INSTRUCTIONS_PATH`: Path to a custom markdown file with workflow instructions. (example: `<your-wrapup-instructions-path>`)
- `MCP_AUTH_MODE`: Authentication mode: none, jwt, or oauth. (example: `none`)
- `MCP_AUTH_SECRET_KEY`: Required when MCP_AUTH_MODE=jwt. Must be a 32+ character secret key. (example: `<your-jwt-secret>`)
- `OAUTH_ISSUER_URL`: Required when MCP_AUTH_MODE=oauth. OIDC provider URL. (example: `<your-oidc-issuer-url>`)
- `MCP_SESSION_MODE`: HTTP session mode: stateless, stateful, or auto. Primarily relevant for HTTP transport. (example: `auto`)
- `STORAGE_PROVIDER_TYPE`: Storage backend: in-memory, filesystem, supabase, cloudflare-kv, or r2. (example: `in-memory`)
- `OTEL_ENABLED`: Enable OpenTelemetry instrumentation. (example: `false`)
Note: The README supports both stdio and Streamable HTTP. The simplest portable client config is stdio via npx, so that is extracted here. For HTTP deployments, set MCP_TRANSPORT_TYPE=http and optionally configure MCP_HTTP_PORT, MCP_HTTP_HOST, and MCP_HTTP_ENDPOINT_PATH.
Add this MCP server to my current client's config in the correct format for you. If you need secrets or credentials I haven't provided, ASK me — do not invent values or leave raw placeholders. After adding it, tell me how to verify the server is connected.GIT_USERNAMErequiredGit author/committer username used for identity in commits and related operations.GIT_EMAILrequiredGit author/committer email used for identity in commits and related operations.Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
The GitKraken MCP Server for managing repos, PRs, issues across GitHub, GitLab, Bitbucket and more.
Comprehensive Git MCP server enabling native git tools including clone, commit, worktree, & more.