原型 · 预览版:收录官方注册中心里的全部服务器,每 30 分钟同步一次。评价和账户功能将在后续阶段推出。
PopNx MCP为使用 AI 的人准备的 MCP 服务器 · 用大白话讲清楚

Git MCP

作者:selfagency版本 0.4.2i★ –i在你的电脑上运行
注册名称io.github.selfagency/git-mcp

安装

概览

作者提供的说明(英文原文)

A Git MCP server that doesn't suck

PopNx MCP 的三大支柱

这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。

它能帮你做什么

我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。

  • 连接方式: 在你的电脑上运行
  • 传输方式: stdio
  • 分类: 开发者工具
  • 你需要填写:GIT_SIGNING_KEY

安装

选择你使用的 AI 应用,然后复制设置。

安装之前

  • 基础检查:1 项中通过 1 项
  • 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
  • 需要你自己填写: GIT_REPO_PATH, GIT_ALLOW_NO_VERIFY, GIT_ALLOW_FORCE_PUSH, GIT_ALLOW_FLOW_HOOKS, GIT_SIGNING_KEY, GIT_SIGNING_FORMAT, GIT_AUTO_SIGN_COMMITS, GIT_AUTO_SIGN_TAGS

标为机密的值是你账户的钥匙。千万不要分享给别人,也不要粘贴到聊天里。

你需要

  • npm已安装 Node.js(用于 npx 命令)

你用的是哪个应用?

在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。

打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json

{
  "mcpServers": {
    "git": {
      "command": "npx",
      "args": [
        "-y",
        "@selfagency/git-mcp"
      ],
      "env": {
        "GIT_REPO_PATH": "your-value",
        "GIT_ALLOW_NO_VERIFY": "your-value",
        "GIT_ALLOW_FORCE_PUSH": "your-value",
        "GIT_ALLOW_FLOW_HOOKS": "your-value",
        "GIT_SIGNING_KEY": "your-value",
        "GIT_SIGNING_FORMAT": "your-value",
        "GIT_AUTO_SIGN_COMMITS": "your-value",
        "GIT_AUTO_SIGN_TAGS": "your-value"
      }
    }
  }
}

在终端中运行这条命令

claude mcp add git --env GIT_REPO_PATH=your-value --env GIT_ALLOW_NO_VERIFY=your-value --env GIT_ALLOW_FORCE_PUSH=your-value --env GIT_ALLOW_FLOW_HOOKS=your-value --env GIT_SIGNING_KEY=your-value --env GIT_SIGNING_FORMAT=your-value --env GIT_AUTO_SIGN_COMMITS=your-value --env GIT_AUTO_SIGN_TAGS=your-value -- npx -y @selfagency/git-mcp

运行前请先填写空着的值。

在 Cursor 中打开

或者自己复制设置

粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json

{
  "mcpServers": {
    "git": {
      "command": "npx",
      "args": [
        "-y",
        "@selfagency/git-mcp"
      ],
      "env": {
        "GIT_REPO_PATH": "your-value",
        "GIT_ALLOW_NO_VERIFY": "your-value",
        "GIT_ALLOW_FORCE_PUSH": "your-value",
        "GIT_ALLOW_FLOW_HOOKS": "your-value",
        "GIT_SIGNING_KEY": "your-value",
        "GIT_SIGNING_FORMAT": "your-value",
        "GIT_AUTO_SIGN_COMMITS": "your-value",
        "GIT_AUTO_SIGN_TAGS": "your-value"
      }
    }
  }
}

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

在 VS Code 中打开

或者自己复制设置

粘贴到项目中的 .vscode/mcp.json

{
  "servers": {
    "git": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@selfagency/git-mcp"
      ],
      "env": {
        "GIT_REPO_PATH": "your-value",
        "GIT_ALLOW_NO_VERIFY": "your-value",
        "GIT_ALLOW_FORCE_PUSH": "your-value",
        "GIT_ALLOW_FLOW_HOOKS": "your-value",
        "GIT_SIGNING_KEY": "your-value",
        "GIT_SIGNING_FORMAT": "your-value",
        "GIT_AUTO_SIGN_COMMITS": "your-value",
        "GIT_AUTO_SIGN_TAGS": "your-value"
      }
    }
  }
}

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。

