/ 디렉터리 / 플레이그라운드 / git-mcp-server
● 커뮤니티 cyanheads ⚡ 바로 사용

git-mcp-server

제작: cyanheads · cyanheads/git-mcp-server

A git MCP with teeth — 28 tools including worktrees, stash, reflog, GPG signing, and session-scoped working directories so Claude can operate across multiple repos safely.

Where the reference git MCP covers the basics, cyanheads/git-mcp-server goes deeper. Worktree management, optional commit signing, path sandboxing, session-isolated working directories, and response format control (JSON vs Markdown) make it a good fit for multi-repo agents and enterprise workflows.

왜 쓰나요

핵심 기능

라이브 데모

실제 사용 모습

git-2.replay ▶ 준비됨
0/0

설치

클라이언트 선택

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "git-2": {
      "command": "npx",
      "args": [
        "-y",
        "git-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Claude Desktop → Settings → Developer → Edit Config 열기. 저장 후 앱 재시작.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "git-2": {
      "command": "npx",
      "args": [
        "-y",
        "git-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Cursor는 Claude Desktop과 동일한 mcpServers 스키마 사용. 프로젝트 설정이 전역보다 우선.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "git-2": {
      "command": "npx",
      "args": [
        "-y",
        "git-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Cline 사이드바의 MCP Servers 아이콘 클릭 후 "Edit Configuration" 선택.

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "git-2": {
      "command": "npx",
      "args": [
        "-y",
        "git-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Claude Desktop과 같은 형식. Windsurf 재시작 후 적용.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "git-2",
      "command": "npx",
      "args": [
        "-y",
        "git-mcp-server"
      ]
    }
  ]
}

Continue는 맵이 아닌 서버 오브젝트 배열 사용.

~/.config/zed/settings.json
{
  "context_servers": {
    "git-2": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "git-mcp-server"
        ]
      }
    }
  }
}

context_servers에 추가. 저장 시 Zed가 핫 리로드.

claude mcp add git-2 -- npx -y git-mcp-server

한 줄 명령. claude mcp list로 확인, claude mcp remove로 제거.

사용 사례

실전 활용법: git-mcp-server

Apply the same refactor across 10 repos in a monorepo-adjacent org

👤 Platform engineers, devrel ⏱ ~45 min advanced

언제 쓸까: You need to bump a dependency or rename an import across many repos and don't want to clone and context-switch manually.

사전 조건
  • Local clones or write access — SSH keys configured
흐름
  1. Enumerate repos
    List every repo under ~/code/acme. For each, switch working directory, run git_status, and tell me the current branch.✓ 복사됨
    → Per-repo status
  2. Branch and apply change
    In each repo, create branch 'chore/bump-foo', bump foo from 1.x to 2.x in package.json, commit with message 'chore: bump foo', push, and open a PR (via github MCP).✓ 복사됨
    → PR URLs for each repo

결과: Cross-repo change dispatched in one conversation.

함정
  • Commit storm — a bad refactor now lives in 10 PRs — Test on one repo first; only then dispatch to the rest
  • Sign-off / DCO required but unsigned — Enable GIT_SIGN_COMMITS and set GIT_USERNAME/GIT_EMAIL
함께 쓰기: github · filesystem

Generate release notes from git log between two tags

👤 Release managers ⏱ ~20 min intermediate

언제 쓸까: Cutting a release and want the changelog written from actual commits, not memory.

흐름
  1. Fetch tags and diff
    Switch to repo ~/code/acme/api. Fetch, then git_log from tag v1.4.0 to HEAD. Group by conventional-commit type.✓ 복사됨
    → Grouped commit list
  2. Draft notes
    Write release notes in keep-a-changelog format, highlighting breaking changes and contributors.✓ 복사됨
    → Markdown changelog draft
  3. Tag the release
    Create tag v1.5.0 with these release notes as the tag message. Sign it.✓ 복사됨
    → Signed tag created

