MCP server for Work Order API integration in manufacturing execution systems (MES)
npm install @dotzero.ai/work-order-mcpMCP server for Work Order API integration in manufacturing execution systems (MES).
- 98 Tools covering work orders, products, workers, routes, operations, devices, quality, warehouse, and WMS
- Dual Transport: stdio (default) and HTTP
- Dual Output: Markdown and JSON formats
- Full CRUD: Create, read, update, delete operations
- Flexible Auth: Token-based or email/password authentication
- Pagination: All list operations support limit/offset
``bashBuild the server
npm install && npm run build
Installation
$3
`bash
npx @dotzero.ai/setup
`$3
`bash
claude mcp add -e WORK_ORDER_API_URL=https://work-order-api.dotzero.app \
-e USER_API_URL=https://user-api.dotzero.app \
dotzero-workorder -- npx -y @dotzero.ai/work-order-mcp
`$3
`bash
git clone git@gitlab.com:dotzero/dz-ai.git
cd dz-ai/packages/work-order-mcp
npm install && npm run build
`Then configure in Claude Code:
`bash
claude settings set mcpServers.work-order-api \
'{"command":"node","args":["/path/to/dz-ai/packages/work-order-mcp/dist/index.js"],"env":{"WORK_ORDER_API_URL":"https://your-api.com"}}'
`$3
Add to
~/.claude/settings.json:`json
{
"mcpServers": {
"work-order-api": {
"command": "node",
"args": ["/path/to/dz-ai/packages/work-order-mcp/dist/index.js"],
"env": {
"WORK_ORDER_API_URL": "https://your-api.com",
"WORK_ORDER_API_TOKEN": "your-jwt-token"
}
}
}
}
`$3
`bash
npm install -g @dotzero.ai/work-order-mcp
`Environment Variables
| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
|
WORK_ORDER_API_URL | Yes | - | Base URL of the Work Order API |
| WORK_ORDER_API_TOKEN | No | - | JWT token (or use auth_login tool) |
| USER_API_URL | No | https://dotzerotech-user-api.dotzero.app | Authentication API URL |
| TRANSPORT | No | stdio | Transport: "stdio" or "http" |
| PORT | No | 3000 | HTTP port (when TRANSPORT=http) |Available Tools (98)
$3
| Tool | Description |
|------|-------------|
| auth_login | Login with email/password |
| auth_status | Check authentication status |$3
| Tool | Description |
|------|-------------|
| workorder_list | List work orders with filters |
| workorder_get | Get by ID or UUID |
| workorder_create | Create new work order |
| workorder_update | Update existing work order |
| workorder_delete | Delete work order |
| workorder_details | Get full details with operations |
| workorder_count | Get work order count |$3
| Tool | Description |
|------|-------------|
| product_list | List products with filters |
| product_get | Get product by UUID |
| product_create | Create new product |
| product_update | Update existing product |
| product_details | Get product with full details |
| product_copy | Copy/duplicate a product |$3
| Tool | Description |
|------|-------------|
| worker_list | List workers with filters |
| worker_get | Get worker by UUID |
| worker_create | Create new worker |
| worker_update | Update existing worker |
| worker_delete | Delete worker |$3
| Tool | Description |
|------|-------------|
| operation_history_list | List operation history |
| operation_history_by_workorder | Get operations by work order |
| operation_history_get | Get operation history by UUID |
| operation_history_create | Create operation history record |
| operation_history_create_many | Batch create operation history |
| operation_history_delete | Delete operation history record |
| operation_history_timeline | Get operation timeline |$3
| Tool | Description |
|------|-------------|
| workorder_report | Get individual operation report records |
| report_update | Update a report record |
| weekly_report | Get weekly production report |
| analytics_operations | Get server-computed operation analytics |
| analytics_workorder_report | Get server-computed work order analytics |
| worker_efficiency_ranking | Rank workers by production efficiency (good/hr) |
| device_utilization_ranking | Rank devices by utilization (total hours) |
| production_summary | Summarize production output (qty, defect rate, throughput) |$3
| Tool | Description |
|------|-------------|
| route_list | List production routes |
| route_get | Get route by UUID |
| route_create | Create new route |
| route_update | Update existing route |
| route_delete | Delete route |
| route_by_product | Get routes by product UUID |
| route_copy | Copy/duplicate a route |$3
| Tool | Description |
|------|-------------|
| operation_list | List operations |
| operation_get | Get operation by UUID |
| operation_create | Create new operation |
| operation_update | Update existing operation |
| operation_delete | Delete operation |$3
| Tool | Description |
|------|-------------|
| route_operation_list | List route operations |
| route_operation_get | Get route operation by UUID |
| route_operation_create | Create route operation |
| route_operation_update | Update route operation |
| route_operation_delete | Delete route operation |
| route_operation_by_route | Get operations by route UUID |$3
| Tool | Description |
|------|-------------|
| device_list | List devices |
| device_get | Get device by UUID |
| device_create | Create new device |
| device_update | Update existing device |
| device_delete | Delete device |$3
| Tool | Description |
|------|-------------|
| defect_reason_list | List defect reasons |
| defect_reason_create | Create defect reason |
| defect_reason_update | Update defect reason |
| defect_reason_delete | Delete defect reason |$3
| Tool | Description |
|------|-------------|
| defect_reason_category_list | List defect reason categories |
| defect_reason_category_get | Get category by UUID |
| defect_reason_category_create | Create category |
| defect_reason_category_update | Update category |$3
| Tool | Description |
|------|-------------|
| station_list | List stations |
| station_get | Get station by UUID |
| station_create | Create new station |
| station_update | Update existing station |
| station_delete | Delete station |
| station_device_list | List devices at a station |$3
| Tool | Description |
|------|-------------|
| abnormal_history_list | List work hour abnormal records |
| abnormal_history_get | Get abnormal record by UUID |
| abnormal_history_create | Create abnormal record |
| abnormal_history_update | Update abnormal record |
| abnormal_history_by_workorder | Get abnormals by work order |$3
| Tool | Description |
|------|-------------|
| abnormal_category_list | List abnormal categories |
| abnormal_category_create | Create abnormal category |
| abnormal_state_list | List abnormal states |
| abnormal_state_create | Create abnormal state |$3
| Tool | Description |
|------|-------------|
| op_product_bom_list | List operation product BOMs |
| op_product_bom_create | Create operation product BOM |
| op_product_bom_update | Update operation product BOM |
| op_product_bom_delete | Delete operation product BOM |$3
| Tool | Description |
|------|-------------|
| warehouse_list | List warehouses |
| warehouse_get | Get warehouse by UUID |
| warehouse_create | Create new warehouse |
| warehouse_update | Update existing warehouse |$3
| Tool | Description |
|------|-------------|
| warehouse_storage_list | List warehouse storage locations |
| warehouse_storage_get | Get storage location by UUID |
| warehouse_storage_create | Create storage location |
| warehouse_storage_update | Update storage location |$3
| Tool | Description |
|------|-------------|
| product_storage_list | List product storage records |
| product_storage_get | Get product storage by UUID |
| product_storage_by_product | Get storage by product UUID |$3
| Tool | Description |
|------|-------------|
| wms_check_inventory | Check and reconcile inventory |
| wms_query_product_storage | Query product storage via WMS |
| wms_query_storage_history | Query storage history |
| wms_minimal_stock_count | Get minimal stock level count |Work Order Status Values
| Value | Status | Description |
|-------|--------|-------------|
| 1 | Not Started | Created but not yet started |
| 2 | In Progress | Currently being processed |
| 3 | Completed | Finished successfully |
| 4 | Incomplete | Stopped before completion |
Usage Examples
$3
`
1. Check if authenticated
auth_status()2. If not, login
auth_login(email: "user@example.com", password: "password123")3. List rush orders
workorder_list(is_asap: true, status: 2)
`$3
`
Create a work order
workorder_create(
work_order_id: "WO-2024-001",
qty: 100,
deadline: "2024-12-31T23:59:59Z"
)Start production
workorder_update(id: "uuid-here", status: 2)Get full details with operations
workorder_details(work_order_id: "WO-2024-001")Complete
workorder_update(id: "uuid-here", status: 3, good: 95)
`$3
`
workorder_report(
start_time_start: "2024-01-01T00:00:00Z",
start_time_end: "2024-01-31T23:59:59Z",
response_format: "json"
)
`Response Formats
All tools support
response_format parameter:- markdown (default): Human-readable output with headers and formatting
- json: Machine-readable JSON output
Development
`bash
Install dependencies
npm installRun in development mode (with hot reload)
npm run devBuild for production
npm run buildStart production server
npm startClean build artifacts
npm run clean
`HTTP Transport
When running with
TRANSPORT=http:`bash
Start server
TRANSPORT=http PORT=3000 WORK_ORDER_API_URL=https://your-api.com npm startHealth check
curl http://localhost:3000/healthMCP endpoint
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
`Documentation
- Skill Definition - Complete tool reference
- llms.txt - AI documentation index
- llms-full.txt - Complete AI documentation
Project Structure
`
work-order-mcp/
├── src/
│ ├── index.ts # Server entry point
│ ├── client.ts # API client
│ ├── schemas.ts # Zod validation schemas
│ ├── types.ts # TypeScript types
│ ├── helpers.ts # Shared helper functions
│ ├── formatters.ts # Markdown formatting helpers
│ ├── tool-registry.ts # Central tool registration
│ └── tools/ # Modular tool definitions
│ ├── auth/ # Authentication tools
│ ├── workorders/ # Work order CRUD + details + count
│ ├── products/ # Product CRUD + details + copy
│ ├── workers/ # Worker CRUD
│ ├── op-history/ # Operation history + timeline
│ ├── reports/ # Reports & analytics
│ ├── routes/ # Production routes
│ ├── operations/ # Operations (工序)
│ ├── route-operations/# Route-operation mappings
│ ├── devices/ # Device management
│ ├── defect-reasons/ # Defect reason management
│ ├── defect-reason-categories/ # Defect categories
│ ├── stations/ # Station management
│ ├── abnormal-history/# Abnormal work hour history
│ ├── abnormal-config/ # Abnormal categories & states
│ ├── op-product-bom/ # Operation product BOM
│ ├── warehouse/ # Warehouse management
│ ├── warehouse-storage/ # Storage location management
│ ├── product-storage/ # Product storage records
│ └── wms/ # WMS inventory management
├── dist/ # Compiled output
├── .mcp.json # MCP configuration
├── llms.txt # AI doc index
├── llms-full.txt # Full AI doc
├── package.json
├── tsconfig.json
└── README.md
``MIT
DotZero - https://dotzero.app
https://gitlab.com/dotzero/dz-ai