home / mcp / harbor mcp server

Harbor MCP Server

Experimental MCP server enabling real-time Harbor interactions via MCP tools (health, projects, repositories, quotas, configurations).

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "bupd-harbor-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "harbor-mcp"
      ],
      "env": {
        "HARBOR_API_BASE": "YOUR_HARBOR_URL",
        "HARBOR_AUTH_PASS": "HARBOR_PASSWORD_OR_SECRET",
        "HARBOR_AUTH_USER": "HARBOR_USERNAME"
      }
    }
  }
}

You can run a Harbor MCP Server to let AI models and tools interact with a Harbor container registry in real time. This server acts as a bridge that exposes Harbor operations as MCP endpoints, enabling streamlined automation and integrations.

How to use

Start by choosing how you want to run the Harbor MCP Server locally or in Docker. You will configure your MCP client to connect to the server using either a local runtime or a Docker-based runtime. The server exposes a set of Harbor operations as MCP tools, such as health checks, project and repository queries, and configuration management. Ensure you have valid Harbor credentials and the API base URL. Then, run one of the provided MCP server entry points and point your MCP client to it using the same environment variables for authentication and API access.

How to install

Prerequisites you need before installing:
- Node.js (for local runtime) or a JavaScript runtime capable of executing the MCP server build
- npm or a similar package manager
- Access to your Harbor instance with API credentials (username and password or token)

Step-by-step install and start options are provided below. Pick the approach you prefer and follow the exact commands.

Option A: Run with npx (quick start) - uses the Harbor MCP server package directly

Option B: Build locally and run with Node.js

Option C: Run via Docker

Additional notes

Environment variables you will provide to the MCP server are used to connect to Harbor. Typical variables include the Harbor API base URL, a username, and a password or secret. Ensure these are properly set in both the runtime environment and the MCP server configuration.

Troubleshooting

If the server fails to start, verify that the Harbor API base URL is reachable and that credentials are correct. Check that the port or connection target used by your MCP client is accessible and that any required network policies allow traffic between the MCP server and Harbor.

Security and access

Treat Harbor credentials as sensitive information. Use secure storage for passwords or tokens and avoid exporting credentials in plaintext where possible. Restrict admin-level operations to trusted clients and monitor access to the MCP server.

Examples of usage patterns

- Use get-health to confirm Harbor is healthy before performing bulk operations - List projects and repositories to inventory access control and storage quotas - Update configurations as an admin to enforce organizational policies

Available tools

get-health

Check Harbor instance health to verify it is up and running.

get-statistics

Retrieve project and repository statistics from Harbor.

list-projects

List projects with optional filters and pagination.

get-project

Get detailed information for a specific project.

get-project-summary

Get a concise summary of a project.

list-project-members

List members of a given project.

list-repositories-in-project

List repositories within a specified project.

list-quotas

List storage quotas for projects.

search

Search for projects and repositories by name.

get-configurations

Get system configurations (admin only).

update-configurations

Update system configurations (admin only, requires confirmation).

get-volumes

Get system volume information (total and free size).