결과: Release published with accurate, readable notes.

함정
  • Commit messages are garbage → release notes are garbage — Enforce conventional commits in CI before this step
함께 쓰기: github

Clean up a feature branch before merge (squash + reword)

👤 Devs with messy WIP branches ⏱ ~15 min intermediate

언제 쓸까: You have 14 commits on a feature branch: 'wip', 'fix', 'more fix', 'actually fix it'. You want to squash into 3 logical commits before opening the PR.

흐름
  1. Inspect
    Show git_log for branch 'feat/payments' since it diverged from main.✓ 복사됨
    → Commit list
  2. Plan the squash
    Propose a 3-commit rewrite plan grouping related work. Don't execute yet.✓ 복사됨
    → Plan with commit boundaries + messages
  3. Execute via reset + fresh commits
    Execute the plan using git_reset --soft to the merge-base, then git_add + git_commit in 3 logical chunks per the plan.✓ 복사됨
    → 3-commit linear history

결과: A reviewable PR history.

함정
  • Destructive — force-push overwrites collaborators' work — Only do this on solo feature branches; never on shared branches

조합

다른 MCP와 조합해 10배 효율

git-2 + github

git_commit + git_push + open PR in one flow

Commit staged changes with message 'X', push, then open a PR on GitHub targeting main.✓ 복사됨
git-2 + filesystem

Edit files then commit atomically

Edit src/index.ts replacing foo with bar, git_add the file, git_commit.✓ 복사됨

도구

이 MCP가 노출하는 것

도구입력언제 호출비용
git_status cwd?: str First step in any session; verify repo state free
git_log cwd?, range?, max_count? Inspect history; use range for release diffs free
git_diff cwd?, target?, staged?: bool Review changes before committing free
git_add cwd?, paths[] Stage specific files — avoid . to prevent sensitive file leaks free
git_commit cwd?, message, sign?: bool Create a commit; destructive-ish, so confirm first free
git_branch cwd?, action: list|create|delete|rename, name? Manage branches free
git_worktree cwd?, action: add|list|remove, path?, branch? Juggle multiple branches without switching free
git_push cwd?, remote?, branch?, force?: bool Publish commits; force is destructive — default to false network
set_working_directory path: str Switch the session's active repo free

비용 및 제한

운영 비용

API 쿼터
None — all local
호출당 토큰
git_log/diff outputs can be huge; cap with max_count / paths
금액
Free, Apache 2.0
Use max_count on git_log and specific paths on git_diff. Full-history log on a big repo = 50k+ tokens.

보안

권한, 시크릿, 파급범위

최소 스코프: Local filesystem access to the repos you want managed
자격 증명 저장: SSH keys in ~/.ssh; set GIT_BASE_DIR to sandbox the MCP
데이터 외부 송신: git push sends to your configured remotes
절대 부여 금지: Force push to main/master without confirmation

문제 해결

자주 발생하는 오류와 해결

Permission denied (publickey) on push

SSH key not available to the MCP process. Start ssh-agent with your key loaded.

확인: ssh -T [email protected]
Operation outside base directory rejected

You set GIT_BASE_DIR; the requested path escapes it. Move the repo into the base dir or widen it.

Commit signing fails

GPG/SSH signing key not configured. Check git config --get user.signingkey and gpg --list-secret-keys.

확인: git commit -S -m test in the repo directly
Wrong repo operated on

Session cwd not set. Always start a session with set_working_directory or pass cwd per call.

확인: Call git_status and inspect the returned path

대안

git-mcp-server 다른 것과 비교

대안언제 쓰나단점/장점
Official git MCPYou only need basic git ops and want the reference implementationFewer tools; no session cwd or signing
GitHub MCPYour workflow is PR-centric and lives on GitHubOperates on GitHub API, not local git; complementary

더 보기

리소스

📖 GitHub에서 공식 README 읽기

🐙 열린 이슈 보기

🔍 400+ MCP 서버 및 Skills 전체 보기