Developer Platform

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.

bash
npx @flowstate/mcp-server --sandbox

Sandbox is read-only. Connect your deployment for write tools (acknowledge alerts, create work orders, etc.). Setup guide below.

Connect in 5 Minutes

Three steps to give your AI agent real-time factory data

1

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.

2

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

json
// 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)
json
// 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"
      }
    }
  }
}
3

Query your factory

Ask your AI agent about your machines. It will use the MCP tools automatically.

json
// 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

42

Fleet status, asset search, machine details, ISA-95 hierarchy navigation, equipment classes, device inventory

get_fleet_statussearch_assetsget_asset_detailsget_hierarchy

Alerts & Alarms

38

Active alerts, acknowledge, shelve, resolve, alarm health, rationalization metrics, SLA tracking, standing alarms

get_active_alertsacknowledge_alertshelve_alertget_alarm_health

OEE & Production

45

OEE snapshots, production runs, utilization, shift schedules, downtime reasons, SEMI E10 states, work orders

get_oee_snapshotlist_production_runsget_utilizationlog_downtime

Recommendations

35

AI-generated suggestions, feedback loops, breach predictions, diagnosis reports, learning loop metrics

get_recommendationssubmit_feedbackpredict_breachescreate_work_order

Configuration

52

Alert thresholds, shift schedules, maintenance windows, notification preferences, factory setup, vertical profiles

get_thresholdsconfigure_shiftssetup_factoryget_integrations

Analytics

54

Metric trends, cross-asset correlations, anomaly detection, SPC analysis, energy intensity, benchmarks, supply chain

get_metric_historyget_correlationsget_anomaliesget_benchmarks

Authority-gated writes: Write operations require a minimum authority level set on your organization:observe(read-only) advisesupervisedautonomous. Human approval gates on irreversible actions.

i3x REST API

CESMII-compatible Smart Manufacturing API. OpenAPI 3.0 spec available.

GET/api/i3x/objects

Objects API

Browse the ISA-95 hierarchy. Filter by type, depth, or parent.

GET/api/i3x/values

Values API

Real-time metric values with VQT quality (Good/GoodNoData/Bad).

GET/api/i3x/history

History API

Time-series data. Statistical aggregates: mean, min, max, count.

GET/api/i3x/alerts

Alerts API

Active alarms with ISA-18.2 priority levels and SLA tracking.

POST/api/i3x/commands/send

Commands API

Send DCMD/NCMD to edge nodes. Authority-gated writes.

GET/api/i3x/subscriptions

Subscriptions

SSE event streams. Poll for alert, value, and status changes.

GET/api/i3x/profilesNo auth

Profiles API

SM Profile browsing. 13 CESMII profiles with metric schemas.

GET/api/benchmarks/leaderboardNo auth

Benchmarks

Anonymous OEE benchmarks by industry and machine type.

Quick Start -- curl

bash
# 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.

Topic Structure
spBv1.0/{GROUP_ID}/{MSG_TYPE}/{EDGE_NODE}/{DEVICE}
GROUP_IDISA-95 namespace: Enterprise:Site:Area
MSG_TYPENBIRTH, NDEATH, DBIRTH, DDEATH, DDATA, NDATA, NCMD, DCMD
EDGE_NODECell-level edge compute identifier
DEVICESensor or machine identifier
Broker & Connection
BrokerHiveMQ Cloud (TLS 1.3, MQTT v5)Port8883 (TLS)AuthUsername/password per siteSessioncleansession: falsePayloadGoogle protobuf (binary, not JSON)
Devices that send a DBIRTH are automatically discovered into the ISA-95 hierarchy. No manual registration required.
Message Types
TypeDescription
NBIRTHEdge node birth certificate — announces the node and its full metric list
NDEATHEdge node death — published by broker when node disconnects (LWT)
DBIRTHDevice birth — announces a connected device and its metric list
DDEATHDevice death — device went offline or was disconnected
DDATADevice data — Report by Exception, only publishes changed metrics
NDATAEdge node data — node-level metrics (aggregates, health)
NCMDNode command — request rebirth, change node-level setpoints
DCMDDevice command — write to device metrics, trigger actions
DRECORDStructured record batch — multiple timestamped datapoints in one message
NRECORDNode record batch — Sparkplug B 4.0 extension for batch data

Outbound Webhooks

Subscribe to platform events. HMAC-SHA256 signed. Retry 3x with exponential backoff.

Event Types (11)
alert.triggeredAn alert rule threshold was breached
alert.resolvedA previously triggered alert returned to normal
asset.status_changedAn asset went online, offline, or changed state
recommendation.createdA new maintenance recommendation was generated
production_run.startedA production run began on a machine
production_run.completedA production run finished
work_order.status_changedA work order status was updated
manufacturing_order.releasedA manufacturing order was released to the floor
inventory.low_stockInventory fell below the reorder threshold
oee.snapshot_createdA daily OEE snapshot was calculated
quality.inspection_createdA quality inspection was recorded
Example Payload
json
{
  "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
    }
  }
}
Signature Verification
javascript
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/inbound

Features

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