
Git Mcp
io.github.selfagencyPublished by GitHub account selfagencyv0.4.2Updated Oct 24, 2026
A Git MCP server that doesn't suck
Overview
A local Git MCP server that lets an AI coding agent inspect, commit, branch, push, rewrite history and open pull requests through 18 grouped tools.
- What you can do
- Inspect repositories: status, diffs, log, blame, reflog, config and commit search, plus read-only MCP resources for status, log, branches and diff. Stage, commit, amend, revert, reset and undo changes, with confirmation required for hard resets and nuking. Manage branches, remotes, fetch, pull and push, and handle stash, rebase, cherry-pick, merge, bisect, tags, worktrees and submodules. Drive Git Flow, Git LFS and history rewriting with backup and restore. Compute repository analytics, create, list and merge pull requests on GitHub, GitLab, Forgejo, Gitea and Bitbucket, and look up git-scm documentation and man pages.
- When to use it
- Useful when a coding agent should work with Git through structured tools instead of raw shell commands, for everyday commit and branch work as well as recovery, history rewriting, worktrees, LFS and pull requests. Best suited to desktop agents such as Claude Desktop, VS Code Copilot or Cursor working on a local repository.
- Requirements
- Runs locally over stdio as an npm package, so Node.js and npx or a global install are needed, plus Git itself. A default repository is set with GIT_REPO_PATH or the --repo-path argument, otherwise each call must pass repo_path. Git Flow needs the git-flow-next CLI on PATH. Pull request actions use the gh, glab or tea CLI, or a token such as GITHUB_TOKEN, GITLAB_TOKEN, FORGEJO_TOKEN or BITBUCKET_TOKEN.
Installation
In SourceWeft
- Open Git Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
git-mcp
A Git MCP server that doesn't suck
Exposes the full Git workflow to any MCP-compatible AI agent — inspect, write, branch, remote, stash, rebase, LFS, git-flow, documentation lookup, and more. Designed to be safe by default, composable, and fast. Powered by simple-git.
Built for coding agents in tools like GitHub Copilot, Claude Code, Cursor, and OpenAI Codex, while remaining compatible with any MCP client that can call tools and resources.
Features
- 18 tools with 80+ actions covering everyday Git workflows, advanced recovery, history rewriting, repository analytics, forge pull requests, and external VCS awareness
- Safety-first — destructive operations require explicit confirmation; force push and hook bypass are opt-in via server config
- GPG/SSH signing for commits and tags, with server-level auto-sign support
- Git LFS — track patterns, manage objects, install hooks, migrate history
- Git Flow — drives the git-flow-next CLI, so the finish state machine, conflict recovery, and worktree lifecycle stay correct as the CLI evolves. Preset init, overview, config CRUD, generalized topic actions, and classic feature/release/hotfix/support aliases
- Documentation lookup — search git-scm.com and fetch man pages directly from the LLM
- MCP Resources — URI-addressable read-only views of status, log, branches, and diff
- Bundled agent skill —
skills/git-mcp-workflow/documents MCP-first Git workflows, recovery, worktrees, releases, and advanced operations for AI agents and coding agents; installable viaskills-npmand skill.sh - External VCS awareness —
git_but_check/git_jj_checkdetect GitButler and Jujutsu and guide agents to prefer their native CLIs/MCP (withbut teardownguidance) over git-mcp tools when appropriate - History rewrite —
git_rewrite: reword, squash, rewrite-messages, and backup/restore for safe commit-history rewriting - Repository analytics —
git_analytics: contributors, churn, activity, summary, and file-stats computed from local git history - Pull requests —
git_pr: create/list/merge PRs/MRs on GitHub, GitLab, Forgejo, Gitea, and Bitbucket via provider CLI or REST API - Tangled & Entire awareness —
git_tangled_check/git_entire_checkdetect Tangled hosting and Entire session/context management - Multi-repo — pass
repo_pathper-call or configure a server-level default - Worktrees —
git_worktree: plaingit worktreeby path, or branch-addressed worktrees viagit flow worktreewith path templates and provenance-aware cleanup - Cross-platform — macOS, Linux, Windows (Git for Windows), all covered by CI
Quick Start
npx (no install)
Install globally
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
VS Code (Copilot)
Add to .vscode/mcp.json in your project:
Configuration
All configuration is via environment variables. Pass them in your MCP client config:
Tool Reference
Tools are grouped by domain. Each root tool takes an action parameter that selects the operation. Where an action is marked as default, omitting action will use it.
Context (git_context)
Status (git_status)
History (git_history)
Commits (git_commits)
Branches (git_branches)
Remotes (git_remotes)
Workspace (git_workspace)
Git Flow (git_flow)
Drives the git-flow-next CLI, which must be installed and on PATH
(brew install git-flow-next, or the releases page).
Set GIT_FLOW_BINARY to override the path. When the binary is missing, the tool returns an install
hint rather than failing opaquely.
Flags are scoped to the target verb: worktree and worktree_path apply to start and checkout,
while keep_worktree and force_worktree apply to finish and delete. A mismatch raises instead
of being silently dropped. See the tool reference for the full parameter list.
Worktree (git_worktree)
Two backends. Path-addressed actions drive plain git worktree and need nothing but git;
branch-addressed flow_* actions drive git flow worktree, which addresses worktrees by branch
name, computes paths from the gitflow.worktreePath template, and tags provenance so cleanup can
tell a git-flow-created worktree (removed) from a hand-made one (detached, uncommitted work
preserved).
See the tool reference.
LFS (git_lfs)
Documentation (git_docs)
History Rewrite (git_rewrite)
Analytics (git_analytics)
Pull Requests (git_pr)
Uses the provider CLI (gh/glab/tea) when installed locally, otherwise the REST API with a *_TOKEN env var. Provider auto-detected from the origin remote; self-hosted instances use GIT_FORGE_PROVIDER.
External VCS Awareness
Health Check (git_ping)
Returns server status. Useful for confirming the server is reachable.
MCP Resources
URI-addressable read-only snapshots (subscribe-capable):
Bundled Agent Skill
git-mcp ships a bundled agent skill at skills/git-mcp-workflow/ that teaches any skills-npm-compatible agent to use the MCP tool surface instead of running raw git CLI commands. The skill covers:
- Why LLMs must not use the Git CLI (quoting hazards, silent failures)
- Inspect-before-mutate workflow rules
- Safety order for undo and recovery operations
- Full registered tool surface with action reference
- Workflow playbooks: feature branch, rebase, recovery, worktree, backport, release tagging, Git Flow, merge
- Git concept explanations anchored to MCP tools
Installing the skill
If your agent supports skills-npm:
Or add to your project's package.json so it runs automatically:
Then add to .gitignore:
Safety
- All mutating tools have
destructiveHint: truein their MCP annotations git_commits action=reset mode=hardrequiresconfirm=truegit_commits action=nukerequiresconfirm=true- Force push (
--force) is disabled unlessGIT_ALLOW_FORCE_PUSH=true;force_with_leaseis always available - Hook bypass (
--no-verify) is disabled unlessGIT_ALLOW_NO_VERIFY=true git_flowhook and filter execution is disabled unlessGIT_ALLOW_FLOW_HOOKS=true- Paths are validated against the repository root — traversal attempts are rejected
- Credentials and tokens are never included in responses
Development
License
MIT © Daniel Sieradski
Source: README.md at commit e96db03
Tools
0Version history
1- v0.4.2LatestOct 14, 2026
Score
40% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Declare a license in the repository or the registry entry.