MCP Harbor

MCP Harbor

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.

nomagicln

Developer Tools
Visit Server

README

MCP Harbor

License: MIT TypeScript Node.js codecov

MCP Harbor is a Node.js application that provides a Model Context Protocol (MCP) server for interacting with Harbor container registry.

Table of Contents

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

  1. Clone the repository:

    git clone https://github.com/nomagicln/mcp-harbor.git
    
  2. Navigate to the project directory:

    cd mcp-harbor
    
  3. Install dependencies:

    npm install
    
  4. Build 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                    [string] [required]
  --password  Harbor password                    [string] [required]
  --debug     Enable debug mode          [boolean] [default: false]
  --help      Show help                                  [boolean]

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
HARBOR_PASSWORD=Harbor12345

# Debug Mode (true/false)
DEBUG=false

MCP Tools

The MCP server exposes the following tools:

Tool Name Description Parameters
list_projects List all projects in Harbor None
get_project Get project details by ID projectId: string
create_project Create a new project project_name: string, metadata?: object
delete_project Delete a project projectId: string
list_repositories List repositories in a project projectId: string
delete_repository Delete a repository projectId: string, repositoryName: string
list_tags List tags in a repository projectId: string, repositoryName: string
delete_tag Delete a tag projectId: string, repositoryName: string, tag: string
list_charts List Helm charts projectId: string
list_chart_versions List chart versions projectId: string, chartName: string
delete_chart Delete chart version projectId: string, chartName: string, version: string

Development

Running in Development Mode

npm run dev

Running Tests

# Run all tests
npm test

# Run tests with coverage
npm run test:coverage

Project 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 documentation

Troubleshooting

Common Issues

  1. Connection Failed

    Error: Unable to connect to Harbor instance
    
    • Verify HARBOR_URL is correct and accessible
    • Check network connectivity
    • Ensure Harbor instance is running
  2. Authentication Failed

    Error: Invalid credentials
    
    • Verify HARBOR_USERNAME and HARBOR_PASSWORD are correct
    • Check if user has required permissions
  3. Build Errors

    Error: TypeScript compilation failed
    
    • Run npm install to ensure all dependencies are installed
    • Check TypeScript version compatibility
    • Clear the dist directory and rebuild

Debug Mode

Enable debug mode by using the --debug flag or setting:

DEBUG=true

Support

For additional help:

  1. Review the application logs

License

This project is licensed under the MIT License - see the LICENSE file for details.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
MCP Package Docs Server

MCP Package Docs Server

Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.

Featured
Local
TypeScript
Claude Code MCP

Claude Code MCP

An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.

Featured
Local
JavaScript
@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.

Featured
Local
JavaScript
Linear MCP Server

Linear MCP Server

Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.

Featured
JavaScript
mermaid-mcp-server

mermaid-mcp-server

A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.

Featured
JavaScript
Jira-Context-MCP

Jira-Context-MCP

MCP server to provide Jira Tickets information to AI coding agents like Cursor

Featured
TypeScript
Linear MCP Server

Linear MCP Server

A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Featured
JavaScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Featured
Python