Skip to main content
Glama
Git Repo Browser MCP

Git Repo Browser MCP

by bsreeram08

MCP Git 리포 브라우저(Node.js)

MCP(Model Context Protocol)를 사용하는 Git 저장소 브라우저의 Node.js 구현입니다.

GitHub 저장소 npm 패키지

설치

NPM(추천)

지엑스피1

수동 설치

git clone https://github.com/bsreeram08/git-commands-mcp.git
cd git-commands-mcp
npm install

Related MCP server: MCP Git Repo Browser

구성

MCP 설정 구성 파일에 다음을 추가하세요.

{
  "mcpServers": {
    "git-commands-mcp": {
      "command": "git-commands-mcp"
    }
  }
}

수동 설치의 경우 다음을 사용하세요.

{
  "mcpServers": {
    "git-commands-mcp": {
      "command": "node",
      "args": ["/path/to/git-commands-mcp/src/index.js"]
    }
  }
}

특징

서버는 다음과 같은 도구를 제공합니다.

기본 저장소 작업

  1. git_directory_structure : 저장소의 디렉토리 구조를 트리 형태로 표현한 것을 반환합니다.

    • 입력: 저장소 URL

    • 출력: 저장소 구조의 ASCII 트리 표현

  2. git_read_files : 저장소에 있는 지정된 파일의 내용을 읽고 반환합니다.

    • 입력: 저장소 URL 및 파일 경로 목록

    • 출력: 파일 경로를 해당 내용에 매핑하는 사전

  3. git_search_code : 저장소 코드에서 패턴을 검색합니다.

    • 입력: 저장소 URL, 검색 패턴, 선택적 파일 패턴, 대소문자 구분 및 컨텍스트 줄

    • 출력: 일치하는 줄과 컨텍스트를 포함한 검색 결과가 포함된 JSON

지점 운영

  1. git_branch_diff : 두 개의 브랜치를 비교하고 두 브랜치 사이에서 변경된 파일을 표시합니다.

    • 입력: 저장소 URL, 소스 브랜치, 대상 브랜치 및 선택적 show_patch 플래그

    • 출력: 커밋 수와 diff 요약이 포함된 JSON

커밋 작업

  1. git_commit_history : 선택적 필터링을 사용하여 브랜치의 커밋 기록을 가져옵니다.

    • 입력: 저장소 URL, 브랜치 이름, 최대 개수, 작성자 필터, 시작일, 종료일 및 메시지 grep

    • 출력: 커밋 세부 정보가 포함된 JSON

  2. git_commits_details : 전체 메시지와 diff를 포함한 커밋에 대한 자세한 정보를 가져옵니다.

    • 입력: 저장소 URL, 브랜치 이름, 최대 개수, include_diff 플래그, 작성자 필터, 시작일, 종료일 및 메시지 grep

    • 출력: 자세한 커밋 정보가 포함된 JSON

  3. git_local_changes : 작업 디렉토리에서 커밋되지 않은 변경 사항을 가져옵니다.

    • 입력: 로컬 저장소 경로

    • 출력: 상태 정보 및 차이점이 포함된 JSON

프로젝트 구조

git-commands-mcp/
├── src/
│   ├── index.js         # Entry point
│   ├── server.js        # Main server implementation
│   ├── handlers/        # Tool handlers
│   │   └── index.js     # Tool implementation functions
│   └── utils/           # Utility functions
│       └── git.js       # Git-related helper functions
├── package.json
└── readme.md

구현 세부 사항

  • 핵심 기능을 위해 Node.js 네이티브 모듈(crypto, path, os)을 사용합니다.

  • 향상된 파일 작업을 위해 fs-extra를 활용합니다.

  • Git 저장소 작업에 simple-git을 사용합니다.

  • 깔끔한 오류 처리 및 리소스 정리를 구현합니다.

  • 저장소 URL 해시를 기반으로 결정론적 임시 디렉토리를 생성합니다.

  • 효율성을 위해 가능한 경우 복제된 저장소를 재사용합니다.

  • 더 나은 유지 관리를 위한 모듈식 코드 구조

요구 사항

  • Node.js 14.x 이상

  • 시스템에 Git 설치

용법

npm을 통해 전역적으로 설치하는 경우:

git-commands-mcp

수동으로 설치한 경우:

node src/index.js

서버는 stdio에서 실행되므로 MCP 클라이언트와 호환됩니다.

CI/CD

이 프로젝트에서는 지속적인 통합 및 배포를 위해 GitHub Actions를 사용합니다.

자동 NPM 게시

저장소는 변경 사항이 마스터 브랜치에 푸시되면 자동으로 패키지를 npm에 게시하는 GitHub Actions 워크플로로 구성됩니다.

NPM_AUTOMATION_TOKEN 설정

