Skip to main content
Glama
git MCP server

git MCP server

Official

mcp-server-git: Git MCP 서버

개요

Git 저장소 상호작용 및 자동화를 위한 Model Context Protocol 서버입니다. 이 서버는 대규모 언어 모델(LLM)을 통해 Git 저장소를 읽고, 검색하고, 조작할 수 있는 도구를 제공합니다.

mcp-server-git은 현재 초기 개발 단계에 있습니다. 서버를 지속적으로 개발하고 개선함에 따라 기능과 사용 가능한 도구는 변경되거나 확장될 수 있습니다.

도구

  1. git_status

    • 작업 트리 상태를 표시합니다.

    • 입력:

      • repo_path (문자열): Git 저장소 경로

    • 반환: 작업 디렉토리의 현재 상태를 텍스트로 출력

  2. git_diff_unstaged

    • 아직 스테이징되지 않은 작업 디렉토리의 변경 사항을 표시합니다.

    • 입력:

      • repo_path (문자열): Git 저장소 경로

      • context_lines (숫자, 선택 사항): 표시할 컨텍스트 라인 수 (기본값: 3)

    • 반환: 스테이징되지 않은 변경 사항의 diff 출력

  3. git_diff_staged

    • 커밋을 위해 스테이징된 변경 사항을 표시합니다.

    • 입력:

      • repo_path (문자열): Git 저장소 경로

      • context_lines (숫자, 선택 사항): 표시할 컨텍스트 라인 수 (기본값: 3)

    • 반환: 스테이징된 변경 사항의 diff 출력

  4. git_diff

    • 브랜치 또는 커밋 간의 차이점을 표시합니다.

    • 입력:

      • repo_path (문자열): Git 저장소 경로

      • target (문자열): 비교할 대상 브랜치 또는 커밋

      • context_lines (숫자, 선택 사항): 표시할 컨텍스트 라인 수 (기본값: 3)

    • 반환: 현재 상태와 대상을 비교한 diff 출력

  5. git_commit

    • 저장소에 변경 사항을 기록합니다.

    • 입력:

      • repo_path (문자열): Git 저장소 경로

      • message (문자열): 커밋 메시지

    • 반환: 새 커밋 해시가 포함된 확인 메시지

  6. git_add

    • 파일 내용을 스테이징 영역에 추가합니다.

    • 입력:

      • repo_path (문자열): Git 저장소 경로

      • files (문자열[]): 스테이징할 파일 경로 배열

    • 반환: 스테이징된 파일 확인 메시지

  7. git_reset

    • 모든 스테이징된 변경 사항을 스테이징 해제합니다.

    • 입력:

      • repo_path (문자열): Git 저장소 경로

    • 반환: 리셋 작업 확인 메시지

  8. git_log

    • 선택적 날짜 필터링과 함께 커밋 로그를 표시합니다.

    • 입력:

      • repo_path (문자열): Git 저장소 경로

      • max_count (숫자, 선택 사항): 표시할 최대 커밋 수 (기본값: 10)

      • start_timestamp (문자열, 선택 사항): 커밋 필터링을 위한 시작 타임스탬프. ISO 8601 형식(예: '2024-01-15T14:30:25'), 상대 날짜(예: '2 weeks ago', 'yesterday'), 또는 절대 날짜(예: '2024-01-15', 'Jan 15 2024')를 허용합니다.

      • end_timestamp (문자열, 선택 사항): 커밋 필터링을 위한 종료 타임스탬프. ISO 8601 형식, 상대 날짜, 또는 절대 날짜를 허용합니다.

    • 반환: 해시, 작성자, 날짜, 메시지가 포함된 커밋 항목 배열

  9. git_create_branch

    • 새 브랜치를 생성합니다.

    • 입력:

      • repo_path (문자열): Git 저장소 경로

      • branch_name (문자열): 새 브랜치 이름

      • base_branch (문자열, 선택 사항): 생성 기준이 될 베이스 브랜치 (기본값은 현재 브랜치)

    • 반환: 브랜치 생성 확인 메시지

  10. git_checkout

  • 브랜치를 전환합니다.

  • 입력:

    • repo_path (문자열): Git 저장소 경로

    • branch_name (문자열): 체크아웃할 브랜치 이름

  • 반환: 브랜치 전환 확인 메시지

  1. git_show

  • 커밋 내용을 표시합니다.

  • 입력:

    • repo_path (문자열): Git 저장소 경로

    • revision (문자열): 표시할 리비전(커밋 해시, 브랜치 이름, 태그)

  • 반환: 지정된 커밋의 내용

  1. git_branch

  • Git 브랜치 목록을 표시합니다.

  • 입력:

    • repo_path (문자열): Git 저장소 경로

    • branch_type (문자열): 로컬 브랜치('local'), 원격 브랜치('remote'), 또는 모든 브랜치('all') 중 선택

    • contains (문자열, 선택 사항): 브랜치가 포함해야 하는 커밋 SHA. 커밋 SHA가 지정되지 않은 경우 이 매개변수에 아무것도 전달하지 마십시오.

    • not_contains (문자열, 선택 사항): 브랜치가 포함하지 않아야 하는 커밋 SHA. 커밋 SHA가 지정되지 않은 경우 이 매개변수에 아무것도 전달하지 마십시오.

  • 반환: 브랜치 목록

