OTDeck

Docs · AI agents

AI agents: the otdeck-mcp server

otdeck-mcp is a Model Context Protocol server over stdio that ships next to the app. An AI agent (Claude Desktop, Claude Code, Cursor, VS Code with Copilot, Codex or any MCP client) starts it on your computer. It reads the connections you saved in OTDeck (MQTT, Modbus, OPC UA and BACnet/IP), with the passwords from your OS keychain and OTDeck’s OPC UA trust list, and answers read tools. From 0.2 an agent can also ask to write, on connections you set to “Read and write”; each write waits for you to allow it in the OTDeck window (see Writes below). Nothing goes through an OTDeck server; there is none.

Where otdeck-mcp is

Settings → AI agents (MCP) shows the exact path on this computer and ready-to-copy snippets. The default install paths:

System Path
macOS /Applications/OTDeck.app/Contents/MacOS/otdeck-mcp
Windows (installer) C:\Program Files\AKStudio\OTDeck\otdeck-mcp.exe
Windows (Microsoft Store) %LOCALAPPDATA%\Microsoft\WindowsApps\otdeck-mcp.exe (execution alias)
Linux (.deb, .rpm) /usr/bin/otdeck-mcp
Linux (tar.gz) otdeck-mcp in the unpacked folder

Check it runs: otdeck-mcp -version prints the version, commit and licence=on (release builds).

Flags and environment:

  • -dir <path> or OTDECK_DIR: the OTDeck app directory to read (profiles.json, license.json, pki/); default the same as the app’s (~/Library/Application Support/OTDeck, %AppData%\OTDeck, $HOME/.config/OTDeck).
  • -version: print the version and exit.

When OTDeck itself runs with OTDECK_DIR, the snippets in Settings → AI agents already contain -dir with that directory.

Claude Code

Settings → AI agents → Add to Claude Code runs this for you. By hand:

# macOS
claude mcp add --scope user otdeck -- /Applications/OTDeck.app/Contents/MacOS/otdeck-mcp
# Linux
claude mcp add --scope user otdeck -- /usr/bin/otdeck-mcp
# Windows
claude mcp add --scope user otdeck -- "C:\Program Files\AKStudio\OTDeck\otdeck-mcp.exe"

claude mcp list should show otdeck as connected.

Claude Desktop

Claude Desktop → Settings → Developer → Edit Config opens claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json, Windows: %APPDATA%\Claude\claude_desktop_config.json). Add OTDeck under mcpServers (keep any servers already there) and restart Claude Desktop:

macOS:

{
  "mcpServers": {
    "otdeck": {
      "command": "/Applications/OTDeck.app/Contents/MacOS/otdeck-mcp",
      "args": []
    }
  }
}

Windows (backslashes doubled in JSON):

{
  "mcpServers": {
    "otdeck": {
      "command": "C:\\Program Files\\AKStudio\\OTDeck\\otdeck-mcp.exe",
      "args": []
    }
  }
}

Claude Desktop does not expand ~ or environment variables in command; use the full path.

Cursor

Settings → AI agents → Add to Cursor merges the entry into ~/.cursor/mcp.json (a backup of the old file is written next to it as mcp.json.otdeck-backup). By hand, in ~/.cursor/mcp.json or a project’s .cursor/mcp.json:

{
  "mcpServers": {
    "otdeck": {
      "command": "/Applications/OTDeck.app/Contents/MacOS/otdeck-mcp",
      "args": []
    }
  }
}

VS Code (GitHub Copilot agent mode)

VS Code keeps MCP servers under servers (not mcpServers). For one project, create .vscode/mcp.json; for every project, run MCP: Open User Configuration from the command palette:

{
  "servers": {
    "otdeck": {
      "type": "stdio",
      "command": "/Applications/OTDeck.app/Contents/MacOS/otdeck-mcp",
      "args": []
    }
  }
}

Then start the server from the code lens above the entry, and pick the OTDeck tools in Copilot Chat’s agent mode.

Codex

Settings → AI agents → Add to Codex writes this section to ~/.codex/config.toml:

[mcp_servers.otdeck]
command = "/Applications/OTDeck.app/Contents/MacOS/otdeck-mcp"
args = []

Tools

The read tools are marked read-only for the client, the five write tools (three writes, a method call and an alarm acknowledge) destructive. 18 tools in all. A connection is named by its name in OTDeck.