자동 게시를 활성화하려면 npm Automation 토큰을 GitHub 비밀번호로 추가해야 합니다(2FA가 활성화된 계정에서도 작동합니다).

  1. npm 자동화 토큰을 생성합니다.

    • npmjs.com 에서 npm 계정에 로그인하세요

    • 프로필 설정으로 이동하세요

    • "액세스 토큰"을 선택하세요

    • "새로운 토큰 생성"을 클릭하세요

    • "자동화" 토큰 유형을 선택하세요

    • 적절한 권한을 설정합니다(패키지에 대해 "읽기 및 쓰기" 권한이 필요함)

    • 생성된 토큰을 복사하세요

  2. GitHub 저장소에 토큰을 추가합니다.

    • GitHub 저장소로 이동하세요

    • "설정" > "비밀 및 변수" > "작업"으로 이동합니다.

    • "새로운 저장소 비밀"을 클릭하세요

    • 이름: NPM_AUTOMATION_TOKEN

    • 값: npm 자동화 토큰을 붙여넣으세요

    • "비밀 추가"를 클릭하세요

구성이 완료되면, 마스터 브랜치에 푸시를 하면 npm에 패키지를 게시하는 워크플로가 트리거됩니다.

특허

MIT 라이센스 - 자세한 내용은 LICENSE 파일을 참조하세요.

모래밭

Available Tools

27 tools
git_archiveC

Create a git archive (zip or tar).

Inputs: repo_path (required), output_path (required), format, prefix, +1 more.

git_attributesC

Manage git attributes for files.

Inputs: repo_path (required), action (required), pattern, attribute.

git_blameC

Get blame information for a file.

Inputs: repo_path (required), file_path (required), rev.

git_branch_diffC

Compare two branches and show files changed between them.

Inputs: repo_url (required), source_branch (required), target_branch (required), show_patch.

git_checkout_branchC

Create and/or checkout a branch.

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

git_cleanC

Perform git clean operations.

Inputs: repo_path (required), directories, force, dry_run.

git_commitC

Create a commit with the specified message.

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

git_commit_historyB

Get commit history for a branch with optional filtering.

Inputs: repo_url (required), branch, max_count, author, +3 more.

git_commits_detailsC

Get detailed information about commits including full messages and diffs.

Inputs: repo_url (required), branch, max_count, include_diff, +4 more.

git_configC

Configure git settings for the repository.

Inputs: repo_path (required), key (required), value (required), scope.

git_create_tagC

Create a tag.

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

git_delete_branchC

Delete a branch from the repository.

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

git_directory_structureC

Clone a Git repository and return its directory structure in a tree format.

Inputs: repo_url (required).

git_hooksC

Manage git hooks in the repository.

Inputs: repo_path (required), action (required), hook_name, script.

git_lfsC

Manage Git LFS (Large File Storage).

Inputs: repo_path (required), action (required), patterns.

git_lfs_fetchC

Fetch LFS objects from the remote repository.

Inputs: repo_path (required), dry_run, pointers.

git_local_changesC

Get uncommitted changes in the working directory.

Inputs: repo_path (required).

git_merge_branchC

Merge a source branch into the current or target branch.

Inputs: repo_path (required), source_branch (required), target_branch, no_fast_forward.

git_pullC

Pull changes from a remote repository.

Inputs: repo_path (required), remote, branch, rebase.

git_pushC

Push changes to a remote repository.

Inputs: repo_path (required), remote, branch, force.

git_read_filesC

Read the contents of specified files in a given git repository.

Inputs: repo_url (required), file_paths (required).

git_rebaseC

Rebase the current branch onto another branch or commit.

Inputs: repo_path (required), onto (required), interactive.

git_resetC

Reset repository to specified commit or state.

Inputs: repo_path (required), mode, to.

git_revertC

Revert the current branch to a commit or state.

Inputs: repo_path (required), commit, no_commit.

git_search_codeC

Search for patterns in repository code.

Inputs: repo_url (required), pattern (required), file_patterns, case_sensitive, +1 more.

git_stashC

Create or apply a stash.

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

git_trackC

Track (stage) specific files or all files.

Inputs: repo_path (required), files.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 27 tools

    Disambiguation4/5

    Most tools have distinct purposes targeting specific Git operations, but some overlap exists. For example, git_commit_history and git_commits_details both handle commit information retrieval, and git_clean and git_reset both involve repository state management, which could cause minor confusion. However, descriptions clarify their specific focuses, keeping ambiguity manageable.

    Naming Consistency5/5

    All tool names follow a consistent snake_case pattern with a 'git_' prefix and descriptive verb_noun combinations. Examples include git_checkout_branch, git_merge_branch, and git_search_code. This uniformity makes the tool set predictable and easy to navigate for an agent.

    Tool Count2/5

    With 27 tools, the count is excessive for a Git repository browser. Many tools cover niche or low-level operations that could be consolidated, such as git_lfs and git_lfs_fetch, or git_attributes and git_hooks. This bloated set may overwhelm agents and complicate task selection.

    Completeness5/5

    The tool set provides comprehensive coverage of Git operations, including cloning, branching, committing, merging, searching, and configuration. It supports full CRUD and lifecycle management for repositories, with no obvious gaps. Agents can perform end-to-end workflows without dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      A Model Context Protocol server for Git repository interaction and automation. This server provides tools to read, search, and manipulate Git repositories via Large Language Models.
      14
      115,976 PyPI
      92,301
      MIT
    • 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
      C
      quality
      C
      maintenance
      Node.js server implementing Model Context Protocol for git operations, enabling AI assistants to manage git repositories through natural language commands.
      11
      MIT