Skip to main content
Glama
Cross Repo Ops MCP

Cross Repo Ops MCP

by DHCross

Cross Repo Ops MCP

제어된 로컬 저장소 작업을 위한 저장소 중립적 MCP(Model Context Protocol) 기능 계층입니다.

기능

Cross Repo Ops MCP는 로컬 git 저장소에 대한 제한적이고 정책 기반의 작업을 노출하는 보안 강화 stdio JSON-RPC 서버를 제공합니다:

  • 읽기: 트리 목록, ripgrep 검색, 제한된 파일 읽기, git status/diff

  • 쓰기: create/modify를 지원하는 컨텍스트 검증 패치(쓰기 가능한 저장소만)

  • 작업: 승인된 명명된 작업 실행(허용 목록 전용, 임의 셸 없음)

  • Git: 브랜치 목록/생성/전환, 커밋(명시적 파일만), 푸시(origin만, 푸시 가능한 저장소만)

Related MCP server: git-remote-mcp

아키텍처

Cross Repo Ops MCP는 제어된 로컬 저장소 작업을 위한 저장소 중립적 기능 계층입니다. XcodeIDEapp 프로젝트 옆에 위치하도록 설계되었으며, IDE 대시보드 스캐폴딩 패턴에서 아이디어를 차용했지만, 범용적으로 유지되며 특정 IDE나 프로젝트 구조에 의존하지 않습니다.

Cross Repo Ops MCP = controlled local repository actions (read, patch, git, tasks)

서버는 정책 기반으로 동작합니다: 저장소, 기능, 제외 경로, 승인된 작업이 모두 JSON 구성에 선언됩니다. 핵심에는 프로젝트별 로직이 하드코딩되어 있지 않습니다.

모듈

모듈

역할

policy.py

중앙 집중식 저장소 기능 정책(허용 목록, 쓰기/푸시 가능 플래그, 제외 경로, 작업 허용 목록, 제한, 시간 제한)

guard.py

단일 권위 있는 경로 검증 경계(트래버설, 심볼릭 링크, 절대 경로, 포함 검사)

repo.py

트리 목록, ripgrep 검색, 제한된 파일 읽기, git status/diff

patch.py

create/modify를 지원하는 컨텍스트 검증 패치 적용

git.py

안전 가드가 포함된 브랜치, 커밋, 푸시 작업

tasks.py

명명된 작업 허용 목록 확인 및 실행

server.py

stdio JSON-RPC MCP 서버

errors.py

오류 유형

보안 모델

  • 저장소 허용 목록: 정책에 명시적으로 나열된 저장소만 접근할 수 있습니다.

  • 기능 플래그: writable과 pushable은 저장소별로 설정되며 기본값은 false입니다.

  • 경로 포함: 모든 경로는 저장소 루트를 기준으로 확인되고 검사됩니다. 트래버설(..), 절대 경로, 심볼릭 링크는 거부됩니다.

  • 민감 파일 제외: .env, *.pem, API 키, 토큰, 자격 증명, 바이너리 파일은 읽기와 쓰기가 차단됩니다.

  • 패치 안전성: old_text는 정확히 일치해야 하며, 여러 일치 항목이 있으면 context로 명확히 구분해야 합니다. create=true는 기존 파일 덮어쓰기를 거부합니다.

  • 작업 허용 목록: 작업은 사용자 입력이 아닌 서버 측 허용 목록에서 이름으로 확인됩니다. 임의의 셸 명령은 허용되지 않습니다.

  • Git 안전성: 대량 스테이징(git add -A)은 거부됩니다. 커밋은 명시적으로 나열된 파일로 제한됩니다. 민감 파일은 커밋할 수 없습니다. 브랜치 이름은 인젝션에 대해 검증됩니다. 푸시는 푸시 가능한 저장소의 origin으로만 제한됩니다.

  • 출력 제한: 모든 작업에는 구성 가능한 출력 상한이 있습니다(읽기 문자 수, 검색 결과, 트리 항목, diff 문자 수, 작업 출력).

설치

# No external dependencies required — Python 3.10+ standard library only.
cd cross-repo-ops
pip install -e .  # optional, for package install

사용법

MCP 서버 실행

python3 -m cross_repo_ops

서버는 stdin/stdout에서 JSON-RPC 2.0 메시지를 수신 대기합니다.

사용자 지정 정책

CROSS_REPO_OPS_CONFIG=/path/to/policy.json python3 -m cross_repo_ops

정책 파일 형식

{
  "repos": {
    "myrepo": {
      "root": "/path/to/repo",
      "writable": true,
      "pushable": false
    }
  },
  "tasks": {
    "myrepo": {
      "build": {
        "command": ["xcodebuild", "-scheme", "MyApp", "build"],
        "cwd": "{root}",
        "timeout": 180
      },
      "test": {
        "command": ["xcodebuild", "test", "-scheme", "MyApp"],
        "cwd": "{root}",
        "timeout": 300
      }
    }
  }
}

