git-mcp-server

git-mcp-server

3.1

If you are the rightful owner of git-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

GIT-MCP-SERVER is a Model Context Protocol (MCP) Stdio server that integrates with LLM Agents to provide Git-related functionalities using Python.

GIT-MCP-SERVER

LLM Agent와 연동 κ°€λŠ₯ν•œ Model Context Protocol (MCP) Stdio μ„œλ²„μž…λ‹ˆλ‹€.

ν”„λ‘œμ νŠΈ μ„€λͺ…

이 ν”„λ‘œμ νŠΈλŠ” LLM Agentκ°€ Git κ΄€λ ¨ κΈ°λŠ₯을 ν™œμš©ν•  수 μžˆλ„λ‘ Python 기반의 Git κ΄€λ ¨ κΈ°λŠ₯듀을 μ œκ³΅ν•©λ‹ˆλ‹€.

μ£Όμš” κΈ°λŠ₯

  • μ €μž₯μ†Œ μƒνƒœ 쑰회
  • 컀밋 생성 및 관리
  • ν‘Έμ‹œ / ν’€
  • 브랜치 생성 / 이동 / 병합
  • 컀밋 νžˆμŠ€ν† λ¦¬ 쑰회
  • 변경사항 톡계
  • νƒœκ·Έ 관리
  • 원격 μ €μž₯μ†Œ 관리
  • ν’€ λ¦¬ν€˜μŠ€νŠΈ 관리

μ„€μΉ˜ 방법

  1. μ €μž₯μ†Œ 클둠
git clone https://github.com/yourusername/git-mcp-server.git
cd git-mcp-server
  1. κ°€μƒν™˜κ²½ 생성 및 ν™œμ„±ν™”
python -m venv venv
source venv/bin/activate  # Linux/Mac
# λ˜λŠ”
.\venv\Scripts\activate  # Windows
  1. μ˜μ‘΄μ„± μ„€μΉ˜
pip install -r requirements.txt
  1. ν™˜κ²½ λ³€μˆ˜ μ„€μ • .env νŒŒμΌμ„ μƒμ„±ν•˜κ³  λ‹€μŒ λ‚΄μš©μ„ μΆ”κ°€ν•©λ‹ˆλ‹€:
GIT_REPO_PATH=/path/to/your/git/repository
GITHUB_TOKEN=your_github_personal_access_token  # GitHub API μ‚¬μš© μ‹œ ν•„μš”

MCP μ„€μ •

MCP μ„€μ • νŒŒμΌμ— λ‹€μŒκ³Ό 같이 μΆ”κ°€ν•©λ‹ˆλ‹€:

{
  "git-mcp-server": {
    "transport": "stdio",
    "command": "/path/to/your/venv/bin/python",
    "args": ["/path/to/your/git-mcp-server/main.py"],
    "env": {
      "GIT_REPO_PATH": "/path/to/your/git/repository",
      "GITHUB_TOKEN": "your_github_personal_access_token"
    }
  }
}

μ‚¬μš© 방법

μ„œλ²„ μ‹€ν–‰:

python main.py

