git-mcp
Provides full Git workflow capabilities to manage repositories, including committing, branching, merging, rebasing, stashing, and more.
Enables Git Large File Storage operations such as tracking patterns, managing objects, and installing hooks.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@git-mcpgive me a summary of the repo"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 — git-flow-next-style workflow support with preset init, overview, config CRUD, generalized topic actions, finish recovery, optional hook/filter parity, and classic feature/release/hotfix/support aliases, without requiring the external CLI
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.shExternal 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 appropriateHistory rewrite —
git_rewrite: reword, squash, rewrite-messages, and backup/restore for safe commit-history rewritingRepository analytics —
git_analytics: contributors, churn, activity, summary, and file-stats computed from local git historyPull requests —
git_pr: create/list/merge PRs/MRs on GitHub, GitLab, Forgejo, Gitea, and Bitbucket via provider CLI or REST APITangled & Entire awareness —
git_tangled_check/git_entire_checkdetect Tangled hosting and Entire session/context managementMulti-repo — pass
repo_pathper-call or configure a server-level defaultCross-platform — macOS, Linux, Windows (Git for Windows)
Related MCP server: GitHub MCP Server
Quick Start
npx (no install)
npx @selfagency/git-mcp --repo-path /path/to/your/repoInstall globally
npm install -g @selfagency/git-mcp
git-mcp --repo-path /path/to/your/repoClaude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"git": {
"command": "npx",
"args": ["-y", "@selfagency/git-mcp", "--repo-path", "/path/to/your/repo"]
}
}
}VS Code (Copilot)
Add to .vscode/mcp.json in your project:
{
"servers": {
"git": {
"command": "npx",
"args": ["-y", "@selfagency/git-mcp", "--repo-path", "${workspaceFolder}"]
}
}
}Configuration
All configuration is via environment variables. Pass them in your MCP client config:
Variable | Default | Description |
| — | Default repository path (also: |
|
| Allow |
|
| Allow |
|
| Allow |
|
| Automatically sign every commit |
|
| Automatically sign every tag |
| — | Default GPG key ID or SSH key path |
| — | Signing format: |
|
| Enable GitButler awareness ( |
|
| Enable Jujutsu awareness ( |
|
| Enable Tangled awareness ( |
|
| Enable Entire awareness ( |
|
| Override the |
|
| Override the |
|
| Override the |
| — | GitHub token for |
| — | GitLab token for |
| — | Forgejo/Gitea token for |
| — | Bitbucket token for |
| — | Explicit forge provider for self-hosted instances |
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)
Action | Description |
| (default) Full repo snapshot: branch, upstream, pending changes, in-progress operations |
| Search commit history and working tree content |
| Read a Git config value |
| Write a Git config value |
| List all configured git aliases |
Status (git_status)
Action | Description |
| (default) Working tree and branch status |
| Unstaged, staged, or ref-to-ref diff |
| Changes from branch divergence point vs |
History (git_history)
Action | Description |
| (default) Commit log with filtering, pagination, revision ranges, and pathspecs |
| Inspect a single commit |
| Line-by-line attribution for a file |
| Full reflog — the recovery ledger |
| Compact graph log ( |
| Contributor shortlog (supports optional |
Commits (git_commits)
Action | Description |
| Stage files or hunks |
| Discard working tree changes |
| Remove files from the staging area |
| Create a commit with message, signing, and author flags |
| Amend the last commit without editing the message |
| Stage all changes and commit with message |
| Create a revert commit for a given ref |
| Soft-reset the last commit ( |
| Reset HEAD with configurable mode (soft/mixed/hard) |
| Hard-reset the last commit — requires |
Branches (git_branches)
Action | Description |
| (default) Local and remote branch listing |
| Create a branch |
| Delete a branch |
| Rename a branch |
| Switch to a branch or ref |
| Set or update tracking upstream |
| Recent branches sorted by committer date |
Remotes (git_remotes)
Action | Description |
| (default) List configured remotes |
| Add, remove, or rename a remote |
| Fetch from a remote |
| Pull (fetch + merge/rebase) |
| Push to a remote; |
Workspace (git_workspace)
Action | Description |
| Stash and pop/apply/drop/list/show stash entries |
| Stash tracked and untracked changes in one operation |
| Start, continue, abort, or skip a rebase |
| Apply one or more commits; supports continue/abort/skip |
| Merge branches with full flag control |
| Binary search for a regression (start, good, bad, reset, log) |
| Create, list, delete, or push tags; supports GPG/SSH signing |
| Add, list, remove, or prune linked worktrees |
| Add, update, sync, init, deinit, and list submodules |
Git Flow (git_flow)
Preset git-flow-next workflow without requiring the external CLI.
Operation | Description |
| Initialize a repository with git-flow branch conventions |
| Show the current flow state and active branches |
| Read or write git-flow configuration values |
| Generalized topic branch action (start, finish, publish, track) |
| Flow control: resume interrupted finish, abort, or recover |
LFS (git_lfs)
Action | Description |
| Add a tracking pattern to |
| Remove a tracking pattern |
| List tracked LFS files |
| Show LFS status |
| Pull LFS objects |
| Push LFS objects |
| Install LFS hooks in the repository |
| Migrate existing history to LFS |
| Migrate LFS history back to plain objects |
Documentation (git_docs)
Action | Description |
| Search git-scm.com for documentation |
| Fetch and return a Git man page |
History Rewrite (git_rewrite)
Action | Description |
| Change one commit's message (HEAD amends in place; arbitrary via |
| Combine the last N commits into one (requires |
| Rewrite messages across a range via a SHA→message map (requires |
| Create a |
| Hard-reset to a backup branch (requires |
Analytics (git_analytics)
Action | Description |
| Per-author commits, +/- lines, first/last activity |
| File hotspots (most commits / most lines changed) |
| Commit frequency per day |
| Branch/tag counts, total commits, top contributors, oldest/newest commit |
| File-type breakdown, largest files, recently modified |
Pull Requests (git_pr)
Action | Description |
| Create a PR/MR on the detected forge (GitHub, GitLab, Forgejo, Gitea, Bitbucket) |
| List PRs/MRs (state filter) |
| Merge a PR/MR (method: merge/squash/rebase) |
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
Tool | Description |
| Detect GitButler |
| Detect Jujutsu |
| Detect Tangled hosting; git transport works, PRs via web UI |
| Detect Entire CLI and |
Health Check (git_ping)
Returns server status. Useful for confirming the server is reachable.
MCP Resources
URI-addressable read-only snapshots (subscribe-capable):
Resource URI | Content |
| Working tree status (JSON) |
| Recent commit log (JSON) |
| Branch list (JSON) |
| Unstaged + staged diff (JSON) |
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:
npm install @selfagency/git-mcp # or pnpm/yarn
npx skills-npmOr add to your project's package.json so it runs automatically:
{
"scripts": {
"prepare": "skills-npm"
}
}Then add to .gitignore:
skills/npm-*Safety
All mutating tools have
destructiveHint: truein their MCP annotationsgit_commits action=reset mode=hardrequiresconfirm=truegit_commits action=nukerequiresconfirm=trueForce push (
--force) is disabled unlessGIT_ALLOW_FORCE_PUSH=true;force_with_leaseis always availableHook bypass (
--no-verify) is disabled unlessGIT_ALLOW_NO_VERIFY=truegit_flowhook and filter execution is disabled unlessGIT_ALLOW_FLOW_HOOKS=truePaths are validated against the repository root — traversal attempts are rejected
Credentials and tokens are never included in responses
Development
# Clone and install
git clone https://github.com/selfagency/git-mcp.git
cd git-mcp
pnpm install
# Run in development mode (hot reload)
pnpm dev
# Build
pnpm build
# Run tests
pnpm test
# Type check
pnpm typecheck
# Lint
pnpm lint
# Docs (dev server)
pnpm docs:dev
# Docs (build)
pnpm docs:buildLicense
MIT © Daniel Sieradski
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Git-backed platform for skills, tools, and context for AI agents
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to interact with local Git repositories for operations like status, commits, branching, and diffs, plus GitHub API integration for managing pull requests when authenticated.-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to manage GitHub repositories, branches, issues, pull requests, releases, and actions through natural language.1185MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to interact with GitHub via natural language, supporting repository management, issue tracking, file commits, and more.-
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to inspect Git repositories for changes across committed, staged, unstaged, and untracked scopes, and run allowlisted validation commands with structured results.-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/selfagency/git-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server