Skip to main content
Glama

MCP Harbor

by nomagicln

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

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 NameDescriptionParameters
list_projectsList all projects in HarborNone
get_projectGet project details by IDprojectId: string
create_projectCreate a new projectproject_name: string, metadata?: object
delete_projectDelete a projectprojectId: string
list_repositoriesList repositories in a projectprojectId: string
delete_repositoryDelete a repositoryprojectId: string, repositoryName: string
list_tagsList tags in a repositoryprojectId: string, repositoryName: string
delete_tagDelete a tagprojectId: string, repositoryName: string, tag: string
list_chartsList Helm chartsprojectId: string
list_chart_versionsList chart versionsprojectId: string, chartName: string
delete_chartDelete chart versionprojectId: 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.

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Harbor 컨테이너 레지스트리와 상호 작용하고 프로젝트, 저장소, 태그 및 Helm 차트에 대한 작업을 지원하기 위한 모델 컨텍스트 프로토콜 서버를 제공하는 Node.js 애플리케이션입니다.

  1. 목차
    1. 특징
      1. 필수 조건
        1. 설치
          1. 구성
            1. 환경 변수
            2. 구성 파일
          2. API 엔드포인트
            1. 프로젝트
            2. 저장소
            3. 태그
            4. 헬름 차트
          3. MCP 도구
            1. 개발
              1. 개발 모드에서 실행
              2. 테스트 실행
              3. 디버그 도구
            2. 프로젝트 구조
              1. 문제 해결
                1. 일반적인 문제
                2. 디버그 모드
                3. 지원하다
              2. 특허

                Related MCP Servers

                • A
                  security
                  A
                  license
                  A
                  quality
                  A comprehensive Model Context Protocol server that provides advanced Node.js development tooling for automating project creation, component generation, package management, and documentation with AI-powered assistance.
                  Last updated -
                  7
                  4
                  MIT License
                • A
                  security
                  F
                  license
                  A
                  quality
                  A comprehensive Model Context Protocol server that enables users to interact with the ShipStation API for managing orders, shipments, carriers, warehouses, products, customers, stores, webhooks, and fulfillments through structured tools.
                  Last updated -
                  39
                  2
                • A
                  security
                  F
                  license
                  A
                  quality
                  A comprehensive server that enables interaction with the ShipHero API through the Model Context Protocol, providing tools for managing orders, products, inventory, shipping, warehouses, vendors, and webhooks.
                  Last updated -
                  29
                • A
                  security
                  F
                  license
                  A
                  quality
                  A Model Context Protocol server implementation that provides endpoints for wallet-based authentication, cluster management, and name registration services.
                  Last updated -
                  1

                View all related MCP servers

                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/nomagicln/mcp-harbor'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server