Skip to main content
Glama
harbor-registry-mcp

harbor-registry-mcp

harbor-registry-mcp

PyPI Python License: MIT

Harbor Registry를 위한 MCP 서버입니다. LLM 에이전트(Claude Code, Cursor, OpenCode 등)가 프로젝트, 리포지토리, 아티팩트를 나열하고, 스토리지 보고서를 실행하며, 정리 대상 후보를 찾고, 태그가 없거나 오래된 아티팩트를 삭제할 수 있게 합니다. 모든 작업에는 안전 장치가 포함되어 있습니다(대량 삭제 시 기본적으로 드라이런(dry-run) 실행).

Python, FastMCP, stdio 전송을 사용합니다.

SaaS 또는 자체 호스팅/온프레미스 등 모든 Harbor 2.x 인스턴스에서 작동합니다.

왜 다른 Harbor MCP인가요?

기존에 커뮤니티 Harbor MCP(nomagicln/mcp-harbor, bupd/harbor-mcp-server)가 존재하지만, 이들은 기본적인 목록 조회/가져오기 엔드포인트만 제공합니다. 이 서버는 스토리지 보고서, 정리 대상 후보 찾기, 태그 없는 아티팩트 삭제, 드라이런을 포함한 오래된 아티팩트 삭제 기능을 추가하여 DevOps 엔지니어가 디스크 공간을 확보하는 데 실제로 필요한 작업을 수행할 수 있게 합니다.

Related MCP server: Harbor MCP Server

설계 특징

  • 도구 주석 — 읽기 전용 도구는 readOnlyHint: True를 가지며, 파괴적인 도구(harbor_delete_*)는 destructiveHint: True를 포함하여 MCP 클라이언트가 확인을 요청하도록 합니다.

  • 기본 드라이런 — 대량 정리 작업(harbor_delete_old_artifacts(dry_run=True))은 기본적으로 드라이런으로 실행되며, 에이전트가 이를 명시적으로 변경해야 실행됩니다.

  • 구조화된 출력 — 모든 도구는 타입이 지정된 페이로드(TypedDict)와 마크다운 요약을 반환합니다.

  • 구조화된 오류 — 401 / 403 / 404 / 429 / 5xx 오류가 실행 가능한 힌트로 매핑됩니다.

  • Pydantic 입력 검증 — 모든 인자에 대해 검증을 수행합니다.

  • 취약점 스냅샷 — with_scan_overview가 활성화된 경우 harbor_list_artifacts가 스캔 상태와 개수를 표시합니다.

기능 (8개 도구)

탐색 및 검사

  • harbor_list_projects — 리포지토리 개수 및 공개 여부를 포함한 프로젝트 목록

  • harbor_list_repos — 프로젝트 내 리포지토리 목록

  • harbor_list_artifacts — 태그/크기/스캔 상태를 포함한 리포지토리 내 아티팩트 목록

  • harbor_storage_report — 전체 프로젝트 스토리지 분석 (모든 리포지토리 × 모든 아티팩트)

정리 계획

  • harbor_cleanup_candidates — 삭제 대상 제안 (태그 없음, 한 번도 풀(pull)되지 않음, 오래된 버전)

정리 실행 (파괴적)

  • harbor_delete_artifact — 태그 또는 다이제스트별로 단일 아티팩트 삭제

  • harbor_delete_untagged — 프로젝트/리포지토리 내 태그 없는 모든 아티팩트 삭제

  • harbor_delete_old_artifacts — 리포지토리당 최신 N개를 유지하고 나머지는 삭제 (기본값: 드라이런)

설치

Python 3.10 이상이 필요합니다.

# via uvx (recommended)
uvx --from harbor-registry-mcp harbor-registry-mcp

# or via pipx
pipx install harbor-registry-mcp

설정

