JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 36
  • Score
    100M100P100Q90355F
  • License MIT

MCP server for Work Order API integration in manufacturing execution systems (MES)

Package Exports

  • @dotzero.ai/work-order-mcp
  • @dotzero.ai/work-order-mcp/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@dotzero.ai/work-order-mcp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Work Order MCP Server

MCP server for Work Order API integration in manufacturing execution systems (MES).

Features

  • 101 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

Quick Start

# Build the server
npm install && npm run build

# Run with stdio (default)
WORK_ORDER_API_URL=https://your-api.com npm start

# Run with HTTP
TRANSPORT=http PORT=3000 WORK_ORDER_API_URL=https://your-api.com npm start

Installation

npx @dotzero.ai/setup

Method 2: Claude Code MCP (Manual)

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

Method 3: Clone from GitLab

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:

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"}}'

Method 4: Manual Configuration

Add to ~/.claude/settings.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"
      }
    }
  }
}

Method 5: npm Global Install

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 (100)

Authentication (2)

Tool Description
auth_login Login with email/password
auth_status Check authentication status

Work Orders (7)

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

Products (6)

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

Workers (5)

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

Operation History (7)

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

Reports & Analytics (8)

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)
workorder_dashboard ONE-CALL dashboard — status + production + worker + device rankings combined

Routes (7)

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

Operations (5)

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

Route Operations (6)

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

Devices (5)

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

Defect Reasons (4)

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

Defect Reason Categories (4)

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

Stations (6)

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

Abnormal History (5)

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

Abnormal Config (4)

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

Operation Product BOM (4)

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

Warehouses (4)

Tool Description
warehouse_list List warehouses
warehouse_get Get warehouse by UUID
warehouse_create Create new warehouse
warehouse_update Update existing warehouse

Warehouse Storage (4)

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

Product Storage (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

WMS (4)

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

Authenticate and List Work Orders

# 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)

Create and Track Work Order

# 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)

Generate Production Report

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

# Install dependencies
npm install

# Run in development mode (with hot reload)
npm run dev

# Build for production
npm run build

# Start production server
npm start

# Clean build artifacts
npm run clean

HTTP Transport

When running with TRANSPORT=http:

# Start server
TRANSPORT=http PORT=3000 WORK_ORDER_API_URL=https://your-api.com npm start

# Health check
curl http://localhost:3000/health

# MCP endpoint
curl -X POST http://localhost:3000/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"tools/list","id":1}'

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

License

MIT

Author

DotZero - https://dotzero.app

Repository

https://gitlab.com/dotzero/dz-ai