Related MCP server: GitHub Tools MCP Server

설치

uv 사용 (권장)

uv를 사용할 때는 별도의 설치가 필요하지 않습니다. uvx를 사용하여 mcp-server-git을 직접 실행합니다.

PIP 사용

또는 pip를 통해 mcp-server-git을 설치할 수 있습니다:

pip install mcp-server-git

설치 후 다음 명령어로 스크립트로 실행할 수 있습니다:

python -m mcp_server_git

구성

Claude Desktop에서 사용

claude_desktop_config.json에 다음을 추가하세요:

"mcpServers": {
  "git": {
    "command": "uvx",
    "args": ["mcp-server-git", "--repository", "path/to/git/repo"]
  }
}
  • 참고: '/Users/username'을 이 도구에서 액세스할 수 있도록 하려는 경로로 바꾸세요.

"mcpServers": {
  "git": {
    "command": "docker",
    "args": ["run", "--rm", "-i", "--mount", "type=bind,src=/Users/username,dst=/Users/username", "mcp/git"]
  }
}
"mcpServers": {
  "git": {
    "command": "python",
    "args": ["-m", "mcp_server_git", "--repository", "path/to/git/repo"]
  }
}

VS Code에서 사용

빠른 설치를 위해 아래의 원클릭 설치 버튼 중 하나를 사용하세요...

Install with UV in VS Code Install with UV in VS Code Insiders

Install with Docker in VS Code Install with Docker in VS Code Insiders

수동 설치의 경우, 다음 방법 중 하나를 사용하여 MCP 서버를 구성할 수 있습니다:

방법 1: 사용자 구성 (권장) 사용자 수준 MCP 구성 파일에 구성을 추가합니다. 명령 팔레트(Ctrl + Shift + P)를 열고 MCP: Open User Configuration을 실행합니다. 그러면 사용자 mcp.json 파일이 열리며, 여기서 서버 구성을 추가할 수 있습니다.

방법 2: 작업 영역 구성 또는 작업 영역의 .vscode/mcp.json 파일에 구성을 추가할 수 있습니다. 이렇게 하면 다른 사람들과 구성을 공유할 수 있습니다.

VS Code의 MCP 구성에 대한 자세한 내용은 공식 VS Code MCP 문서를 참조하세요.

{
  "servers": {
    "git": {
      "command": "uvx",
      "args": ["mcp-server-git"]
    }
  }
}

Docker 설치의 경우:

{
  "mcp": {
    "servers": {
      "git": {
        "command": "docker",
        "args": [
          "run",
          "--rm",
          "-i",
          "--mount", "type=bind,src=${workspaceFolder},dst=/workspace",
          "mcp/git"
        ]
      }
    }
  }
}

Zed에서 사용

Zed의 settings.json에 추가하세요:

"context_servers": [
  "mcp-server-git": {
    "command": {
      "path": "uvx",
      "args": ["mcp-server-git"]
    }
  }
],
"context_servers": {
  "mcp-server-git": {
    "command": {
      "path": "python",
      "args": ["-m", "mcp_server_git"]
    }
  }
},

Zencoder에서 사용

  1. Zencoder 메뉴(...)로 이동합니다.

  2. 드롭다운 메뉴에서 Agent Tools를 선택합니다.

  3. Add Custom MCP를 클릭합니다.

  4. 이름(예: git)과 아래의 서버 구성을 추가하고 Install 버튼을 누르세요.

{
    "command": "uvx",
    "args": ["mcp-server-git", "--repository", "path/to/git/repo"]
}

디버깅

MCP 인스펙터를 사용하여 서버를 디버깅할 수 있습니다. uvx 설치의 경우:

npx @modelcontextprotocol/inspector uvx mcp-server-git

또는 특정 디렉토리에 패키지를 설치했거나 개발 중인 경우:

cd path/to/servers/src/git
npx @modelcontextprotocol/inspector uv run mcp-server-git

tail -n 20 -f ~/Library/Logs/Claude/mcp*.log를 실행하면 서버 로그가 표시되어 문제를 디버깅하는 데 도움이 될 수 있습니다.

개발

로컬 개발을 수행하는 경우 변경 사항을 테스트하는 두 가지 방법이 있습니다:

  1. MCP 인스펙터를 실행하여 변경 사항을 테스트합니다. 실행 지침은 디버깅을 참조하세요.

  2. Claude 데스크톱 앱을 사용하여 테스트합니다. claude_desktop_config.json에 다음을 추가하세요:

Docker

{
  "mcpServers": {
    "git": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "--mount", "type=bind,src=/Users/username/Desktop,dst=/projects/Desktop",
        "--mount", "type=bind,src=/path/to/other/allowed/dir,dst=/projects/other/allowed/dir,ro",
        "--mount", "type=bind,src=/path/to/file.txt,dst=/projects/path/to/file.txt",
        "mcp/git"
      ]
    }
  }
}

