README
🚀 Opendock MCP 服务器
Opendock MCP 服务器是一个 MCP 服务器,它能将 AI 助手(如 Claude 等)连接到知名的 Opendock Neutron API。
🚀 快速开始
无需克隆或构建项目,使用 npx 即可快速开启:
npx -y opendock-mcp
也可以全局安装:
npm install -g opendock-mcp
✨ 主要特性
该服务器提供了涵盖 11 个类别的 69 种工具,具体如下:
| 类别 | 工具 |
|----------|-------|
| 通用 | get_version, get_profile |
| 仓库 | list_warehouses, get_warehouse, get_warehouse_hours, create_warehouse, update_warehouse, delete_warehouse |
| 码头 | list_docks, get_dock, create_dock, update_dock, delete_dock, sort_docks, get_dock_availability |
| 负载类型 | list_load_types, get_load_type, get_load_type_availability, create_load_type, update_load_type, delete_load_type |
| 预约 | list_appointments, search_appointments, get_appointment, create_appointment, update_appointment, delete_appointment, get_public_appointment, undo_appointment_status, create_recurring_appointments, delete_recurring_appointments, add_appointment_tag, remove_appointment_tag |
| 承运人 | list_carriers, get_carrier, create_carrier, update_carrier, get_booked_carriers |
| 公司 | list_companies, get_company, create_company |
| 组织 | get_org, update_org, update_favorite_carriers |
| 审计日志 | get_audit_log |
| 设置元数据 | get_settings_metadata, get_setting_metadata, validate_settings_metadata |
| 指标 | get_appointment_volume_by_date, get_appointment_volume_by_carrier, get_appointment_volume_by_load_type, get_appointment_volume_by_time_of_day, get_appointment_volume_by_day_of_week, get_appointment_avg_duration_by_load_type, get_appointment_avg_duration_by_status, get_appointment_avg_duration_by_dock_and_status, get_appointment_count_for_carrier, get_appointment_count_by_status_for_carrier, get_appointment_count_for_docks, get_reserve_count_for_user, get_dock_dwell_time, get_carrier_status_percentages, list_appointment_metrics, export_appointment_metrics_excel, get_appointment_status_times, get_first_available_appointment, get_warehouse_insights, get_warehouse_capacity_usage, export_yard_data_excel |
📦 安装指南
前提条件
- Node.js 18+
- 拥有具备 API 访问权限的 Opendock 账户
认证方式
服务器支持两种认证方式:
- 选项 1:用户名/密码(推荐) — 服务器会自动处理登录和令牌刷新。
OPENDOCK_USERNAME=user@example.com
OPENDOCK_PASSWORD=your-password
- 选项 2:已有 JWT 令牌
OPENDOCK_TOKEN=your-jwt-token
可选择设置 API URL:
OPENDOCK_API_URL=https://neutron.opendock.com # 生产环境(默认)
OPENDOCK_API_URL=https://neutron.staging.opendock.com # 预发布环境
💻 使用示例
与 Claude Desktop 配合使用
将以下内容添加到 claude_desktop_config.json 文件中:
{
"mcpServers": {
"opendock": {
"command": "npx",
"args": ["-y", "opendock-mcp"],
"env": {
"OPENDOCK_USERNAME": "user@example.com",
"OPENDOCK_PASSWORD": "your-password"
}
}
}
}
与 Claude Code 配合使用
claude mcp add opendock -- npx -y opendock-mcp
在启动 Claude Code 之前设置所需的环境变量,或者在 MCP 配置中传递这些变量。
测试
使用 MCP Inspector 进行交互式测试:
OPENDOCK_USERNAME=user@example.com OPENDOCK_PASSWORD=your-password \
npx @modelcontextprotocol/inspector npx -y opendock-mcp
开发
git clone https://github.com/Pollamin/opendock-mcp.git
cd opendock-mcp
npm install
npm run build
📄 许可证
本项目采用 MIT 许可证。
微信扫一扫