Skip to main content
Glama

MCP 하버

라이센스: MIT 타입스크립트 노드.js

MCP Harbor는 Harbor 컨테이너 레지스트리와 상호 작용하는 모델 컨텍스트 프로토콜(MCP) 서버를 제공하는 Node.js 애플리케이션입니다. 또한 Harbor 작업을 위한 REST API도 포함되어 있습니다.

목차

Related MCP server: ShipStation API MCP Server

특징

  • MCP 서버 : 모델 컨텍스트 프로토콜을 통해 Harbor와 상호 작용하기 위한 도구를 제공합니다.

  • REST API : Harbor 운영을 위한 RESTful 엔드포인트를 제공합니다.

  • Harbor Operations : 프로젝트, 저장소, 태그 및 Helm 차트에 대한 작업을 지원합니다.

  • TypeScript : 더 나은 유형 안전성과 개발자 경험을 위해 TypeScript로 작성됨

  • 자동화된 테스트 : 안정적인 기능을 위한 포괄적인 테스트 모음

필수 조건

MCP Harbor를 설치하기 전에 다음 사항을 확인하세요.

  • Node.js 18.x 이상

  • npm 8.x 이상

  • Harbor 레지스트리 인스턴스에 대한 액세스

  • Git(저장소 복제용)

설치

  1. 저장소를 복제합니다.

    지엑스피1

  2. 프로젝트 디렉토리로 이동합니다.

    cd mcp-harbor
  3. 종속성 설치:

    npm install
  4. 프로젝트를 빌드하세요:

    npm run build
  5. 애플리케이션을 시작합니다:

    npm start

구성

환경 변수

다음 변수를 사용하여 루트 디렉토리에 .env 파일을 만듭니다.

# Required HARBOR_URL=https://your-harbor-instance.com HARBOR_USERNAME=your_username HARBOR_PASSWORD=your_password # Optional PORT=3000 # Server port (default: 3000) LOG_LEVEL=info # Logging level (default: info) ENABLE_HTTPS=false # Enable HTTPS (default: false) SSL_CERT_PATH=/path/to/cert.pem # Required if ENABLE_HTTPS=true SSL_KEY_PATH=/path/to/key.pem # Required if ENABLE_HTTPS=true

구성 파일

추가 구성 옵션은 src/config/harbor.config.ts 에서 설정할 수 있습니다.

{ timeout: 30000, // API request timeout in milliseconds retryAttempts: 3, // Number of retry attempts for failed requests cacheEnabled: true, // Enable response caching cacheTTL: 300 // Cache TTL in seconds }

API 엔드포인트

프로젝트

  • GET /projects - 모든 프로젝트 나열

  • GET /projects/:id - 프로젝트 세부 정보 가져오기

  • POST /projects - 새 프로젝트 만들기

  • DELETE /projects/:id - 프로젝트 삭제

저장소

  • GET /projects/:projectId/repositories - 프로젝트의 저장소 나열

  • DELETE /projects/:projectId/repositories/:repositoryName - 저장소 삭제

태그

  • GET /projects/:projectId/repositories/:repositoryName/tags - 저장소의 태그 나열

  • DELETE /projects/:projectId/repositories/:repositoryName/tags/:tag - 태그 삭제

헬름 차트

  • GET /projects/:projectId/charts - 프로젝트의 Helm 차트 나열

  • GET /projects/:projectId/charts/:chartName/versions - Helm 차트 버전 나열

  • DELETE /projects/:projectId/charts/:chartName/versions/:version - Helm 차트 버전 삭제

MCP 도구

MCP 서버는 다음 도구를 제공합니다.

도구 이름

설명

매개변수

list_projects

Harbor의 모든 프로젝트 나열

없음

get_project

ID로 프로젝트 세부 정보 가져오기

id: number

create_project

새 프로젝트를 만듭니다

name: string, public?: boolean

delete_project

프로젝트 삭제

id: number

list_repositories

프로젝트의 저장소 나열

projectId: number

delete_repository

저장소 삭제

projectId: number, repoName: string

list_tags

저장소의 태그 나열

projectId: number, repoName: string

delete_tag

태그 삭제

projectId: number, repoName: string, tag: string

list_charts

Helm 차트 목록

projectId: number

list_chart_versions

차트 버전 목록

projectId: number, chartName: string

delete_chart

차트 버전 삭제

projectId: number, chartName: string, version: string

개발

개발 모드에서 실행

npm run dev

테스트 실행

# Run all tests npm test # Run tests with coverage npm run test:coverage # Run specific test file npm test -- test/harbor.test.ts

디버그 도구

이 프로젝트에는 tools 디렉토리에 디버그 도구가 포함되어 있습니다.

# Test Harbor connection npm run test:connection # Start debug server npm run debug:server

프로젝트 구조

mcp-harbor ├── src │ ├── app.ts # Main application entry point (MCP server) │ ├── config │ │ └── harbor.config.ts # Harbor configuration │ ├── controllers │ │ └── harbor.controller.ts # REST API controllers │ ├── services │ │ └── harbor.service.ts # Harbor service implementation │ ├── models │ │ └── harbor.model.ts # Data models │ ├── routes │ │ └── harbor.routes.ts # API route definitions │ └── types │ └── index.ts # TypeScript type definitions ├── test │ └── harbor.test.ts # Tests for Harbor service ├── tools │ ├── debug-server.ts # Debug server implementation │ └── test-connection.ts # Connection testing utility ├── .env.example # Example environment variables ├── .gitignore # Git ignore file ├── package.json # Project dependencies ├── tsconfig.json # TypeScript configuration └── README.md # Project documentation

문제 해결

일반적인 문제

  1. 연결 실패

    Error: Unable to connect to Harbor instance
    • HARBOR_URL이 올바르고 접근 가능한지 확인하세요.

    • 네트워크 연결 확인

    • Harbor 인스턴스가 실행 중인지 확인하세요.

  2. 인증 실패

    Error: Invalid credentials
    • HARBOR_USERNAME과 HARBOR_PASSWORD가 올바른지 확인하세요.

    • 사용자에게 필요한 권한이 있는지 확인하세요

  3. 빌드 오류

    Error: TypeScript compilation failed
    • 모든 종속성이 설치되었는지 확인하려면 npm install 실행하세요.

    • TypeScript 버전 호환성 확인

    • dist 디렉토리를 지우고 다시 빌드하세요

디버그 모드

다음을 설정하여 디버그 로깅을 활성화합니다.

LOG_LEVEL=debug

지원하다

추가 도움이 필요하면:

  1. DEBUG.md 파일을 확인하세요

  2. 연결 테스트를 실행합니다: npm run test:connection

  3. logs/ 디렉토리에서 애플리케이션 로그를 검토하세요.

특허

이 프로젝트는 MIT 라이선스에 따라 라이선스가 부여되었습니다. 자세한 내용은 라이선스 파일을 참조하세요.

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

Latest Blog Posts

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