MCP.so
登录
G

Git MCP Server

@selfagency

基本信息

分类

版本控制

传输方式

stdio

作者

selfagency

提交者

Daniel Sieradski

关于 Git MCP Server

暂无概览

Git MCP Server 配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "git": {
      "command": "npx",
      "args": [
        "-y",
        "@selfagency/git-mcp@latest"
      ],
      "env": {
        "GIT_REPO_PATH": "/path/to/your/repo"
      }
    }
  }
}

Git MCP Server 工具

12

Status and diff tool. Use action=status|diff|diff_main to inspect working tree and branch deltas.

History tool. Use action=log|show|reflog|blame|lg|who to inspect commits, refs, and contributors.

Commit-area tool. Use action=add|restore|commit|reset|revert|undo|nuke|wip|unstage|amend.

Branch tool. Use action=list|create|delete|rename|checkout|set_upstream|recent for branch workflows.

Remote tool. Use action=list|manage|fetch|pull|push for network/transport operations.

Workspace tool for stash/rebase/cherry-pick/merge/bisect/tag/worktree/submodule actions plus stash_all shortcut.

Context/config tool. Use action=summary|search|get_config|set_config|aliases for repo context operations.

Manage Git Large File Storage (LFS). Supports tracking/untracking file patterns, listing LFS-tracked files and status, pulling/pushing LFS objects, installing LFS hooks for the repository, and migrating existing files into or out of LFS storage.

Implements git-flow-next-style workflows directly, without requiring the external CLI. The canonical contract uses operation=config/topic/control with subactions, while legacy alias actions remain supported for compatibility. Supports preset init, overview, config CRUD, generalized topic lifecycle operations, and finish recovery.

Run named multi-step Git workflows with resumable lifecycle controls. Use action=start|status|continue|abort|list with workflow families such as snapshot, replay, branch_surgery, and publish.

Search and browse official Git documentation from git-scm.com. Use action="search" to find relevant commands and concepts by keyword. Use action="man" to fetch the full man page for a specific git command (e.g. query="commit" fetches the git-commit man page). Useful for answering questions about how to use git commands, understanding options, and discovering the right git command for a task.

Returns a simple response to verify the server is running.

概览

What is Git MCP?

Git MCP is a Git server for the Model Context Protocol that exposes the full Git workflow—inspect, write, branch, remote, stash, rebase, LFS, git-flow, and documentation lookup—to any MCP-compatible AI agent. It is built for coding agents in tools like GitHub Copilot, Claude Code, Cursor, and OpenAI Codex.

How to use Git MCP?

Run directly via npx with no installation, or install globally with npm. The repository path is set with the --repo-path CLI argument or the GIT_REPO_PATH environment variable, with a per-call override option. Additional safety and signing behavior is configured through environment variables.

Key features of Git MCP

  • 11 grouped tools with over 60 actions for everyday Git workflows
  • Safety-first: destructive operations require explicit confirmation
  • GPG/SSH signing support for commits and tags
  • Git LFS and Git Flow workflow support without external CLIs
  • Documentation lookup from git-scm.com and man pages
  • URI-addressable read-only MCP Resources for status, log, branches, and diff

Use cases of Git MCP

  • Inspecting repository state and searching history through an AI agent
  • Automating branching, staging, committing, and pushing via coding assistants
  • Performing recovery operations like reflog inspection, undo, and reset
  • Managing Git Flow or LFS workflows without installing separate CLI tools
  • Fetching Git documentation and man pages from within an LLM

常见问题

1

What are the runtime requirements?

Node.js and a local Git installation. The server is powered by `simple-git` and cross-platform on macOS, Linux, and Windows (Git for Windows).

2

How does the server handle destructive operations?

Destructive operations require explicit confirmation. Force push and hook bypass are opt-in via environment variables that default to `false`.

3

How is the repository path configured?

Pass `--repo-path` on the CLI or set `GIT_REPO_PATH` as an environment variable. The `repo_path` can also be overridden per-call.

4

What MCP transport does the server use?

The server communicates over stdio, making it compatible with any MCP client that can call tools and resources.

5

Does the server support commit and tag signing?

Yes. GPG/SSH signing is supported for commits and tags, with optional server-level auto-sign via environment variables.

评论

版本控制 分类下的更多 MCP 服务器