μ‚¬μš© κ°€λŠ₯ν•œ λͺ…λ Ήμ–΄

  1. μ €μž₯μ†Œ μƒνƒœ 쑰회
{
    "command": "get_repo_status"
}
  1. 변경사항 컀밋
{
    "command": "commit_changes",
    "params": {
        "message": "컀밋 λ©”μ‹œμ§€",
        "files": ["file1.txt", "file2.txt"]  // 선택사항
    }
}
  1. 변경사항 ν‘Έμ‹œ
{
    "command": "push_changes",
    "params": {
        "remote": "origin",  // 선택사항
        "branch": "main"     // 선택사항
    }
}
  1. 변경사항 ν’€
{
    "command": "pull_changes",
    "params": {
        "remote": "origin",  // 선택사항
        "branch": "main"     // 선택사항
    }
}
  1. 브랜치 생성
{
    "command": "create_branch",
    "params": {
        "branch_name": "feature/new-branch"
    }
}
  1. 브랜치 μ „ν™˜
{
    "command": "switch_branch",
    "params": {
        "branch_name": "feature/new-branch"
    }
}
  1. 브랜치 병합
{
    "command": "merge_branch",
    "params": {
        "source_branch": "feature/new-branch"
    }
}
  1. 컀밋 νžˆμŠ€ν† λ¦¬ 쑰회
{
    "command": "get_commit_history",
    "params": {
        "limit": 10  // 선택사항
    }
}
  1. 브랜치 정보 쑰회
{
    "command": "get_branch_info"
}
  1. 변경사항 톡계 쑰회
{
    "command": "get_diff_stats"
}
  1. νƒœκ·Έ 생성
{
    "command": "create_tag",
    "params": {
        "tag_name": "v1.0.0",
        "message": "릴리슀 버전 1.0.0",  // 선택사항
        "commit_hash": "abc123"  // 선택사항
    }
}
  1. νƒœκ·Έ λͺ©λ‘ 쑰회
{
    "command": "list_tags"
}
  1. νƒœκ·Έ μ‚­μ œ
{
    "command": "delete_tag",
    "params": {
        "tag_name": "v1.0.0",
        "remote": true  // 선택사항, 원격 μ €μž₯μ†Œμ—μ„œλ„ μ‚­μ œν• μ§€ μ—¬λΆ€
    }
}
  1. 원격 μ €μž₯μ†Œ λͺ©λ‘ 쑰회
{
    "command": "list_remotes"
}
  1. 원격 μ €μž₯μ†Œ μΆ”κ°€
{
    "command": "add_remote",
    "params": {
        "name": "upstream",
        "url": "https://github.com/original/repo.git"
    }
}
  1. 원격 μ €μž₯μ†Œ 제거
{
    "command": "remove_remote",
    "params": {
        "name": "upstream"
    }
}
  1. 원격 μ €μž₯μ†Œ URL λ³€κ²½
{
    "command": "set_remote_url",
    "params": {
        "name": "origin",
        "url": "https://github.com/new/repo.git"
    }
}
  1. ν’€ λ¦¬ν€˜μŠ€νŠΈ 생성
{
    "command": "create_pull_request",
    "params": {
        "title": "μƒˆλ‘œμš΄ κΈ°λŠ₯ μΆ”κ°€",
        "body": "이 PR은 μƒˆλ‘œμš΄ κΈ°λŠ₯을 μΆ”κ°€ν•©λ‹ˆλ‹€.",
        "head": "feature/new-feature",
        "base": "main",  // 선택사항
        "repo_owner": "username",  // 선택사항
        "repo_name": "repo-name"  // 선택사항
    }
}
  1. ν’€ λ¦¬ν€˜μŠ€νŠΈ λͺ©λ‘ 쑰회
{
    "command": "list_pull_requests",
    "params": {
        "state": "open",  // 선택사항: open, closed, all
        "repo_owner": "username",  // 선택사항
        "repo_name": "repo-name"  // 선택사항
    }
}
  1. ν’€ λ¦¬ν€˜μŠ€νŠΈ 상세 쑰회
{
    "command": "get_pull_request",
    "params": {
        "pull_number": 123,
        "repo_owner": "username",  // 선택사항
        "repo_name": "repo-name"  // 선택사항
    }
}
  1. ν’€ λ¦¬ν€˜μŠ€νŠΈ μ—…λ°μ΄νŠΈ
{
    "command": "update_pull_request",
    "params": {
        "pull_number": 123,
        "title": "μˆ˜μ •λœ 제λͺ©",  // 선택사항
        "body": "μˆ˜μ •λœ λ‚΄μš©",  // 선택사항
        "state": "open",  // 선택사항: open, closed
        "repo_owner": "username",  // 선택사항
        "repo_name": "repo-name"  // 선택사항
    }
}
  1. ν’€ λ¦¬ν€˜μŠ€νŠΈ 병합
{
    "command": "merge_pull_request",
    "params": {
        "pull_number": 123,
        "merge_method": "merge",  // 선택사항: merge, squash, rebase
        "commit_title": "병합 컀밋 제λͺ©",  // 선택사항
        "commit_message": "병합 컀밋 λ©”μ‹œμ§€",  // 선택사항
        "repo_owner": "username",  // 선택사항
        "repo_name": "repo-name"  // 선택사항
    }
}

λΌμ΄μ„ μŠ€

MIT License