🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@selfagency/git-mcp

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@selfagency/git-mcp

A Git MCP server that doesn't suck

Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
21
-58%
Maintainers
1
Weekly downloads
 
Created
Source

git-mcp

A Git MCP server that doesn't suck

Exposes the full Git workflow to any MCP-compatible AI client — 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.

Features

  • 30+ tools covering everyday Git workflows and advanced recovery operations
  • 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 — full branching model (feature/release/hotfix/support) without requiring the git-flow 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
  • Multi-repo — pass repo_path per-call or configure a server-level default
  • Cross-platform — macOS, Linux, Windows (Git for Windows)

Quick Start

npx (no install)

npx @selfagency/git-mcp --repo-path /path/to/your/repo

Install globally

npm install -g @selfagency/git-mcp
git-mcp --repo-path /path/to/your/repo

Claude 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:

VariableDefaultDescription
GIT_REPO_PATHDefault repository path (also: --repo-path CLI arg)
GIT_ALLOW_NO_VERIFYfalseAllow --no-verify on commit/push (bypasses hooks)
GIT_ALLOW_FORCE_PUSHfalseAllow --force on push
GIT_AUTO_SIGN_COMMITSfalseAutomatically sign every commit
GIT_AUTO_SIGN_TAGSfalseAutomatically sign every tag
GIT_SIGNING_KEYDefault GPG key ID or SSH key path
GIT_SIGNING_FORMATSigning format: openpgp, ssh, or x509

Tool Reference

Inspect (read-only)

ToolDescription
git_statusWorking tree and branch status
git_logCommit history with filters and pagination
git_showPatch and metadata for any ref
git_diffUnstaged, staged, or ref-to-ref diff
git_blameLine-level author attribution
git_reflogHEAD movement history for recovery

Write

ToolDescription
git_addStage files
git_restoreRestore paths from index or a source ref
git_commitCreate commits (amend, sign, no-verify)
git_resetSoft/mixed/hard reset
git_revertSafe undo via revert commit

Branches

ToolDescription
git_list_branchesList local or all branches
git_create_branchCreate branch from HEAD or ref
git_delete_branchDelete a local branch
git_rename_branchRename a branch
git_checkoutSwitch to branch, tag, or commit
git_set_upstreamSet upstream tracking

Remote

ToolDescription
git_remoteAdd, remove, or set-url for a remote
git_fetchFetch with optional pruning
git_pullPull with merge or rebase
git_pushPush (force-with-lease, force, no-verify)

Advanced

ToolDescription
git_stashSave, list, apply, pop, or drop stashes
git_rebaseStart, continue, skip, or abort rebase
git_cherry_pickStart, continue, or abort cherry-pick
git_bisectBinary search to find regressions
git_tagList, create, or delete tags (with signing)
git_worktreeAdd, list, or remove worktrees
git_submoduleAdd, list, update, or sync submodules

Context & Config

ToolDescription
git_context_summaryHigh-signal repo summary for LLM workflows
git_searchPickaxe + grep across history
git_get_configRead git config values
git_set_configWrite repository-local git config

LFS

ToolDescription
git_lfsTrack patterns, pull/push objects, install hooks, migrate

Git Flow

ToolDescription
git_flowInit, feature, release, hotfix, support workflows

Documentation

ToolDescription
git_docsSearch git-scm.com or fetch man pages

MCP Resources

URI-addressable read-only snapshots (subscribe-capable):

Resource URIContent
git+repo://status/{repo_path}Working tree status (JSON)
git+repo://log/{repo_path}Recent commit log (JSON)
git+repo://branches/{repo_path}Branch list (JSON)
git+repo://diff/{repo_path}Unstaged + staged diff (JSON)

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:build

Safety

  • All mutating tools have destructiveHint: true in their MCP annotations
  • git_reset --hard requires confirm=true
  • Force push (--force) is disabled unless GIT_ALLOW_FORCE_PUSH=true
  • Hook bypass (--no-verify) is disabled unless GIT_ALLOW_NO_VERIFY=true
  • Paths are validated against the repository root — traversal attempts are rejected
  • Credentials and tokens are never included in responses

License

MIT © Daniel Sieradski

Keywords

git

FAQs

Package last updated on 30 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts