轨迹吊舱mcp
用于Track-POD物流API的MCP服务器集成。使AI代理和应用程序能够通过模型上下文协议与Track POD服务进行交互。
特性
- API全轨道-POD覆盖范围
- 内置速率限制(20需求/秒,400需求/分钟)
- 失败请求的自动重试逻辑
- 带Zod验证的类型安全方法调用
- 支持批量操作
快速开始
选项1:与Claude Desktop一起使用
- 克隆此存储库:
git clone https://github.com/Kenneth-17/trackpod-mcp.git
cd trackpod-mcp- 安装依赖项并构建:
npm install
npm run build- 配置Claude桌面(请参阅 Claude桌面集成 在......下面
方案2:地方发展
npm install trackpod-mcp配置
将Track-POD API键设置为环境变量:
export TRACKPOD_API_KEY=your_api_key_here或者创建一个 .env 文件:
TRACKPOD_API_KEY=your_api_key_here用法
服务器通过MCP工具公开Track POD功能。以下是一些示例:
创建订单
{
"tool": "orders_create",
"arguments": {
"number": "ORD-2024-001",
"consignee": {
"name": "John Doe",
"phone": "+1234567890",
"email": "john@example.com"
},
"address": {
"street": "123 Main St",
"city": "New York",
"postalCode": "10001",
"country": "US"
},
"items": [
{
"name": "Product A",
"quantity": 2,
"weight": 5.5
}
]
}
}开始一条路线
{
"tool": "routes_start_by_code",
"arguments": {
"code": "ROUTE-2024-01-15-001"
}
}可用工具
订单管理(18个工具):
orders_create,orders_update,orders_bulk_createorders_get_by_number,orders_complete_by_number,orders_reject_by_numberorders_list_by_date以及更多。..
路线管理(20+工具):
routes_create,routes_get_by_code,routes_start_by_coderoutes_close_by_code,routes_add_order_by_code,routes_get_track_by_code- 还有更多的路线操作。..
驾驶员和车辆管理:
drivers_create,drivers_list,drivers_get_by_usernamevehicles_create,vehicles_list
公用设施:
test_ping-测试API连接reject_reasons_list-获取有效的拒绝理由
发展
# Install dependencies
npm install
# Run in development mode
npm run dev
# Build for production
npm run build
# Run tests
npm testClaude桌面集成
安装说明
- 找到您的Claude Desktop配置文件:
- 视窗: %APPDATA%\Claude\claude_desktop_config.json - macOS: ~/Library/Application Support/Claude/claude_desktop_config.json - Linux: ~/.config/claude/claude_desktop_config.json
- 添加Track POD MCP服务器配置:
{
"mcpServers": {
"trackpod": {
"command": "node",
"args": ["/absolute/path/to/trackpod-mcp/dist/index.js"],
"env": {
"TRACKPOD_API_KEY": "your_trackpod_api_key_here"
}
}
}
}- 重新启动克劳德桌面 加载MCP服务器
- 验证连接 问克劳德:
- “你能测试Track POD连接吗?” - 克劳德将使用 test_ping 用于验证API连接的工具
对话示例
订单管理:
You: "Create a new order for John Doe at 123 Main St, New York"
Claude: I'll create that order for you... [uses orders_create tool]
You: "Check the status of order ORD-2025-001"
Claude: Let me look up that order... [uses orders_get_by_number tool]路线规划:
You: "Show me today's unassigned orders and create optimal routes"
Claude: I'll check today's orders and create routes... [uses multiple tools]
You: "Start all morning routes and notify drivers"
Claude: Starting routes now... [uses routes_start_by_code tool]车队管理:
You: "Add a new driver named Mike Johnson with vehicle TRUCK-005"
Claude: I'll add the driver and vehicle... [uses drivers_create and vehicles_create]
You: "Which drivers are available right now?"
Claude: Let me check driver availability... [uses drivers_list tool]常见工作流
- 日常调度程序
- 审查待处理订单 - 创建和优化路线 - 分配司机和车辆 - 启动路线并监控进度
- 客户服务
- 查询订单状态 - 处理交货异常 - 流程拒绝或完成 - 更新客户信息
- 实时跟踪
- 监控活动路线 - 检查GPS位置 - 处理路线偏差 - 管理交货确认
- 批量操作
- 从电子表格导入订单 - 批量更新订单状态 - 生成每日报告 - 归档已完成的交付
测试
使用MCP检查器
在没有Claude Desktop的情况下测试MCP服务器:
npm run inspector这将打开一个可视化界面 http://localhost:5173 您可以在哪里:
- 查看所有可用工具
- 测试单个工具调用
- 查看请求/响应数据
- 调试集成问题
API文档
看 跟踪-POD API文档 获取详细的端点信息。
故障排除
常见问题
- “找不到API密钥”错误
- 确保在您的环境或claude_desktop_config.json中设置了TRACKPOD_API_KEY - 检查.env文件是否在项目根目录中
- “连接被拒绝”错误
- 验证Claude Desktop配置中的MCP服务器路径是否为绝对路径 - 确保你已经跑过了 npm run build 任何更改后 - 检查Node.js是否已安装且可访问
- “超出速率限制”错误
- 服务器自动处理速率限制 - 如果持续存在,请检查您的Track POD帐户限制
- 工具未出现在Claude中
- 配置更改后重新启动Claude Desktop - 验证配置文件中是否列出了MCP服务器 - 检查Claude Desktop日志中的启动错误
许可证
麻省理工学院
