MCP Harbor
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Harborshow me the repositories in project library"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Harbor
MCP Harbor is a Node.js application that provides a Model Context Protocol (MCP) server for interacting with Harbor container registry.
Table of Contents
Related MCP server: MCP Server
Features
MCP Server: Exposes tools for interacting with Harbor through the Model Context Protocol
Harbor Operations: Supports operations for projects, repositories, tags, and Helm charts
TypeScript: Written in TypeScript for better type safety and developer experience
Automated Tests: Comprehensive test suite for reliable functionality
Prerequisites
Before installing MCP Harbor, ensure you have:
Node.js 18.x or higher
npm 8.x or higher
Access to a Harbor registry instance
Git (for cloning the repository)
Installation
Clone the repository:
git clone https://github.com/nomagicln/mcp-harbor.gitNavigate to the project directory:
cd mcp-harborInstall dependencies:
npm installBuild the project:
npm run build
Usage
Command Line Arguments
The application accepts the following command line arguments:
Options:
--url Harbor API URL [string] [required]
--username Harbor username (or robot account name) [string] [required]
--password Harbor password (mutually exclusive with --token) [string]
--token Harbor token for robot/service accounts [string]
--insecure Disable TLS/SSL certificate validation [boolean] [default: false]
--debug Enable debug mode [boolean] [default: false]
--help Show help [boolean]Note: You must provide either
--passwordor--token, but not both.
Environment Variables
Instead of command line arguments, you can also use environment variables. Create a .env file in the root directory:
# Harbor API Configuration
HARBOR_URL=https://harbor.example.com
HARBOR_USERNAME=admin
# Authentication: use either PASSWORD or TOKEN (mutually exclusive)
# Option 1: Password-based authentication
HARBOR_PASSWORD=Harbor12345
# Option 2: Token-based authentication (for robot/service accounts)
# HARBOR_USERNAME=robot$myrobot
# HARBOR_TOKEN=your-robot-token-here
# Debug Mode (true/false)
DEBUG=false
# Disable TLS/SSL certificate validation (true/false)
# HARBOR_INSECURE=falseToken Authentication (Robot/Service Accounts)
Harbor supports robot accounts for automated access. To use token-based authentication:
Create a robot account in your Harbor instance (Administration > Robot Accounts)
Use the robot account name as
--username(e.g.,robot$myrobot)Use the generated token as
--token
mcp-harbor --url https://harbor.example.com --username "robot\$myrobot" --token "your-robot-token"MCP Client Configuration
Claude Desktop
Add the following to your Claude Desktop configuration file (claude_desktop_config.json):
Using password authentication:
{
"mcpServers": {
"harbor": {
"command": "npx",
"args": [
"mcp-harbor",
"--url", "https://harbor.example.com",
"--username", "admin",
"--password", "your-password"
]
}
}
}Using token authentication (robot/service account):
{
"mcpServers": {
"harbor": {
"command": "npx",
"args": [
"mcp-harbor",
"--url", "https://harbor.example.com",
"--username", "robot$myrobot",
"--token", "your-robot-token"
]
}
}
}With self-signed certificates:
{
"mcpServers": {
"harbor": {
"command": "npx",
"args": [
"mcp-harbor",
"--url", "https://harbor.example.com",
"--username", "admin",
"--password", "your-password",
"--insecure"
]
}
}
}Cursor / Windsurf
Add the following to your MCP configuration file (.cursor/mcp.json or .windsurf/mcp.json):
{
"mcpServers": {
"harbor": {
"command": "npx",
"args": [
"mcp-harbor",
"--url", "https://harbor.example.com",
"--username", "admin",
"--password", "your-password"
]
}
}
}Using environment variables
You can also reference environment variables to avoid hardcoding credentials:
{
"mcpServers": {
"harbor": {
"command": "npx",
"args": ["mcp-harbor"],
"env": {
"HARBOR_URL": "https://harbor.example.com",
"HARBOR_USERNAME": "admin",
"HARBOR_PASSWORD": "your-password"
}
}
}
}SSE Transport (remote/shared server)
If you prefer running the MCP server as a standalone process with SSE transport:
npx mcp-harbor --url https://harbor.example.com --username admin --password your-password --sse --port 3000Then configure your MCP client to connect via SSE at http://localhost:3000/sse.
MCP Tools
The MCP server exposes the following tools:
Tool Name | Description | Parameters |
| List all projects in Harbor | None |
| Get project details by ID |
|
| Create a new project |
|
| Delete a project |
|
| List repositories in a project |
|
| Delete a repository |
|
| List tags in a repository |
|
| Delete a tag |
|
| List Helm charts |
|
| List chart versions |
|
| Delete chart version |
|
Development
Running in Development Mode
npm run devRunning Tests
# Run all tests
npm test
# Run tests with coverage
npm run test:coverageProject Structure
mcp-harbor
├── src
│ ├── app.ts # Main application entry point (MCP server)
│ ├── definitions
│ │ └── tool.definitions.ts # Tool definitions for MCP
│ ├── services
│ │ └── harbor.service.ts # Harbor service implementation
│ └── types
│ └── index.ts # TypeScript type definitions
├── test
│ └── harbor.test.ts # Tests for Harbor service
├── .env.example # Example environment variables
├── .gitignore # Git ignore file
├── .eslintrc.json # ESLint configuration
├── package.json # Project dependencies
├── jest.config.js # Jest configuration
├── tsconfig.test.json # TypeScript configuration for tests
├── tsconfig.json # TypeScript configuration
├── LICENSE # Project license
└── README.md # Project documentationTroubleshooting
Common Issues
Connection Failed
Error: Unable to connect to Harbor instanceVerify HARBOR_URL is correct and accessible
Check network connectivity
Ensure Harbor instance is running
Authentication Failed
Error: Invalid credentialsVerify HARBOR_USERNAME and HARBOR_PASSWORD are correct
Check if user has required permissions
Build Errors
Error: TypeScript compilation failedRun
npm installto ensure all dependencies are installedCheck TypeScript version compatibility
Clear the
distdirectory and rebuild
Debug Mode
Enable debug mode by using the --debug flag or setting:
DEBUG=trueSupport
For additional help:
Review the application logs
License
This project is licensed under the MIT License - see the LICENSE file for details.
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for Appcircle mobile CI/CD platform.
Publish and discover MCP servers via the official MCP Registry. Powered by HAPI MCP server.
MCP server for Product Management
MCP Server for JFrog, providing tools for development and artifact management.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceA 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.15 npm7MIT
- AlicenseNot gradedqualityFmaintenanceA configurable server implementation that provides MCP (Model-Controller-Protocol) functionality, supporting both Node.js and Docker environments with automated setup and configuration options.284 npmMIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server designed for learning and experimentation. It provides a foundational setup for developers to build, run, and debug MCP server implementations using Node.js.-
- AlicenseBqualityCmaintenanceModel Context Protocol (MCP) server for the Rancher ecosystem: multi-cluster Kubernetes, Harvester HCI (VMs, storage, networks), and Fleet GitOps.1012Apache 2.0