你的选择通过 Cookie 保存在这台设备上,无需账户。

需要你填写的值

  • GIT_REPO_PATH env
    Default repository path for all tool requests. Can also be set via the --repo / --repo-path CLI argument. If omitted, each tool call must supply repo_path explicitly.
  • GIT_ALLOW_NO_VERIFY env
    Set to 'true' to expose a no_verify parameter on commit and push tools, passing --no-verify to Git and bypassing pre-commit / pre-push hooks.
  • GIT_ALLOW_FORCE_PUSH env
    Set to 'true' to expose a force parameter on push tools. Remote branch protection rules (GitHub/GitLab) are still enforced server-side regardless.
  • GIT_ALLOW_FLOW_HOOKS env
    Set to 'true' to allow git_flow to execute git-flow-next-compatible hook and filter programs discovered from git config or repository hook locations.
  • GIT_SIGNING_KEY 机密 env
    Default signing key: a GPG key ID, an SSH public key path, or empty to use git's configured user.signingkey. Used when GIT_AUTO_SIGN_COMMITS or GIT_AUTO_SIGN_TAGS is enabled.
  • GIT_SIGNING_FORMAT env
    Signing format for commits and tags. Accepted values: openpgp, ssh, x509.
  • GIT_AUTO_SIGN_COMMITS env
    Set to 'true' to automatically sign all commits produced by this server.
  • GIT_AUTO_SIGN_TAGS env
    Set to 'true' to automatically sign all tags produced by this server.

这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。

它能做什么

它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。

基础检查i

我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月6日

  • ✓ 通过

    作者与仓库一致

    注册名称已通过 GitHub 账户 selfagency 验证,该账户拥有此仓库

  • … 尚未检查

    仍在维护

    我们还没有从 GitHub 读取这个仓库

  • … 尚未检查

    有许可证

    我们还没有从 GitHub 读取这个仓库

  • – 不适用

    端点有响应

    它在你的电脑上运行,没有互联网端点

  • – 不适用

    使用 OAuth 登录

    在你的电脑上运行,改用本地设置

  • … 尚未检查

    工具描述中没有隐藏指令

    它在你的电脑上运行;我们只能读取互联网端点的工具列表

与“开发者工具”中的其他服务器比较i

  • 星标数多于此分类中其他 1390 个服务器的 0%
  • 发布到注册中心的时间比此分类中其他 1390 个服务器的 67% 更新
  • 基础检查结果等于或优于此分类中其他 1390 个服务器的 100%

与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。

常见问题

Git MCP 安全吗?

它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。

它需要哪些密钥或代码?

你需要填写:GIT_SIGNING_KEY

它在我的电脑上运行还是在云端?

它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。

它还在维护吗?

GitHub 仓库最后更新于–,最新版本(0.4.2)于23天前进入注册中心。

哪些应用可以使用它?

支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。

有什么可以替代它?

同一分类中有:GitHub, Desktop Commander, Cloudflare MCP

替代选择

同一分类中其他作者的服务器,按星标数排序。

如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i

GitHub

作者:github

Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.

电脑或云端★ 34,245MIT3天前更新
安装

Desktop Commander

作者:wonderwhy-er

MCP server for terminal commands, file operations, and process management

在你的电脑上运行★ 10,225MIT15天前更新
安装

Cloudflare MCP

作者:cloudflare

Cloudflare MCP servers

在云端运行★ 4,446Apache-2.014个月前更新
安装

作者的 README

打开 README