claude mcp add harbor -s project \
  --env HARBOR_URL=https://harbor.example.com \
  --env HARBOR_USERNAME='robot$your-robot' \
  --env HARBOR_PASSWORD=your-robot-token \
  --env HARBOR_SSL_VERIFY=true \
  -- uvx --from harbor-registry-mcp harbor-registry-mcp

또는 .mcp.json 파일:

{
  "mcpServers": {
    "harbor": {
      "type": "stdio",
      "command": "uvx",
      "args": ["--from", "harbor-registry-mcp", "harbor-registry-mcp"],
      "env": {
        "HARBOR_URL": "https://harbor.example.com",
        "HARBOR_USERNAME": "robot$your-robot",
        "HARBOR_PASSWORD": "${HARBOR_PASSWORD}",
        "HARBOR_SSL_VERIFY": "true"
      }
    }
  }
}

확인:

claude mcp list
# harbor: uvx --from harbor-registry-mcp harbor-registry-mcp - ✓ Connected

환경 변수

변수

필수

설명

HARBOR_URL

예

Harbor URL (끝에 슬래시 제외)

HARBOR_USERNAME

예

Harbor 사용자 이름 — 로봇 계정 권장

HARBOR_PASSWORD

예

비밀번호 또는 로봇 토큰

HARBOR_SSL_VERIFY

아니오

true/false. 기본값: true.

사용 예시

  • "einvy-pub 프로젝트에 대한 스토리지 보고서"

  • "qa-assistant에서 정리 대상 후보 찾기 — 최신 3개 유지"

  • "qa-assistant에서 태그 없는 모든 아티팩트 삭제"

  • "qa-assistant/pgvector-rag에서 오래된 아티팩트 드라이런 삭제, 최신 1개 유지"

  • "einvy-pub/my-image에는 무엇이 있나요?"

안전성

  • 읽기 도구는 readOnlyHint: True를 사용하여 확인이 필요 없습니다.

  • 삭제 도구는 destructiveHint: True를 사용하여 클라이언트가 확인해야 합니다.

  • harbor_delete_old_artifacts는 기본적으로 dry_run=True로 설정되어 있으며, 에이전트가 실제로 삭제하려면 dry_run=False로 명시적으로 설정해야 합니다.

  • harbor_cleanup_candidates는 읽기 전용이며, 삭제하지 않고 후보만 제안합니다.

개발

git clone https://github.com/mshegolev/harbor-registry-mcp.git
cd harbor-registry-mcp
pip install -e '.[dev]'
pytest

라이선스

MIT © Mikhail Shchegolev

Available Tools

8 tools
harbor_cleanup_candidatesA
Read-onlyIdempotent

Suggest which artifacts could be deleted to reclaim space.

READ-ONLY — never deletes anything; just produces a list with reasons. Use harbor_delete_artifact / harbor_delete_untagged / harbor_delete_old_artifacts to act on the results.

Reasons emitted: - untagged — artifact has no tags (orphaned layer) - never_pulled — artifact has never been pulled (and is past the keep_latest_per_repo cutoff) - old_version — artifact is older than the keep_latest_per_repo newest tagged artifacts

Inputs: project_name (required), include_untagged, include_zero_pulls, keep_latest_per_repo. Returns: project, candidates_count, total_reclaimable, total_reclaimable_bytes, +2 more

harbor_delete_artifactA
Destructive

Delete a single artifact by tag or digest.

DESTRUCTIVE & IRREVERSIBLE — Harbor immediately removes the manifest from its catalogue; the underlying blobs are reclaimed by the next GC sweep. There is no soft-delete or undo.

Returns the freed space and tag list for confirmation.

Inputs: project_name (required), repository_name (required), reference (required). Returns: success, project, repository, reference, +4 more

harbor_delete_old_artifactsA
Destructive

Keep the N newest artifacts in a repository, delete the rest.

DESTRUCTIVE. dry_run=True is the default — the agent must explicitly set dry_run=False to actually delete. Each entry in to_delete carries a deleted field (True/False after real run, None in dry-run).

