MCP Server
Haltless runs a Model Context Protocol (MCP) server, so your own AI agents (Claude, Codex, Cursor, VS Code, or anything else that speaks MCP) can read your machines, readings, alerts, work orders, downtime, maintenance and OEE, and, with a key that may write, act on them: acknowledge alerts, open and update work orders, log and end stops, schedule and update maintenance. To set an agent up, see Connect your AI agents.
| Endpoint | POST /api/v1/mcp on https://api.haltless.io |
| Transport | Streamable HTTP, stateless: each request is answered in its own application/json response |
| Protocol versions | 2026-07-28; 2025-11-25, 2025-06-18 and 2025-03-26 through the initialize handshake |
| Capabilities | Tools: nine that read, and seven that write for a key that may. No resources, prompts or sampling |
| Authentication | A service-account API key |
Authentication
Send a service-account key in the X-API-Key header, or as Authorization: Bearer <key> for clients that can only send a bearer token.
A service account has a role, and the server sees exactly what that role sees in the portal:
- Pages decide the tools. Each tool belongs to a portal page. A role that cannot see the page is not offered the tool, and calling it anyway returns a tool error saying so.
- Machine scope decides the records. If the role is limited to some machine groups, every answer is limited to those machines. A machine outside them reads as not found.
- The key's access decides whether it may write. A service account is read only or read and write. A read-only key is offered only the reading tools, and a writing tool it calls anyway is refused with a tool error saying so.
- The role decides which writes. A writing tool also needs a role allowed to take that action in the portal: in Haltless that is the Admin or Operator tier (a custom role by the tier it is based on), and for downtime and maintenance the company must not have revoked
downtime.writeormaintenance.writefrom the role under Settings → Role Permissions. A Viewer key is never offered a writing tool.
Every change an agent makes is made as the service account and recorded in the audit log, with the tool that made it.
| Status | When |
|---|---|
401 | No key, an unknown key, or a revoked or expired one |
403 | An edge-agent key (they only send readings), a company without the API Access feature, or a suspended company |
Transport
- POST a JSON-RPC 2.0 message to the endpoint and read the response body. A notification is answered with
202and no body. - GET and DELETE answer
405. There is no event stream and no session (noMcp-Session-Id), so any server instance answers any request. - A request body is at most 1 MB; a larger one is refused with
413and JSON-RPC error-32600. A batch that is empty or holds more than 20 messages is a400with the same error code. - Requests count against the rate limit for writes, since they are POSTs: 120 per minute for each key, under the company's ceiling.
Protocol versions
The server speaks both eras of the protocol and tells them apart per request.
2026-07-28. No handshake. Each request carries its protocol version and the client's capabilities in params._meta (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities), mirrored in the MCP-Protocol-Version, Mcp-Method and (for tools/call) Mcp-Name headers. server/discover returns the supported versions, capabilities and instructions.
| Error | Code | Status |
|---|---|---|
| A header disagrees with the body | -32020 | 400 |
A protocol version the server does not speak (data.supported lists the ones it does) | -32022 | 400 |
| Unknown method | -32601 | 404 |
2025-11-25 and earlier. Call initialize once; the server answers with the version you asked for if it speaks it, or 2025-11-25. Then send requests with the negotiated MCP-Protocol-Version header; an unknown one is a 400. Batches of up to 20 messages are accepted.
Every result carries resultType: "complete"; the tool list is cacheScope: "private" (it depends on the key's role) with a ttlMs. Clients of the handshake era ignore those fields.
Example
curl https://api.haltless.io/api/v1/mcp \
-H "X-API-Key: YOUR_SERVICE_ACCOUNT_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
"params":{"name":"list_alerts","arguments":{"days":7,"severity":["critical"]}}}'
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": [{ "type": "text", "text": "{\"period\":{...},\"alerts\":[...],\"returned\":3,\"more\":false}" }],
"structuredContent": {
"period": { "start": "2026-11-07T21:00:00+00:00", "end": "2026-11-14T21:00:00+00:00", "days": 7 },
"alerts": [
{
"raised_at": "2026-11-14T18:42:10+00:00",
"machine": "Press 4",
"machine_id": "5f0c…",
"severity": "critical",
"metric": "temperature",
"value": 92.5,
"threshold": 80.0,
"message": "Temperature above 80 °C",
"state": "open",
"acknowledged_at": null,
"resolved_at": null
}
],
"returned": 3,
"more": false
},
"isError": false,
"resultType": "complete"
}
}
Every tool result carries its data twice: as JSON text in content for every client, and as structuredContent for clients that read it.
Tools
Ids are UUIDs; times are UTC, ISO 8601. Lists are newest first, return at most limit records, and set more: true when there were more. Every alert, work order, stop and maintenance event in a list carries its id, which the writing tools take.
Reading tools
Each says readOnlyHint: true.
| Tool | Page | Arguments | Returns |
|---|---|---|---|
get_fleet_overview | Dashboard | days (KPI window, 1–90, default 30) | Machines by status, active alerts by severity, MTTR, MTBF, average OEE and downtime hours over the window, and up to 10 machines that need attention |
list_machines | Machines | status (any of healthy, warning, critical, offline), search (part of a name or identifier), limit (1–200, default 100) | Each machine's id, name, identifier, status, active alerts and last reading time; how many matched |
get_machine | Machines | machine_id | The machine's status, location, active alerts and last reading, and the latest value, unit and raw tag of every metric it reports |
get_readings | Machines | machine_id, metrics (1–6 names), range_hours (1, 6, 24, 168, 720 or 2160; default 24), aggregation (avg, min, max) | One point per interval per metric (1 minute for an hour up to 12 hours for 90 days, at most about 240), with units |
get_oee | Machines | days, machine_id, limit | OEE per machine and shift day (availability, performance, quality, OEE as percentages, planned and downtime minutes, part counts) and the averages over the period |
list_alerts | Alerts | days, severity (info, warning, critical), state (open, acknowledged, resolved), machine_id, limit | Alerts raised in the period: machine, severity, metric, value, threshold, message, state, when acknowledged and resolved |
list_work_orders | Work Orders | days, status (open, in_progress, completed, cancelled), priority (low, medium, high, critical), machine_id, limit | Work orders created in the period: machine, title, status, priority, assignee, due date, completion, fix check, notes |
list_downtime | Downtime Log | days, category (planned, unplanned, changeover, maintenance), machine_id, limit | Stops that started in the period: machine, start, end, duration in minutes, category, reason, note, how it was logged |
list_maintenance | Maintenance | days, status (scheduled, in_progress, completed, cancelled), machine_id, limit | Maintenance scheduled from the start of the period on, done or planned: machine, title, status, scheduled start and end, whether due by use |
For the list tools days is 1–365 (default 7 for alerts, 30 for the rest) and limit is 1–100 (default 25). An argument a tool does not take is refused, rather than ignored.
Writing tools
Offered only to a key whose access is read and write, with a role allowed to take the action (see Authentication). Each says readOnlyHint: false; the ones that change an existing record also say destructiveHint: true. Each is the portal's own action, so it has the same effects as a person taking it there. None deletes anything.
| Tool | Page | Arguments | Does |
|---|---|---|---|
acknowledge_alert | Alerts | alert_id | Acknowledges an open alert as the service account. An alert already acknowledged is a tool error |
create_work_order | Work Orders | machine_id, title, description, priority (low, medium, high, critical; default medium), due_date, alert_id (one of the machine's alerts; its playbook's steps are added) | Opens a work order, unassigned, and returns it |
update_work_order | Work Orders | work_order_id, then any of status (open, in_progress, completed, cancelled), priority, title, description, due_date, completion_notes | Changes the work order; completing it stamps when. A signed-off work order cannot be changed |
log_downtime | Downtime Log | machine_id, started_at, ended_at (leave it out for a stop still going on), category (planned, unplanned, changeover, maintenance; default unplanned), note | Records the stop and returns it |
end_downtime | Downtime Log | stop_id | Ends a stop still going on, now. Ending one already ended changes nothing |
schedule_maintenance | Maintenance | machine_id, title, description, scheduled_start, scheduled_end | Puts maintenance on the machine's calendar |
update_maintenance | Maintenance | maintenance_id, then any of status (scheduled, in_progress, completed, cancelled), title, description, scheduled_start, scheduled_end | Changes the event. Completing one that is due by use starts its count again |
Times must carry a timezone (Z or an offset), and an end must come after its start. An update needs at least one thing to change. Titles are up to 255 characters for a work order and 300 for maintenance, descriptions and completion notes up to 4,000, and a stop's note up to 2,000.
Errors
| What | Answered as |
|---|---|
| A tool argument that is wrong (out of range, unknown value, an argument the tool does not take) | A tool result with isError: true and a message naming each problem, so the agent can correct it |
| A machine the key cannot see, or that does not exist | A tool result with isError: true |
| A tool whose page the role cannot see | A tool result with isError: true, naming the page |
| A writing tool called with a read-only key, by a role that may not take the action, or for an action the company revoked | A tool result with isError: true, saying which and where an admin changes it. Nothing is changed |
| An alert, work order, stop or maintenance event the key cannot see, or that does not exist | A tool result with isError: true |
| A writing tool that fails partway | A tool result with isError: true; the change is rolled back whole |
| An unknown tool | JSON-RPC error -32602 |
| An unknown method | JSON-RPC error -32601 |
| Malformed JSON | 400, JSON-RPC error -32700 |