Git MCP Server

A git MCP server with 28 tools: an agent clones, commits, branches, merges, rebases and manages worktrees in local repositories.

  • 245 ★ on the repository
  • Last commit
MCP server

Broad access

Why this level

  • Runs real git commands: commits, rebase, `git_push`, `git_reset` and `git_clean`.
  • Changes history and remote repositories with the user's rights.
All reasons and checks

cyanheads/git-mcp-server

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add mcp/git-mcp-server

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Broad accessThe tool can change data, run commands or handle secrets.

  • Runs real git commands: commits, rebase, `git_push`, `git_reset` and `git_clean`.
  • Changes history and remote repositories with the user's rights.

This is third-party code. Review the repository files before installing.

What it does

Git MCP Server gives an agent native git operations over MCP through stdio or Streamable HTTP. Tools are grouped by task: repository management (`git_init`, `git_clone`, `git_status`, `git_clean`), index and commits (`git_add`, `git_commit`, `git_diff`), history (`git_log`, `git_show`, `git_blame`, `git_reflog`), branches and merging (`git_branch`, `git_checkout`, `git_merge`, `git_rebase`, `git_cherry_pick`), remotes (`git_remote`, `git_fetch`, `git_pull`, `git_push`) and advanced workflows (`git_tag`, `git_stash`, `git_reset`, `git_worktree`). Commits, merges, rebases, cherry-picks and tags are signed with GPG or SSH by default, and on failure the signature is skipped with `signed` and `signingWarning` fields in the response. Destructive operations such as `git clean` and `git reset --hard` need explicit confirmation flags. The `GIT_BASE_DIR` variable restricts all operations to one directory tree, and paths are validated against escaping it.

Who it is for. Developers who hand git routine to an agent: from reading history to signed commits and working across several worktrees.

Good fit when

  • The agent goes through a file history with `git_blame` and `git_reflog` and explains when the logic broke.
  • After edits it groups changes into signed commits and tags a release.
  • Several branches live in separate worktrees and the agent switches the session working directory.
  • For a multi-user server operations are confined to the `GIT_BASE_DIR` tree.

Not a fit when

  • The agent cannot be trusted with `git push` and `git reset` without manual confirmation.
  • You need GitHub API operations, and pull requests and issues are not part of this server.
  • Shell commands built into the client are enough and a separate server is not needed.

Example request

Show the history of src/app.ts through `git_blame`, then create a `fix-login` branch and make a signed commit describing the change.

MCP

Transport
stdio, http
Authentication
not required

Environment variables

GIT_BASE_DIR
Absolute path that confines all git operations to one directory tree.
MCP_TRANSPORT_TYPE
Transport: stdio or http, defaults to stdio.

Limitations

It needs Node.js 20 or newer or Bun 1.2 and up. The server runs real git commands with the user's rights, including `git_push`, `git_reset` and `git_clean`, so set `GIT_BASE_DIR` and configure confirmations in the client. Commit signing is on by default and on error is silently replaced by an unsigned commit, which the `signingWarning` field reports. For HTTP mode set `MCP_TRANSPORT_TYPE=http`, the default port is 3015 on `127.0.0.1`, and set up external authorization through JWT or OAuth.

How to disable. Remove the git entry from the client MCP configuration. The package is fetched through `npx` and stores nothing. The commits and branches already made stay in the repositories.

FAQ

How do I start Git MCP Server?

Run `npx @cyanheads/git-mcp-server@latest` for Node.js or `bunx @cyanheads/git-mcp-server@latest` for Bun. In the client configuration set the `stdio` type and the `MCP_TRANSPORT_TYPE=stdio` variable.

How do I confine the server to one directory?

Set an absolute path in `GIT_BASE_DIR`. All git operations then run only inside that tree, and paths are validated against directory traversal.

Are commits signed?

Yes, by default with GPG or SSH for commits, merges, rebases, cherry-picks and tags. If signing fails the server makes an unsigned commit and reports it in `signingWarning`.

How do I run it over HTTP?

Set `MCP_TRANSPORT_TYPE=http` and if needed `MCP_HTTP_PORT` (3015 by default), `MCP_HTTP_HOST` (127.0.0.1) and `MCP_HTTP_ENDPOINT_PATH` (`/mcp`).

What does the Git Wrap-up prompt do?

It is a session wrap-up protocol: review, document, commit and tag. The `changelogPath` and `createTag` parameters configure the process.

Discussion

No questions or reviews yet.

Editors’ pick

An MCP server for GitLab and self-hosted instances: projects, merge requests, issues, pipelines, wiki and releases

MCP serverBroad access2.1KRepository stars
Official

Official GitKraken MCP server from the gk CLI: git, pull requests and issues across GitHub, GitLab, Bitbucket and Jira

MCP serverBroad access464Repository stars
Russian stack

A GitVerse MCP server with 25 bitbucket-mcp-style tools: pull requests, inline code review with verdicts and running GitVerse Actions CI pipelines

MCP serverBroad access1Repository stars

GitFlic MCP built on gitflic-cli

gitflic-cli MCP-сервер

Russian stack

An MCP server with 76 typed tools over a GitFlic CLI: merge requests, issues, releases, package registry, with group filters and a read-only mode

MCP serverExtended access

A remote MCP server that gives the agent docs and code of any public GitHub repository with nothing to install

MCP serverExtended access8.5KRepository stars

gac writes a commit message from the diff with one of 35 providers and gives agents MCP tools for status and commit.

CLIExtended access318Repository stars

Comparison with similar tools

Cards that share the main search query, and how they differ.

ToolOfficialAuthenticationRepository starsMain difference
Git MCP Server (this card)nonot required245
GitMCPnonot required8,513serves documentation and code of public GitHub repositories for reading; Git MCP Server runs git commands in local repositories
GitNexusnonot required48,470builds a knowledge graph of code; Git MCP Server works with git itself: commits, branches and history

README in short

The project is built on the mcp-ts-template, runs on Bun and Node.js and contains 28 tools, one resource `git://working-directory` and one prompt.

README badge

Report a problem