Harbor Registry Mcp

io.github.mshegolev由 GitHub 帳號 mshegolev 發布v0.1.0更新於 Oct 27, 2026

Harbor Registry MCP — projects, repos, artifacts, storage reports, cleanup (with dry-run).

發布方自己的服務:Harbor Notes

概覽

AI 產生的概覽

針對 Harbor 容器映像倉庫的 MCP 伺服器,讓助理列出專案、儲存庫與成品,產生儲存報告、規劃清理並刪除成品。

可以做什麼
  • 列出專案、儲存庫與成品,含標籤、大小與掃描狀態
  • 產生專案層級的完整儲存用量明細(涵蓋所有儲存庫與成品)
  • 提出清理候選建議,例如無標籤、從未被拉取或舊版本
  • 依標籤或摘要刪除單一成品
  • 批次刪除無標籤成品,或只保留每個儲存庫最新的 N 個,預設為試跑
適用情境
適合在 Harbor 2.x 倉庫上進行維運工作,尤其是回收磁碟空間:盤點現有映像、查看儲存用量分布,並在試跑確認後清理無標籤或過期成品。
執行需求
以 Python 套件形式透過 stdio 在本機執行(需 Python 3.10+,可用 uvx 或 pipx)。需要能連線 Harbor 2.x 執行個體的網路,並設定環境變數 HARBOR_URL、HARBOR_USERNAME 與 HARBOR_PASSWORD;HARBOR_SSL_VERIFY 為選用,預設 true。
安裝前請注意
HARBOR_PASSWORD 存放密碼或機器人權杖,建議使用權限受限的機器人帳號而非個人管理員登入。刪除類工具具破壞性,可批次移除成品;批次刪除預設為試跑,須明確設定 dry_run=False 才會執行,請先核對計畫。將 HARBOR_SSL_VERIFY 設為 false 會關閉憑證驗證。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Harbor Registry Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

harbor-registry-mcp

[PyPI] [Python] [License: MIT]

MCP server for Harbor Registry. Lets an LLM agent (Claude Code, Cursor, OpenCode, etc.) list projects, repositories and artifacts, run storage reports, find cleanup candidates, and delete untagged or old artifacts — all with safety rails (dry-run by default for bulk delete).

Python, FastMCP, stdio transport.

Works with any Harbor 2.x instance — SaaS or self-hosted / on-prem.

Why another Harbor MCP?

A couple of community Harbor MCPs exist (nomagicln/mcp-harbor, bupd/harbor-mcp-server) but they expose only the basic list/get endpoints. This one adds storage reports, cleanup candidates, delete untagged, and delete old artifacts with dry-run — the operations DevOps engineers actually need to reclaim disk space.

Design highlights

  • Tool annotations — read-only tools get readOnlyHint: True; destructive ones (harbor_delete_*) carry destructiveHint: True so MCP clients ask for confirmation.
  • Dry-run by default on both bulk cleanups (harbor_delete_untagged, harbor_delete_old_artifacts) — the agent must pass dry_run=False to execute.
  • Structured output — every tool returns a typed payload (TypedDict) + a markdown summary.
  • Structured errors — 401 / 403 / 404 / 429 / 5xx mapped to actionable hints.
  • Pydantic input validation for every argument.
  • Vulnerability snapshot — harbor_list_artifacts surfaces scan status and counts if with_scan_overview is enabled.

Features (8 tools)

Discovery & inspection

  • harbor_list_projects — projects with repo counts and visibility
  • harbor_list_repos — repositories in a project
  • harbor_list_artifacts — artifacts in a repository with tags/size/scan status
  • harbor_storage_report — full project storage breakdown (all repos × all artifacts)

Cleanup planning

  • harbor_cleanup_candidates — suggest what to delete (untagged, never-pulled, old versions)

Cleanup execution (destructive)

  • harbor_delete_artifact — delete a single artifact by tag or digest
  • harbor_delete_untagged — delete all untagged artifacts in a project/repo (dry-run default)
  • harbor_delete_old_artifacts — keep N latest per repo, delete the rest (dry-run default)

Installation

Requires Python 3.10+.

bash
# via uvx (recommended)uvx --from harbor-registry-mcp harbor-registry-mcp
# or via pipxpipx install harbor-registry-mcp

Configuration

bash
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

Or in .mcp.json:

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"      }    }  }}

Check:

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

Environment variables

VariableRequiredDescription
HARBOR_URLyesHarbor URL (no trailing slash)
HARBOR_USERNAMEyesHarbor username — robot account recommended
HARBOR_PASSWORDyesPassword or robot token
HARBOR_SSL_VERIFYnotrue/false. Default: true.

Example usage

  • "Storage report for project einvy-pub"
  • "Find cleanup candidates in qa-assistant — keep latest 3"
  • "Delete all untagged artifacts in qa-assistant"
  • "Dry-run delete of old artifacts in qa-assistant/pgvector-rag, keep 1 latest"
  • "What's in einvy-pub/my-image?"

Safety

  • Read tools use readOnlyHint: True — no confirmation needed.
  • Delete tools use destructiveHint: True — clients should confirm.
  • harbor_delete_untagged and harbor_delete_old_artifacts both default to dry_run=True; the agent must explicitly set dry_run=False to actually delete.
  • harbor_cleanup_candidates is read-only — it only suggests candidates, never deletes.

Development

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

License

MIT © Mikhail Shchegolev

來源:README.md,提交 446fd5d

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Harbor 整合