harbor-registry-mcp
This server lets LLM agents manage Harbor registries via MCP tools: inspect projects/repositories/artifacts, generate storage reports, plan cleanup, and safely execute deletions.
Discovery & inspection
List all Harbor projects with repository counts, visibility, and pagination.
List repositories within a project, including artifact and pull counts.
List artifacts in a repository with tags, digest, size, push/pull timestamps, and vulnerability scan status.
Storage monitoring
Generate a project storage report breaking down usage by repository and artifact, sorted by size.
Cleanup planning
Identify cleanup candidates (untagged/orphaned, never-pulled, or old versions beyond a keep-N count) without deleting anything.
Cleanup execution
Delete a single artifact by tag or digest.
Delete all untagged artifacts in a project or a specific repository.
Delete old artifacts while keeping the N newest versions in a repository.
Safety features
Read-only tools are marked with
readOnlyHint; destructive tools carrydestructiveHintfor confirmation prompts.Bulk deletions default to dry-run mode and require explicit
dry_run=Falseto actually delete.Includes Pydantic input validation, structured output, and detailed error messages.
Provides tools for managing Harbor registry, including listing projects, repositories, and artifacts, generating storage reports, identifying cleanup candidates, and deleting untagged or old artifacts with dry-run support.
harbor-registry-mcp
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.
Related MCP server: MCP OCI Registry Server
Design highlights
Tool annotations — read-only tools get
readOnlyHint: True; destructive ones (harbor_delete_*) carrydestructiveHint: Trueso MCP clients ask for confirmation.Dry-run by default on both bulk cleanups (
harbor_delete_untagged,harbor_delete_old_artifacts) — the agent must passdry_run=Falseto 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_artifactssurfaces scan status and counts ifwith_scan_overviewis enabled.
Features (8 tools)
Discovery & inspection
harbor_list_projects— projects with repo counts and visibilityharbor_list_repos— repositories in a projectharbor_list_artifacts— artifacts in a repository with tags/size/scan statusharbor_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 digestharbor_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+.
# via uvx (recommended)
uvx --from harbor-registry-mcp harbor-registry-mcp
# or via pipx
pipx install harbor-registry-mcpConfiguration
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-mcpOr in .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"
}
}
}
}Check:
claude mcp list
# harbor: uvx --from harbor-registry-mcp harbor-registry-mcp - ✓ ConnectedEnvironment variables
Variable | Required | Description |
| yes | Harbor URL (no trailing slash) |
| yes | Harbor username — robot account recommended |
| yes | Password or robot token |
| no |
|
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_untaggedandharbor_delete_old_artifactsboth default todry_run=True; the agent must explicitly setdry_run=Falseto actually delete.harbor_cleanup_candidatesis read-only — it only suggests candidates, never deletes.
Development
git clone https://github.com/mshegolev/harbor-registry-mcp.git
cd harbor-registry-mcp
pip install -e '.[dev]'
pytestLicense
MIT © Mikhail Shchegolev
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceMCP Harbor is a Node.js application that provides a Model Context Protocol (MCP) server for interacting with Harbor container registry.18MIT
- Alicense-qualityDmaintenanceA Model Context Protocol (MCP) server for querying OCI container registries. Provides tools and prompts for interacting with registries like Docker Hub, GHCR, and other OCI-compatible registries.2Apache 2.0
- AlicenseBqualityBmaintenanceMCP server for Argo CD that provides multi-environment profiles, SSO or API key authentication, application search with cache, and REST API tools from the bundled OpenAPI catalog.2626MIT
- Flicense-qualityBmaintenanceRead-only MCP server for searching and listing components in Nexus Repository Manager 3 (Docker, Maven, npm, PyPI, etc.) with tools for repositories, components, Docker tags, and latest version.
Related MCP Connectors
Docker Hub MCP — wraps the Docker Hub v2 API (free, no auth required for public data)
Go MCP server for GitLab: 2 dynamic tools reach 1000+ REST/GraphQL actions. Free/CE, no paid tier.
Artifact store for AI agents. Hosted OAuth at mcp.artifacta.io/mcp; local stdio via npm/PyPI.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mshegolev/harbor-registry-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server