Inputs: project_name (required), repository_name (required), keep_count, dry_run. Returns: project, repository, dry_run, keeping, +6 more

harbor_delete_untaggedA
DestructiveIdempotent

Delete all untagged artifacts in a project (or single repository).

DESTRUCTIVE. Untagged artifacts are typically orphaned layers left behind after pushing a new tag of the same image — generally safe to delete. The full project sweep is opaque, so the response includes repos_scanned for visibility.

Inputs: project_name (required), repository_name. Returns: project, repos_scanned, deleted_count, freed_size, +3 more

harbor_list_artifactsA
Read-onlyIdempotent

List artifacts (tags) in a repository, newest first.

Each artifact carries digest, size, push/pull timestamps, scan status and vulnerability counts (if scanned).

Pagination: if has_more is True, call again with page + 1. For repositories with hundreds of artifacts prefer harbor_storage_report or harbor_cleanup_candidates which paginate internally.

Inputs: project_name (required), repository_name (required), page, page_size. Returns: project, repository, total_size, total_size_bytes, +6 more

harbor_list_projectsA
Read-onlyIdempotent

List Harbor projects, sorted by repository count (descending within the page).

Use this first to discover which Harbor projects exist before drilling in with harbor_list_repos / harbor_list_artifacts.

Pagination: if has_more is True, call again with page + 1. Note that sorting is per-page — agents that need a global ranking should aggregate across pages.

Returns: dict with keys projects_count / page / page_size / has_more / next_page / projects (list).

Inputs: page, page_size. Returns: projects_count, page, page_size, has_more, +2 more

harbor_list_reposA
Read-onlyIdempotent

List repositories in a Harbor project.

Each repository is reported with artifact count and total pull count (useful for spotting unused repos before cleanup).

Pagination: if has_more is True, call again with page + 1.

Inputs: project_name (required), page, page_size. Returns: project, repositories_count, page, page_size, +3 more

harbor_storage_reportA
Read-onlyIdempotent

Full storage breakdown for a Harbor project.

Iterates every repository × every artifact and returns a sorted-by-size report — the canonical view for "what's eating up our quota?". Performs O(repos × artifacts) API calls; emits progress events through MCP Context.

Inputs: project_name (required). Returns: project, total_repositories, total_size, total_size_bytes, +1 more

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 8 tools

    Disambiguation5/5

    Each tool targets a distinct operation: listing, reporting, or deleting. The cleanup candidate tool is clearly separate from the delete tools, and deletion tools are differentiated by scope (single, old, untagged). No overlapping purposes.

    Naming Consistency4/5

    Most tools follow the harbor_verb_noun pattern (e.g., harbor_delete_artifact, harbor_list_projects), but harbor_storage_report uses a noun_noun pattern, breaking consistency. The prefix and general style are otherwise uniform.

    Tool Count5/5

    Eight tools cover the essential operations for a Harbor registry: discovery (list projects, repos, artifacts), cleanup (candidates, delete single, delete old, delete untagged), and reporting (storage report). The count is well-scoped without being excessive.

    Completeness5/5

    The tool set provides comprehensive coverage for registry management: full lifecycle for artifacts (list, delete individual/bulk/untagged), project and repository exploration, storage analysis, and a cleanup candidate suggestion tool. No major gaps in functionality for the intended domain.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      F
      maintenance
      A Node.js application that provides a Model Context Protocol server for interacting with Harbor container registry, supporting operations for projects, repositories, tags, and Helm charts.
      21 npm
      7
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI models to interact with Harbor container registries to manage projects, repositories, and system configurations in real time. It provides a suite of tools for monitoring health, retrieving statistics, and performing searches across registry data.
      6
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP Harbor is a Node.js application that provides a Model Context Protocol (MCP) server for interacting with Harbor container registry.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables interacting with a Harbor container registry through the Model Context Protocol, supporting operations for projects, repositories, tags, and Helm charts.
      1
      MIT