Connect Your Factory to AI
250+ MCP tools, a CESMII-compatible REST API, and native Sparkplug B. Give any AI agent real-time access to your factory floor.
Built on the Unified Namespace (UNS). One MQTT broker as the single source of truth. Every API, tool, and agent connects to the same namespace. No point-to-point integrations.
Try it in 30 seconds — no credentials needed
Run the MCP server in sandbox mode to connect Claude or Cursor to a read-only demo factory. Explore fleet status, alerts, OEE, and recommendations against synthetic data before connecting your deployment.
npx @flowstate/mcp-server --sandboxSandbox is read-only. Connect your deployment for write tools (acknowledge alerts, create work orders, etc.). Setup guide below.
MCP Tools
250+Give Claude, Cursor, or any MCP client real-time factory data. Fleet status, alerts, OEE, recommendations, and more.
i3x REST API
16CESMII-compatible Smart Manufacturing API with 8 primitives. Objects, values, history, alerts, commands, subscriptions.
Sparkplug B
10Native Sparkplug B v3.0 with MQTT v5 transport. Birth/death certificates, Report by Exception, auto-discovery into ISA-95.
Connect in 5 Minutes
Three steps to give your AI agent real-time factory data
Get your API key
Go to Settings in your Flowstate portal, navigate to the API Keys tab, and generate a webhook secret. Your credentials are orgId:webhookSecret encoded as base64.
Configure your MCP client
Add the Flowstate MCP server to Claude Desktop, Cursor, or any MCP-compatible client. Streamable HTTP is recommended (no local install required).
// claude_desktop_config.json (recommended)
{
"mcpServers": {
"flowstate": {
"url": "https://your-deployment.convex.site/api/mcp",
"transport": "streamable-http",
"headers": {
"Authorization": "Bearer <base64(orgId:secret)>"
}
}
}
}Alternative: STDIO transport (local install)
// Alternative: STDIO transport (npx — no install required)
{
"mcpServers": {
"flowstate": {
"command": "npx",
"args": ["@flowstate/mcp-server"],
"env": {
"FLOWSTATE_API_URL": "https://your-deployment.convex.site",
"FLOWSTATE_ORG_ID": "org_abc123",
"FLOWSTATE_API_SECRET": "your-webhook-secret"
}
}
}
}Query your factory
Ask your AI agent about your machines. It will use the MCP tools automatically.
// Example: Ask Claude about your factory
"What machines have active alerts right now?"
// Claude calls flowstate_get_active_alerts → returns:
{
"alerts": [
{
"severity": "critical",
"asset": "Haas VF-2",
"metric": "velocity_x_mm_s",
"value": 8.4,
"threshold": 7.1,
"message": "High vibration detected on spindle bearing"
}
]
}MCP Tools (250+)
Model Context Protocol tools grouped by domain. Works with Claude Desktop, Cursor, Ignition 8.3, any MCP client.
Fleet & Assets
42Fleet status, asset search, machine details, ISA-95 hierarchy navigation, equipment classes, device inventory
get_fleet_statussearch_assetsget_asset_detailsget_hierarchyAlerts & Alarms
38Active alerts, acknowledge, shelve, resolve, alarm health, rationalization metrics, SLA tracking, standing alarms
get_active_alertsacknowledge_alertshelve_alertget_alarm_healthOEE & Production
45OEE snapshots, production runs, utilization, shift schedules, downtime reasons, SEMI E10 states, work orders
get_oee_snapshotlist_production_runsget_utilizationlog_downtimeRecommendations
35AI-generated suggestions, feedback loops, breach predictions, diagnosis reports, learning loop metrics
get_recommendationssubmit_feedbackpredict_breachescreate_work_orderConfiguration
52Alert thresholds, shift schedules, maintenance windows, notification preferences, factory setup, vertical profiles
get_thresholdsconfigure_shiftssetup_factoryget_integrationsAnalytics
54Metric trends, cross-asset correlations, anomaly detection, SPC analysis, energy intensity, benchmarks, supply chain
get_metric_historyget_correlationsget_anomaliesget_benchmarksAuthority-gated writes: Write operations require a minimum authority level set on your organization:observe(read-only) →advise→supervised→autonomous. Human approval gates on irreversible actions.
i3x REST API
CESMII-compatible Smart Manufacturing API. OpenAPI 3.0 spec available.
/api/i3x/objectsObjects API
Browse the ISA-95 hierarchy. Filter by type, depth, or parent.
/api/i3x/valuesValues API
Real-time metric values with VQT quality (Good/GoodNoData/Bad).
/api/i3x/historyHistory API
Time-series data. Statistical aggregates: mean, min, max, count.
/api/i3x/alertsAlerts API
Active alarms with ISA-18.2 priority levels and SLA tracking.
/api/i3x/commands/sendCommands API
Send DCMD/NCMD to edge nodes. Authority-gated writes.
/api/i3x/subscriptionsSubscriptions
SSE event streams. Poll for alert, value, and status changes.
/api/i3x/profilesNo authProfiles API
SM Profile browsing. 13 CESMII profiles with metric schemas.
/api/benchmarks/leaderboardNo authBenchmarks
Anonymous OEE benchmarks by industry and machine type.
Quick Start -- curl
# 1. Encode your credentials
TOKEN=$(echo -n "org_abc123:your_webhook_secret" | base64)
# 2. List all assets in your ISA-95 hierarchy
curl https://your-deployment.convex.site/api/i3x/objects \
-H "Authorization: Bearer $TOKEN"
# 3. Get live metric values for a specific asset
curl "https://your-deployment.convex.site/api/i3x/values?assetId=abc123" \
-H "Authorization: Bearer $TOKEN"Subscriptions: Flowstate uses polling-based subscriptions (24-hour TTL) due to serverless architecture constraints. For real-time data streaming, use MQTT Sparkplug B directly or configure outbound webhooks. SSE (Server-Sent Events) is not supported.
Authentication
Bearer token using base64-encoded org credentials
All authenticated endpoints use a Bearer token derived from your organization credentials. Encode orgId:webhookSecret in base64 and pass it as the Authorization header.
Token format
Authorization: Bearer <base64(orgId:secret)>Shell example
TOKEN=$(echo -n "org_id:secret" | base64)Public endpoints (/api/i3x/profiles, /api/i3x/openapi.json, /api/benchmarks/leaderboard) require no authentication.
Sparkplug B MQTT
Primary inbound path for device telemetry. HiveMQ Cloud broker, MQTT v5, TLS 1.3.
spBv1.0/{GROUP_ID}/{MSG_TYPE}/{EDGE_NODE}/{DEVICE}GROUP_IDISA-95 namespace: Enterprise:Site:AreaMSG_TYPENBIRTH, NDEATH, DBIRTH, DDEATH, DDATA, NDATA, NCMD, DCMDEDGE_NODECell-level edge compute identifierDEVICESensor or machine identifiercleansession: falsePayloadGoogle protobuf (binary, not JSON)DBIRTH are automatically discovered into the ISA-95 hierarchy. No manual registration required.| Type | Description |
|---|---|
NBIRTH | Edge node birth certificate — announces the node and its full metric list |
NDEATH | Edge node death — published by broker when node disconnects (LWT) |
DBIRTH | Device birth — announces a connected device and its metric list |
DDEATH | Device death — device went offline or was disconnected |
DDATA | Device data — Report by Exception, only publishes changed metrics |
NDATA | Edge node data — node-level metrics (aggregates, health) |
NCMD | Node command — request rebirth, change node-level setpoints |
DCMD | Device command — write to device metrics, trigger actions |
DRECORD | Structured record batch — multiple timestamped datapoints in one message |
NRECORD | Node record batch — Sparkplug B 4.0 extension for batch data |
Outbound Webhooks
Subscribe to platform events. HMAC-SHA256 signed. Retry 3x with exponential backoff.
alert.triggeredAn alert rule threshold was breachedalert.resolvedA previously triggered alert returned to normalasset.status_changedAn asset went online, offline, or changed staterecommendation.createdA new maintenance recommendation was generatedproduction_run.startedA production run began on a machineproduction_run.completedA production run finishedwork_order.status_changedA work order status was updatedmanufacturing_order.releasedA manufacturing order was released to the floorinventory.low_stockInventory fell below the reorder thresholdoee.snapshot_createdA daily OEE snapshot was calculatedquality.inspection_createdA quality inspection was recorded{
"event": "alert.triggered",
"timestamp": 1710000000000,
"data": {
"alertId": "alert_abc123",
"severity": "critical",
"asset": {
"id": "asset_xyz",
"name": "Haas VF-2",
"type": "cnc"
},
"rule": {
"name": "High Vibration",
"metric": "velocity_x_mm_s",
"threshold": 7.1,
"actualValue": 8.4
}
}
}const crypto = require("crypto");
function verifyWebhook(rawBody, secret, signatureHeader) {
const expected = crypto
.createHmac("sha256", secret)
.update(rawBody)
.digest("hex");
return `sha256=${expected}` === signatureHeader;
}Inbound REST Webhook
For systems that cannot speak MQTT -- send telemetry via HTTP POST
POST /api/inboundFeatures
- Idempotent deduplication via
eventId - Auto-discovery into ISA-95 hierarchy
- Report by Exception (only changed metrics)
- Dead letter queue for failed ingestion
Auth
Authorization: Bearer {API_KEY}
Accepts Sparkplug B message types (DBIRTH, DDATA, DDEATH) as JSON payloads.
Ready to Connect?
API access, MQTT credentials, and integration support are included with every deployment. Contact us to get your organization credentials and start building.