GitHub MCP Server
OFFICIAL SERVERLets an assistant read code and manage repositories, issues, pull requests and Actions on GitHub.
Runs everyday git work on local repositories, from clone and commit to rebase, worktrees and push
By Casey Hand (individual) TypeScript Local · stdio Git and code hostingDeveloper tools
62 popularity score ★ 245 ↓ 4.3k/wk
Opens the app, which asks before it adds the server.
claude mcp add git -- npx -y @cyanheads/git-mcp-server@latest{
"mcpServers": {
"git": {
"command": "npx",
"args": [
"-y",
"@cyanheads/git-mcp-server@latest"
]
}
}
}{
"mcpServers": {
"git": {
"command": "npx",
"args": [
"-y",
"@cyanheads/git-mcp-server@latest"
]
}
}
}{
"servers": {
"git": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@cyanheads/git-mcp-server@latest"
]
}
}
}[mcp_servers.git]
command = "npx"
args = ["-y", "@cyanheads/git-mcp-server@latest"]gemini mcp add --scope user git npx -- -y @cyanheads/git-mcp-server@latestGIT_BASE_DIR |
Optional: Absolute path that all git operations are confined to; unset means no restriction. |
|---|---|
GIT_AUTHOR_NAME |
Optional: Author name for commits (aliases GIT_USERNAME, GIT_USER); falls back to global git config. |
GIT_AUTHOR_EMAIL |
Optional: Author email for commits (aliases GIT_EMAIL, GIT_USER_EMAIL); falls back to global git config. |
GIT_SIGN_COMMITS |
Optional: GPG/SSH signing of commits, merges, rebases, cherry-picks and tags; true by default. |
MCP_TRANSPORT_TYPE |
Optional: stdio (default) or http. |
MCP_HTTP_PORT |
Optional: Port for HTTP mode; 3015 by default. |
MCP_HTTP_HOST |
Optional: Host for HTTP mode; 127.0.0.1 by default. |
MCP_AUTH_MODE |
Optional: none (default), jwt or oauth for HTTP mode. |
MCP_RESPONSE_FORMAT |
Optional: json (default), markdown or auto. |
MCP_RESPONSE_VERBOSITY |
Optional: minimal, standard (default) or full. |
GIT_WRAPUP_INSTRUCTIONS_PATH |
Optional: Markdown file with custom wrap-up workflow instructions. |
MCP_LOG_LEVEL |
Optional: debug, info (default), warn or error. |
Git MCP Server, from the developer cyanheads, gives an assistant a set of git commands that run against repositories on your own machine. It covers setting up and cloning repositories, staging and committing, reading history (log, show, blame, reflog), branching, merging, rebasing and cherry-picking, working with remotes (fetch, pull, push), plus tags, stashes, resets and worktrees. A session working directory can be set once with git_set_working_dir so later calls need no path. There is also a git://working-directory resource and a Git Wrap-up prompt that walks through reviewing, documenting, committing and tagging at the end of a session.
It calls the installed git program with checked arguments rather than through a shell. Results come back as JSON by default or as Markdown, with three verbosity levels. It speaks stdio by default and can also serve Streamable HTTP (port 3015 on 127.0.0.1 by default), where JWT or OAuth sign-in can be switched on.
The code at v2.15.3 registers exactly the 28 tools the README lists. It adds guards the README only touches on: git_clean refuses to run unless force or dryRun is set to true (src/mcp-server/tools/definitions/git-clean.tool.ts), and git_push takes a confirmed flag that must be true before a force push or branch deletion on protected branches such as main, master or production (git-push.tool.ts).
| Runtime | Node.js 20+ |
|---|
Node.js 20 or later (for npx), or Bun 1.2 or later (for bunx). The git command line program must be installed and on PATH, since every tool runs through it. Commit signing is on by default and uses your existing GPG or SSH signing setup; the author name and email come from GIT_AUTHOR_NAME/GIT_AUTHOR_EMAIL or fall back to your global git config. Pushing to or pulling from private remotes uses whatever git credentials are already set up on the machine.
Works only on repositories git can reach on the machine where the server runs; there is no GitHub or other code-host API support (a GitHub API provider is only listed as a maybe on the roadmap, and a pure-JS provider for Cloudflare Workers and other edge platforms is planned, not shipped). When commit signing fails it quietly falls back to an unsigned commit and reports this only through the signed/signingWarning fields of the response. Without GIT_BASE_DIR the tools are not limited to one directory tree. The README's client snippet runs npx without -y, which can stop at an install prompt; the snippet here adds -y.
Suits developers who want an assistant to carry out full local git workflows, including history rewriting (rebase, reset, cherry-pick) and pushing, with guards on destructive steps and optional confinement to one folder with GIT_BASE_DIR. It runs locally and needs no account or key of its own. Pick a code-host server instead if you need issues, pull requests or repositories you have not cloned; this one only drives git itself. Teams that only want read access should note that most tools can change the repository or a remote.
git_initgit_clonegit_statusgit_cleangit_addgit_commitgit_diffgit_loggit_showgit_blamegit_refloggit_changelog_analyzegit_branchgit_checkoutgit_mergegit_rebasegit_cherry_pickgit_remotegit_fetchgit_pullgit_pushgit_taggit_stashgit_resetgit_worktreegit_set_working_dirgit_clear_working_dirgit_wrapup_instructions