Labsco
MCP SERVER

Git MCP Server

by cyanheads

Give an agent the git it needs to finish a session — stage, commit, rebase, stash, tag and manage worktrees — with a session working directory so the repo path stops being an argument on every call.

Git Hosting & Code ReviewVerified
Summary
The repository path stops being something you repeat, and the destructive commands stop being one typo away.

Everything that destroys work sits behind its own flag — clean needs force, reset and push need confirmation — so an agent cannot hard-reset a tree by omission. The two least git-like tools shape how the server actually gets used: git_wrapup_instructions returns an acceptance-criteria checklist the agent has to satisfy before a session counts as shipped, and git_changelog_analyze gathers the commits, tags and review framing to write against, leaving the changelog file itself to be read separately. One thing to check on day one: signing is on by default and falls back to unsigned rather than failing, so read the signed field in the response if signed commits are a requirement.

What it is

A server over git itself: 28 tools covering the working tree, history, remotes, tags and worktrees, plus a session working directory that later calls inherit.

What you get
  • The everyday cycle: status, staging, commits with multi-line messages passed as JSON strings, unified diffs, and log filtered by author, date, path or message pattern
  • History work with the modes each operation actually needs — merge, rebase, cherry-pick and stash all take abort or continue, reset takes soft, mixed or hard
  • Remote operations including shallow, bare and mirror clones, fetch with prune, and push with force-with-lease, dry-run and tags
  • A working directory set once for the session, returned with a repository snapshot of status, recent commits, tags and remotes so the caller starts oriented
  • Tag verification that separates an unsigned tag, missing trust configuration, a bad signature and a valid one, rather than passing or failing as one result
  • Worktrees added, listed, moved and removed, for work that runs in parallel on the same repository
  • Blame and reflog for the two questions that come up mid-incident: who last touched this line, and where did that commit go
  • Commit signing on by default for commits, merges, rebases, cherry-picks and tags, with signed and signingWarning fields in the response when it falls back to unsigned
Requirements

Git installed locally, and Node.js 20 or Bun 1.2 upwards — the runtime is detected for you. Either call git_set_working_dir once or pass a path on every call. Worth setting before the first commit: GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL, which otherwise fall back to your global git config, and GIT_BASE_DIR, which confines every operation to one directory tree. Over HTTP it listens on port 3015 with MCP_AUTH_MODE deciding between none, jwt and oauth. Apache-2.0.

Setup effort

One command — npx @cyanheads/git-mcp-server@latest