MCP 港
MCP Harbor 是一个 Node.js 应用,它提供了一个模型上下文协议 (MCP) 服务器,用于与 Harbor 容器注册表进行交互。它还包含一个用于 Harbor 操作的 REST API。
目录
特征
MCP 服务器:通过模型上下文协议公开与 Harbor 交互的工具
REST API :为 Harbor 操作提供 RESTful 端点
Harbor Operations :支持项目、存储库、标签和 Helm 图表的操作
TypeScript :用 TypeScript 编写,以获得更好的类型安全性和开发人员体验
自动化测试:全面的测试套件,确保可靠的功能
先决条件
在安装 MCP Harbor 之前,请确保您已:
Node.js 18.x 或更高版本
npm 8.x 或更高版本
访问 Harbor 注册表实例
Git(用于克隆存储库)
安装
克隆存储库:
git clone https://github.com/nomagicln/mcp-harbor.git导航到项目目录:
cd mcp-harbor安装依赖项:
npm install构建项目:
npm run build启动应用程序:
npm start
配置
环境变量
在根目录中创建一个.env
文件,其中包含以下变量:
配置文件
可以在src/config/harbor.config.ts
中设置其他配置选项:
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
- 删除标签
Helm Charts
GET /projects/:projectId/charts
- 列出项目中的 Helm 图表GET /projects/:projectId/charts/:chartName/versions
- 列出 Helm chart 的版本DELETE /projects/:projectId/charts/:chartName/versions/:version
- 删除 Helm 图表版本
MCP 工具
MCP 服务器公开以下工具:
工具名称 | 描述 | 参数 |
| 列出 Harbor 中的所有项目 | 没有任何 |
| 通过ID获取项目详细信息 |
|
| 创建新项目 |
|
| 删除项目 |
|
| 列出项目中的存储库 |
|
| 删除存储库 |
|
| 列出存储库中的标签 |
|
| 删除标签 |
|
| 列出 Helm 图表 |
|
| 列出图表版本 |
|
| 删除图表版本 |
|
发展
以开发模式运行
运行测试
调试工具
该项目在tools
目录中包含调试工具:
项目结构
故障排除
常见问题
连接失败
Error: Unable to connect to Harbor instance验证 HARBOR_URL 是否正确且可访问
检查网络连接
确保 Harbor 实例正在运行
身份验证失败
Error: Invalid credentials验证 HARBOR_USERNAME 和 HARBOR_PASSWORD 是否正确
检查用户是否具有所需的权限
构建错误
Error: TypeScript compilation failed运行
npm install
以确保所有依赖项都已安装检查 TypeScript 版本兼容性
清除
dist
目录并重建
调试模式
通过设置启用调试日志记录:
支持
如需更多帮助:
检查DEBUG.md文件
运行连接测试:
npm run test:connection
查看
logs/
目录中的应用程序日志
执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
This server cannot be installed
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.
一个 Node.js 应用程序,提供用于与 Harbor 容器注册表交互的模型上下文协议服务器,支持项目、存储库、标签和 Helm 图表的操作。
Related MCP Servers
- AsecurityAlicenseAqualityA 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 -75MIT License
- AsecurityFlicenseAqualityA 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 -392
- AsecurityFlicenseAqualityA 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.
- AsecurityFlicenseAqualityA Model Context Protocol server implementation that provides endpoints for wallet-based authentication, cluster management, and name registration services.Last updated -1