UVX

{
"mcpServers": {
  "git": {
    "command": "uv",
    "args": [
      "--directory",
      "/<path to mcp-servers>/mcp-servers/src/git",
      "run",
      "mcp-server-git"
    ]
    }
  }
}

빌드

Docker 빌드:

cd src/git
docker build -t mcp/git .

라이선스

이 MCP 서버는 MIT 라이선스에 따라 라이선스가 부여됩니다. 이는 MIT 라이선스의 약관에 따라 소프트웨어를 자유롭게 사용, 수정 및 배포할 수 있음을 의미합니다. 자세한 내용은 프로젝트 저장소의 LICENSE 파일을 참조하세요.

Available Tools

14 tools
git_addC
Idempotent

Adds file contents to the staging area

Inputs: files (required), repo_path (required).

git_branchC
Read-onlyIdempotent

List Git branches

Inputs: repo_path (required), branch_type (required), contains, not_contains.

git_checkoutC

Switches branches

Inputs: repo_path (required), branch_name (required).

git_commitD

Records changes to the repository

Inputs: message (required), repo_path (required).

git_create_branchC

Creates a new branch from an optional base branch or commit

Inputs: repo_path (required), branch_name (required), base_branch.

git_diffB
Read-onlyIdempotent

Shows differences between branches or commits, or across a revision range (main..feature, main...feature)

Inputs: target (required), repo_path (required), context_lines.

git_diff_stagedB
Read-onlyIdempotent

Shows changes that are staged for commit

Inputs: repo_path (required), context_lines.

git_diff_unstagedB
Read-onlyIdempotent

Shows changes in the working directory that are not yet staged

Inputs: repo_path (required), context_lines.

git_logA
Read-onlyIdempotent

Shows the commit log, newest commit first. For the latest commits, pass only repo_path (and optionally max_count). start_timestamp and end_timestamp are optional filters for a date range: omit them unless a specific period is asked for, because a range that holds no commits returns none.

Inputs: repo_path (required), max_count, end_timestamp, start_timestamp.

git_mergeA
Idempotent

Merges a branch into the current branch. Fast-forward only unless fast_forward_only is false; refuses a dirty working tree, and aborts a merge that conflicts, leaving the repository unchanged

Inputs: repo_path (required), source_branch (required), fast_forward_only.

git_remoteA
Read-onlyIdempotent

Lists the repository's remotes with their fetch and push URLs, like git remote -v. Credentials embedded in a URL's userinfo, query values or fragment are shown as ; path segments are shown as configured

Inputs: repo_path (required).

git_resetB
DestructiveIdempotent

Unstages all staged changes

Inputs: repo_path (required).

git_showB
Read-onlyIdempotent

Shows the contents of a commit, or of a file or directory given as :

Inputs: revision (required), repo_path (required).

git_statusB
Read-onlyIdempotent

Shows the working tree status

Inputs: repo_path (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 14 tools

    Disambiguation4/5

    Each tool maps to a recognizable git operation with mostly distinct targets: the three diff variants (git_diff, git_diff_staged, git_diff_unstaged) are the closest overlap, but their descriptions clearly scope each one. git_branch (list) vs git_create_branch (create) vs git_checkout (switch) are distinguishable, though an agent could occasionally reach for the wrong branch tool. No two tools appear to do the same thing.

    Naming Consistency4/5

    All 14 names share a uniform `git_` prefix and snake_case, and most mirror familiar git CLI verbs (log, show, checkout, merge, commit, add, reset). A few are noun-only (git_branch, git_status, git_remote) which deviates slightly from a strict verb_noun pattern, but this matches git conventions and stays predictable.

    Tool Count5/5

    14 tools sit squarely in the well-scoped range: one tool per core local git workflow (status, diff variants, add, commit, log, show, branch, checkout, merge, remote). Nothing feels redundant or padded.

    Completeness3/5

    Local read/write coverage is solid, but the lifecycle dead-ends at the remote boundary: there is no push, pull, or fetch, and no branch deletion, stash, tag, or remote-management operation. Merge and git_remote imply remote collaboration, so the missing publishing step is a notable gap an agent will hit.

    Maintenance

    ActivityActive
    ResponsivenessSyncing

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      A Model Context Protocol server that enables Large Language Models to interact with Git repositories through a robust API, supporting operations like repository initialization, cloning, file staging, committing, and branch management.
      28
      6,847 npm
      246
      Apache 2.0
    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that enables LLMs to interact with Git repositories, providing tools to read, search, and manipulate Git repositories through commands like status, diff, commit, and branch management.
      12
      MIT
    • A
      license
      C
      quality
      B
      maintenance
      A Model Context Protocol server that enables LLMs to interact with Git repositories, providing tools to read, search, and manipulate Git repositories through commands like status, diff, commit, and branch operations.
      22
      4
      MIT