按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。

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 via skills-npm and skill.sh
  • External VCS awareness — git_but_check / git_jj_check detect GitButler and Jujutsu and guide agents to prefer their native CLIs/MCP (with but teardown guidance) 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_check detect Tangled hosting and Entire session/context management
  • Multi-repo — pass repo_path per-call or configure a server-level default
  • Worktrees — git_worktree: plain git worktree by path, or branch-addressed worktrees via git flow worktree with path templates and provenance-aware cleanup
  • Cross-platform — macOS, Linux, Windows (Git for Windows), all covered by CI

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_PATH—Default 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_ALLOW_FLOW_HOOKSfalseAllow git_flow hooks and filters to execute
GIT_AUTO_SIGN_COMMITSfalseAutomatically sign every commit
GIT_AUTO_SIGN_TAGSfalseAutomatically sign every tag
GIT_SIGNING_KEY—Default GPG key ID or SSH key path
GIT_SIGNING_FORMAT—Signing format: openpgp, ssh, or x509
GIT_ALLOW_BUTfalseEnable GitButler awareness (git_but_check)
GIT_ALLOW_JJfalseEnable Jujutsu awareness (git_jj_check)
GIT_ALLOW_TANGLEDfalseEnable Tangled awareness (git_tangled_check)
GIT_ALLOW_ENTIREfalseEnable Entire awareness (git_entire_check)
BUT_BINARYbutOverride the but executable path
JJ_BINARYjjOverride the jj executable path
ENTIRE_BINARYentireOverride the entire executable path
GITHUB_TOKEN—GitHub token for git_pr REST fallback
GITLAB_TOKEN—GitLab token for git_pr REST fallback
FORGEJO_TOKEN—Forgejo/Gitea token for git_pr REST fallback
BITBUCKET_TOKEN—Bitbucket token for git_pr REST fallback
GIT_FORGE_PROVIDER—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)
ActionDescription
summary_(default)_ Full repo snapshot: branch, upstream, pending changes, in-progress operations
searchSearch commit history and working tree content
get_configRead a Git config value
set_configWrite a Git config value
aliasesList all configured git aliases
Status (git_status)
ActionDescription
status_(default)_ Working tree and branch status
diffUnstaged, staged, or ref-to-ref diff
diff_mainChanges from branch divergence point vs main (or configurable base branch)
History (git_history)
ActionDescription
log_(default)_ Commit log with filtering, pagination, revision ranges, and pathspecs
showInspect a single commit
blameLine-by-line attribution for a file
reflogFull reflog — the recovery ledger
lgCompact graph log (--oneline --graph --decorate --all)
whoContributor shortlog (supports optional file_path)
Commits (git_commits)
ActionDescription
addStage files or hunks
restoreDiscard working tree changes
unstageRemove files from the staging area
commitCreate a commit with message, signing, and author flags
amendAmend the last commit without editing the message
wipStage all changes and commit with message WIP
revertCreate a revert commit for a given ref
undoSoft-reset the last commit (reset --soft HEAD~1)
resetReset HEAD with configurable mode (soft/mixed/hard)
nukeHard-reset the last commit — requires confirm=true
Branches (git_branches)
ActionDescription
list_(default)_ Local and remote branch listing
createCreate a branch
deleteDelete a branch
renameRename a branch
checkoutSwitch to a branch or ref
set_upstreamSet or update tracking upstream
recentRecent branches sorted by committer date
Remotes (git_remotes)
ActionDescription
list_(default)_ List configured remotes
manageAdd, remove, or rename a remote
fetchFetch from a remote
pullPull (fetch + merge/rebase)
pushPush to a remote; force_with_lease supported
Workspace (git_workspace)
ActionDescription
stashStash and pop/apply/drop/list/show stash entries
stash_allStash tracked and untracked changes in one operation
rebaseStart, continue, abort, or skip a rebase
cherry_pickApply one or more commits; supports continue/abort/skip
mergeMerge branches with full flag control
bisectBinary search for a regression (start, good, bad, reset, log)
tagCreate, list, delete, or push tags; supports GPG/SSH signing
worktreeAdd, list, remove, lock, unlock, prune, or repair linked worktrees
submoduleAdd, update, sync, init, deinit, and list submodules
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.

OperationDescription
initInitialize a repository with git-flow branch conventions

| overview | Show the current flow state and act

只显示了开头部分;其余内容请在仓库中阅读

问 PopNx