MCP 도구

도구

설명

repo_tree

안전 제외 항목이 적용된 파일/디렉터리 목록

repo_search

출력이 제한된 ripgrep 검색

repo_read

민감하지 않은 텍스트 파일의 제한된 부분 읽기

git_status

git status 확인

git_diff

unstaged/staged/commit diff 보기

apply_patch

컨텍스트 검증 패치 적용(쓰기 가능한 저장소만)

run_task

승인된 명명된 작업 실행(허용 목록 전용)

git_branch

브랜치 목록/생성/전환(생성/전환은 쓰기 가능한 저장소만)

git_commit

명시적 파일 스테이징 및 커밋(쓰기 가능한 저장소만)

git_push

origin으로 푸시(푸시 가능한 저장소만)

테스트

python3 -m unittest tests.test_security tests.test_adversarial -v

다음을 포함한 32개의 테스트:

  • 허용 및 차단된 읽기

  • 경로 트래버설, 절대 경로, 심볼릭 링크 이스케이프 거부

  • 민감 파일 읽기/쓰기/커밋 차단

  • 쓰기 가능 저장소와 읽기 전용 저장소의 강제 적용

  • 올바른/오래된 컨텍스트를 사용한 패치

  • 제외된 파일을 대상으로 하는 패치

  • 명명된 작업 허용 목록(성공, 알 수 없는 이름, 셸 인젝션 시도)

  • 작업 시간 제한 및 출력 잘림

  • Git status/diff

  • 브랜치 이름 인젝션 방지 장치

  • 커밋 안전 장치(빈 메시지, 민감 파일, 대량 스테이징, 사전 스테이징된 파일)

  • 푸시 불가 저장소에 대한 푸시 거부

  • 서버의 누락 인자 처리

라이선스

MIT

Available Tools

10 tools
apply_patchB

Apply a bounded, context-checked patch to a file in a writable repository. If old_text is empty and create=true, creates the file.

Inputs: path (required), repo (required), new_text (required), old_text (required), +2 more.

git_branchC

List or safely create a branch in a repository.

Inputs: repo (required), action (required), branch_name.

git_commitC

Stage and commit files in a writable repository.

Inputs: repo (required), files (required), message (required).

git_diffC

View the diff of unstaged or staged changes in a repository.

Inputs: repo (required), path, commit, staged, +1 more.

git_pushC

Push the current or specified branch to origin in a pushable repository.

Inputs: repo (required), branch, remote.

git_statusC

Inspect the current Git repository status.

Inputs: repo (required).

repo_readB

Read a bounded slice of a non-sensitive text file from an allowed repository.

Inputs: path (required), repo (required), max_lines, start_line.

repo_treeC

List files and directories in an allowed repository with safety exclusions.

Inputs: repo (required), path, max_entries, include_hidden.

run_taskB

Run an approved named task for a repository. No arbitrary shell commands are accepted.

Inputs: name (required), repo (required).

Tool Schema Changelog

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

    TDQS

    B3.3/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool maps cleanly to a distinct action: repo_* covers content browsing/search, git_* covers repository state operations, and apply_patch/run_task cover modifications. Adjacent tools like git_status and git_diff are clearly separated by purpose. No two tools appear to do the same thing.

    Naming Consistency4/5

    Most tools follow a clear domain-prefix pattern: repo_* for content operations and git_* for VCS operations. The exceptions are apply_patch and run_task, which use bare verb_noun names but remain readable and consistent with the overall snake_case style.

    Tool Count5/5

    Ten tools is an ideal size for this scope; each tool covers a distinct operation without redundancy. The set feels intentionally scoped rather than padded.

    Completeness4/5

    The read/search → patch → branch → commit → push workflow provides a complete edit-and-publish lifecycle. Minor gaps include no repository enumeration, no git pull/fetch, and no way to list approved run_task tasks, but these do not block the primary workflow.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables safe filesystem and git operations confined within a single allowed directory tree, using symlink-resolved path containment to protect against path traversal. Users can read, write, list, and search files, as well as initialize repos and run status, stage, commit, diff, and log operations through MCP.
      11
      MIT
    • A
      license
      C
      quality
      C
      maintenance
      Enables MCP clients to inspect and modify local git repositories by running commands such as status, log, diff, add, commit, branch, and stash. Push operations are not performed locally; instead diffs are sent to a configurable HTTP API that handles the upload, with all other remote git commands blocked.
      27
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables read-only, allowlisted filesystem and Git inspection of explicitly configured local repositories through MCP, with bounded reads and no arbitrary path or write access.
      8 npm
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP clients to inspect local Git repositories through five focused, read-only tools for repository trees, literal text search, numbered file reads, bounded git diffs, and project summaries while confining paths, skipping secret-like and binary files, and enforcing output limits.
      MIT