Tool What it returns
list_connections name, protocol, role, address, the tools for it, the Modbus ranges and the OPC UA or BACnet watch list set up in the app; never passwords
list_topics MQTT topics seen on a connection with counts, rate, retained flag and the last value (the first call listens for wait_ms)
read_topic the latest value of a topic, or of up to 100 topics matching a filter
sample_messages the messages arriving on a filter for up to wait_ms
read_registers Modbus coils, discrete inputs, holding or input registers decoded with a type and byte/word order, or a range saved in the app (with its scale, unit and description: value is scaled, raw_value is not); exceptions in plain words
browse the children of an OPC UA node, starting at Objects (i=85); on a BACnet connection the devices (device:2601) and the objects of one (device:2601/analog-input:1, or analog-input:1 when the connection points at one device) with their names
read_nodes OPC UA values with data type, status and timestamps; BACnet present values with units, status flags (ok, in-alarm, fault, overridden, out-of-service) and the object name; a BACnet schedule or calendar whole in schedule (weekly schedule, exceptions, effective period, default, targets, date list; read-only for agents). A schedule costs up to 10 device requests: at most 5 are read whole per call (1 on production, paced); one over 64 KB of JSON is left out with a note
read_history the history an OPC UA server keeps for a node (HistoryRead) over a time range: raw values with min/max/mean, or with aggregate (Average, Minimum, Maximum, Count, Interpolative, Start, End, Range, Total, TimeAverage) and interval (e.g. 15m) one value per interval computed by the server; ≤5000 values, ≤1000 on production connections. On a BACnet connection node_id is a trend-log object: its records in the range (ReadRange, no aggregates; up to 200 pages of 100 records in one call, so keep ranges narrow on production)
list_events OPC UA events of an object (default the Server object) for up to 10 s, newest first, plus the alarms the server retains (active, acknowledged, confirmed) with the condition_id and event_id that ack_alarm takes. On a BACnet connection the alarms (GetEventInformation, up to 50 pages per device) of one device (notifier: device:N) or, without a notifier, of every device of the connection (up to 50, one request at a time on production): event state, priority (the most urgent still waiting), transitions_waiting, and notification_class and event_type when a notification or the enrollment told them, condition_id = the object id. events are the notifications the app received (its history, bacnet-events.jsonl, the last 24 hours) and those this process received, newest first. include_enrollment: true adds enrollment: the objects configured to report events (GetEnrollmentSummary, or built from properties on devices without it) with their limits, deadband, time delay, notification class, the transitions they report and warnings; at most 500 rows
read_meters wired M-Bus meters of a connection, by key from list_connections (s:12345678, p:5), identification number or primary address; empty meters reads the meters the app polls. Each meter: identification number, manufacturer, medium, status and its records (quantity, value scaled to unit, text, storage number, tariff, subunit, function). Stored (historic) values only with history: true. At most 20 meters per call, 5 on production (paced); the bus is opened for the call and closed again, so a serial port or a gateway with one client must not be open in the app at the same time
trend_snapshot the app’s trend panel over the last ≤300 s: per series min/max/mean and thinned points (needs OTDeck running)
list_recordings, read_recording recordings saved by the app, with statistics and ≤500 thinned points per series
write_registers asks to write Modbus holding registers (06/16) or coils (05/15); needs reason; with scale the values are engineering values (the register gets value ÷ scale)
write_nodes asks to write the Value of up to 25 OPC UA nodes, or the Present_Value of BACnet objects at the connection’s write priority (null relinquishes it; binary objects take active/inactive, multi-state ones a state number or name), or with property one of the BACnet settings listed in BACnet guide (High_Limit, Event_Enable, Out_Of_Service, Object_Name, a notification class’s Priority…; never Recipient_List); needs reason
publish_message asks to publish one MQTT message (≤64 KB, QoS 0–2, retain); needs reason
call_method asks to call an OPC UA method with input arguments as text (≤64; OTDeck converts each to the type in the method’s InputArguments, arrays as JSON); returns the status and the outputs; needs reason
ack_alarm asks to acknowledge (or action: confirm) an alarm from list_events, with a comment; refused when it is already acknowledged or changed since the event_id; on a BACnet connection acknowledges one transition (to-offnormal, to-fault or to-normal) of the object’s alarm with the device’s own time stamp; needs reason

Sparkplug B payloads come back decoded, with metric names from the births the MCP connection has seen. Births are not retained by the broker, so a fresh agent session sees alias-only metrics (and a note saying so) until the edge node sends its next NBIRTH/DBIRTH (the simulator: every 60 s). Payloads are cut to 4 KB.

Limits

  • Free: one connection per agent session (the first one the agent uses); the trend snapshot shows only that connection’s series and recordings are refused. Pro and Team: every connection.
  • Production connections: one Modbus request (≤125 registers) or 25 OPC UA nodes or BACnet objects per call, at least 500 ms between device reads.
  • Writes: see below.
  • otdeck-mcp never accepts an OPC UA server certificate by itself: connect once in the app and trust it there.
  • Every call is logged to logs/otdeck.log in the app directory; Settings → AI agents shows the running agent sessions and the last call.

Writes (0.2, Pro and Team)

Edit connection → AI agents has three settings: Hidden (agents do not see the connection at all), Read (the default) and Read and write (Pro; not available on a read-only connection). A team file can hide connections (agents) or forbid agent writes (noAgentWrites); the setting is locked then.

otdeck-mcp itself never writes to a device. A write tool sends the request to the running OTDeck app over a Unix domain socket in the app directory (agent.sock, mode 0600; Windows 10 and later support it too). The app shows one window per request, oldest first (“1 of 3” when more wait): the agent’s name as it reports itself, the connection and its role, each register, node or topic with the value read just now and the new one, and the agent’s reason. Allow write makes the write through the same guarded path as a write by hand; on a production connection the name must be typed first. Deny, Escape, the close button, the agent giving up, or 60 s without an answer refuse it; nothing is remembered (“allow for 10 minutes” does not exist).

Method calls and alarms (0.5). call_method and ack_alarm take the same path and the same window, with Allow call, Allow acknowledge or Allow confirm. For a call the window shows the method and its object (names and node ids), its description and outputs, and each argument with its data type as it will be sent (“0x10” for an Int32 shows 16, “given as 0x10” beside it); a call whose argument count, numbers or types do not fit the method is refused before the window, and so is a call when the method’s argument types changed on the server while the window was open. For an alarm the window shows its name and condition id, source, message, severity, state (active, acknowledged, confirmed), the action and the comment; OTDeck looks the alarm up as the server reports it now (with a short event subscription when the events panel is closed) and refuses one that is already acknowledged, not acknowledged yet (confirm), or changed since the event_id the agent saw. Write log actions: opcua.call, opcua.ack.

Alarm recipients. Agents never add or remove a recipient of a BACnet Notification Class: there is no tool for it, and write_nodes refuses property: Recipient_List and a notification-class: object without a property before anything is asked (it accepts that class’s Priority and Ack_Required, each approved in the window like any write). The user adds OTDeck as a recipient in the Alarms tab (Recipients) or edits the list in the properties panel; ack_alarm stays a request the user allows.

Limits: 100 values (≤123 registers, one Modbus request) or 25 OPC UA nodes per call, 64 method arguments, an MQTT payload up to 64 KB, one allowed write per second per connection, at most 10 requests waiting. Every allowed write, and every request that was denied or timed out, is a line in the write log (audit/writes.jsonl) with agent and reason.

Any process running as you can open the socket, as it can read any file in the app directory; it can only ask, you still decide. If OTDeck is not running, the write tools answer that the app must be open.

Try it on the simulator

Start the simulator in OTDeck (Welcome → Start the simulator) and add its four connections (Getting started with OTDeck), then ask the agent:

  • “List my OTDeck connections.”
  • “On the OTDeck simulator broker, which topics under factory/line1 change every second, and what is the press temperature now?”
  • “Read holding registers 10 to 13 on Simulated PLC as float32, once ABCD and once CDAB. Which pair is the real pressure?”
  • “Browse Simulated press (OPC UA) under Plant1/Line1/Press and read every variable.”
  • “Is the press running? Check the status word at holding register 30 and the OPC UA State node.”
  • “What was the hourly average press temperature over the last two hours?” (read_history with aggregate: Average, interval: 1h)
  • “Set the press setpoint to 75 °C with its SetSetpoint method.” (Read and write connection: you allow the call in OTDeck)
  • “Is there an active alarm on the press? Acknowledge it with the comment ‘checking the heater’.” (list_events, then ack_alarm)
  • “List the objects of the simulated boiler and read its supply temperature, pressure and pump state.” (browse, then read_nodes on the BACnet connection)
  • “Read the last 10 minutes of the boiler’s trend log and tell me the average.” (read_history with node_id: trend-log:1)
  • “Set the boiler setpoint to 75 and hand it back to the schedule afterwards.” (write_nodes with 75, then with null: you allow each one)