Skip to content

MCP AI gateway

eaxScadaExplanationStarterProEnterpriseView as Markdown

Migrated page, not yet verified against the current code. Treat values, paths and examples as indicative until this notice is removed.

AI can help with diagnostics, maintenance and HMI authoring. Connecting a large language model directly to a control system, though, is dangerous: models hallucinate, reason non-deterministically and could issue unvetted writes to actuators.

eaxScada bridges this gap with the Model Context Protocol (MCP) over JSON-RPC 2.0 (protocol versions 2025-06-18, 2025-03-26 and 2024-11-05). The gateway is a governed, air-gap-friendly layer between external AI assistants (desktop assistants, IDE agents or local models) and the plant.

The MCP control center in eaxScada Studio: the resources an assistant can read, the tool tester and the human-in-the-loop gate where proposed writes wait for an operator. The MCP control center in eaxScada Studio: the resources an assistant can read, the tool tester and the human-in-the-loop gate where proposed writes wait for an operator.

The MCP control center in Studio: resources, tool tester and the human-in-the-loop gate.

System architectureWhat an AI client reaches through the MCP gateway
What an AI client reaches through the MCP gatewayAn AI client talks to the MCP gateway of the eaxScada server and to nothing else. It reads plant data within the read access of its account, and it can stage a tag write, which waits in a queue with the status PENDING. A person who did not stage it approves it with an electronic signature; only then is the value written to equipment through the driver.TRUST BOUNDARY · EAXSCADA SERVERAI clientdesktop app, IDEagent, local modelReviewera signed-in person,not who staged itMCP gatewayresources, tools,promptsStaged writesPENDINGApproval checkstag permission,write policy,e-signaturePlant datatags, alarms,screens, historyAudit trailwrittenfirstEquipmentwritten by the driverof the tag's channelJSON-RPC,/api/mcpreadstageHITL_STAGEDover WebSocketapprove, withe-signaturerecord firstCMDapprovedvalueCMDno write withoutan approvalThe AI co-pilot account neverapproves, rejects or withdraws,and never starts, stops, deploysto, rolls back or forces eaxPLC.
There is no path from the AI client to equipment that does not pass a person and a signature.
  • Service or process
  • Data store
  • Device or controller
  • Person or role
  • External system
  • Check or decision
  • Trust boundary
  • Data or telemetry
  • Command to equipment
  • Authentication
Read as text

An AI client talks to the MCP gateway of the eaxScada server and to nothing else. It reads plant data within the read access of its account, and it can stage a tag write, which waits in a queue with the status PENDING. A person who did not stage it approves it with an electronic signature; only then is the value written to equipment through the driver.

Parts

  • eaxScada server (trust boundary)
  • AI client (external system): desktop app, IDE agent, local model
  • Reviewer (person or role): a signed-in person, not who staged it
  • MCP gateway (service or process, inside eaxScada server): resources, tools, prompts
  • Staged writes (data store, inside eaxScada server): PENDING
  • Approval checks (check or decision, inside eaxScada server): tag permission, write policy, e-signature
  • Plant data (data store, inside eaxScada server): tags, alarms, screens, history
  • Audit trail (data store, inside eaxScada server): written first
  • Equipment (device or controller): written by the driver of the tag's channel

Connections

  • AI client → MCP gateway (data or telemetry): JSON-RPC, /api/mcp. The AI client calls the gateway at /api/mcp. An AI co-pilot account is refused on every other route of the server.
  • Plant data → MCP gateway (data or telemetry): read. The gateway reads tags, alarms, screens and history for the client, within the read access of its account. It reads only.
  • MCP gateway → Staged writes (data or telemetry): stage. The tool scada_stage_tag_write records the proposed value in the audit trail and queues it as PENDING. Nothing is sent to equipment.
  • Staged writes → Reviewer (data or telemetry): HITL_STAGED over WebSocket. The staged write is announced over the WebSocket as HITL_STAGED to the people who may read its tag.
  • Reviewer → Approval checks (authentication): approve, with e-signature. A reviewer approves with an electronic signature. The AI co-pilot account and the account that staged the write are refused.
  • Staged writes → Approval checks (next step). The approval checks run on the staged write: the reviewer's permission on the tag, the write policy and the signature.
  • Approval checks → Audit trail (data or telemetry): record first. The approval is recorded in the audit trail before the write. If the record cannot be written, nothing is sent and the write stays PENDING.
  • Approval checks → Equipment (command to equipment): approved value. After the checks and the record, the approved value is written to equipment by the driver of the tag's channel.
  • Staged writes → Equipment (command to equipment, not active): no write without an approval. A staged write that is not approved is never sent. No tool of the gateway writes a tag.

The AI co-pilot account never approves, rejects or withdraws, and never starts, stops, deploys to, rolls back or forces eaxPLC.

The gateway, its resources, tools and prompts are part of every edition. Some tools depend on other components:

Capability Starter Pro Enterprise
Embedded MCP server over HTTP (/api/mcp, /api/mcp/rpc) Yes Yes Yes
Read-only resources (UNS tree, alarms, screen schema) Yes Yes Yes
Screen tools (scada_validate_screen, scada_create_screen, …) Yes Yes Yes
scada_stage_tag_write with the human-in-the-loop queue; every approval signed with the approver’s password Yes Yes Yes
scada_query_tag_history (named tags over a time range) Yes Yes Yes
scada_query_historian (free SQL) Yes, on the columnar historian engine Yes, on the columnar historian engine Yes
plc_* tools With an eaxPLC runtime With an eaxPLC runtime With an eaxPLC runtime

The gateway (internal/mcp/) uses the MCP Streamable HTTP transport, without sessions or a server-to-client stream: a POST of a JSON-RPC request (or a batch) is answered with JSON; a POST of notifications only is answered 202 Accepted; a GET asking for text/event-stream is answered 405. A failing or refused tool answers a result with isError: true and the reason, so the assistant can correct itself; an unknown tool is error -32602 and an unknown resource -32002.

  • JSON-RPC 2.0: POST /api/mcp (or POST /api/mcp/rpc), with the account’s session token in the Authorization: Bearer header. A request that carries only the browser’s session cookie is refused unless it comes from the eaxScada page itself.
  • Browser discovery: GET /api/mcp or GET /api/mcp/rpc
  • REST mirrors: /api/mcp/resources, /api/mcp/tools, /api/mcp/prompts, /api/mcp/staged

An agent starts with a standard JSON-RPC call:

{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-06-18",
"capabilities": {
"resources": {},
"tools": {},
"prompts": {}
},
"clientInfo": {
"name": "engineering-assistant",
"version": "1.0.0"
}
}
}
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"protocolVersion": "2025-06-18",
"instructions": "eaxScada SCADA server. You act with the rights of the account whose token you carry...",
"capabilities": {
"resources": { "listChanged": false },
"tools": { "listChanged": false },
"prompts": { "listChanged": false }
},
"serverInfo": {
"name": "eaxScada-PLC-Unified-MCP",
"version": "2.4.0"
}
}
}

Resources give the assistant grounded context, so it does not invent tag names. Call resources/list for the exact URIs; the generated MCP reference will list each one.

Resource Content
Screen schema JSON Schema of valid displays: layers, shapes, bindings and animations.
Component catalogue Available components: procedural pipes, vessels, pumps, valves, instruments and widgets.
Example screens Reference synoptics for batch reactors and packaging fluid loops.
Runtime layout Dock modes and corner priority of the operator runtime.
resource://scada/uns/topology The ISA-95 Unified Namespace tag tree with live values, units and qualities.
resource://scada/udt/catalog User Defined Type (UDT) definitions, parameters and nested structures.
resource://scada/drivers/catalog Configured channels (Modbus, CIP, S7, OPC UA, MQTT) and their diagnostics.
resource://scada/alarms/active Standing ISA-18.2 alarms, severities, trip values and durations.
resource://scada/alarms/definitions Alarm conditions, thresholds, deadbands and notification roles.
resource://scada/recipes/catalog ISA-88 master recipes, formula parameters and active batches.
resource://scada/historian/schema The historian table schema, columns and sample queries. It states the quality rule (Good, Uncertain or Bad by the code’s major bits; an overridden value is Uncertain), its sample average reads Good samples only, and it tells the assistant to report Uncertain or Bad samples as such, with their count, never averaged in.

The topology, active alarms and alarm definitions resources list only the tags the calling account may read (its subscribe rules, see read permissions). A call without a signed-in account reads no tag data.

Resource Content
resource://plc/st/spec IEC 61131-3 Structured Text grammar, direct addressing (%I, %Q, %M) and standard function blocks.
resource://plc/memory/map Live memory map and symbol table.
resource://plc/program/active The Structured Text source currently running.
resource://plc/tasks/status Scan cycle timing and jitter.
resource://plc/versions/log Program version history: commits, authors and timestamps.

Tools let an assistant act, within the limits of its permissions.

Tool Safety policy Inputs Behaviour
scada_validate_screen Read-only screen_json Validates a candidate screen against the schema without saving it.
scada_get_screen Read-only display_id Returns the JSON definition of a screen.
scada_list_screens Read-only none Lists all screens with layer and component counts.
scada_list_tags Read-only, per tag prefix, limit (default 200, at most 1000) Lists the tags the account may read: path, live value, quality, unit, description.
scada_list_alarms Read-only, per tag none Lists the alarm definitions and the standing alarms on the tags the account may read.
scada_create_screen Engineering display_id, name, width, height, layers Creates a new screen; never replaces one (an existing id is refused). An AI account or an API-token client is refused (AI_SCREEN_SAVE_REFUSED) and proposes the screen with scada_propose_screen instead. A shape type the designer does not have is refused. The result lists the Problems panel’s findings.
scada_update_screen Engineering display_id, layers (and name, width, height, description, folder_id) Replaces the layers of an existing screen and keeps what it is not given.
scada_stage_tag_write Human-in-the-loop tag_path, proposed_value, reason Never writes to hardware. Creates a pending StagedAction that an operator must approve. Refused for a tag the account may not read.
scada_query_tag_history Read-only, per tag tag_paths (1-20 exact paths), from/to (RFC 3339) or last_minutes (default 60), bucket_seconds, limit (default 500, at most 1000 per tag), include_before (default false) Returns raw points, or min/max/avg buckets, of the named tags. Bucket min/max/avg use Good samples only, and each bucket gives its quality (section 7.1). With include_before, each tag also gets before, its last sample before the range (section 7.1). Every tag must be readable by the account, or the whole request is refused. No wildcards, no SQL. When the history store does not answer and no complete copy can, the tool returns an error (never a shorter history), and the assistant reports it.
scada_query_historian Governed SQL, full read only sql_query Runs one SELECT over the history table on the columnar historian engine. Only for accounts that may read every tag (see section 7). Returns {row_count, rows, row_limit, warning?}: every sample, each row with its quality_class, and a warning when the query ignores quality (section 7.1).
scada_list_checkpoints Read-only none Lists the project’s checkpoints: id, name, note, kind (named, automatic before a deploy or a revert, daily), locked, author, creation time, product version and document counts per domain.
scada_get_checkpoint Read-only checkpoint_id Returns one checkpoint’s summary and the names of the documents it holds per domain.
scada_compare_checkpoints Read-only a, b (checkpoint ids or current; b defaults to current) Lists what was added, changed and removed per domain from a to b, with the safety-relevant differences flagged (alarm limits, channel endpoints, write access, screen commands and interlocks, the emergency-stop tag, mapping address, type, scaling and target).

The three checkpoint tools answer exactly what GET /api/checkpoints, GET /api/checkpoints/{id} and GET /api/checkpoints/compare answer, under the same checks: the Starter edition or above and an account at engineer level. No tool takes, reverts, locks, unlocks or deletes a checkpoint: a person does that in the Studio (Project > Checkpoints), and a revert stays a signed act.

Tool Safety policy Inputs Behaviour
plc_compile_st Dry run source_code Compiles the program as a deploy would, through eaxPLC’s compile check, and returns the diagnostics; nothing is deployed.
plc_deploy_program Engineering; never the AI source_code, commit_message, author Hot-deploys Structured Text to the running PLC at a scan boundary.
plc_get_symbols Read-only none Returns addresses, types and current values of PLC symbols.
plc_force_io plc.force right; never the AI action (force, unforce, clear_all), address, value_bool or value_num, reason Forces, changes or releases a forced value on the PLC (no e-signature; the PLC audits every force event). Refused for the AI co-pilot and over the MCP JSON-RPC endpoint, where it is not listed: only a person (Lead_Engineer, Administrator) runs it, from the Studio MCP explorer.
plc_get_forces Read-only none Lists the active forces: address, value, who forced it and since when.
plc_control Supervisory; never the AI action (start, stop, reset, reset_cold) Starts, stops or resets the PLC scan.
plc_rollback_version Supervisory; never the AI commit_hash, reason Rolls the running program back to an earlier version.

PLC calls carry the signed-in eaxScada user and go through the same permission, e-signature and audit checks as calls from the eaxPLC Studio. An account that holds the AI_CoPilot role, whatever other roles it holds, is refused plc_control, plc_deploy_program, plc_rollback_version and plc_force_io (the refusal is audited), and tools/list does not offer them to it.


eaxScada bundles three prompt templates, written like standard operating procedures:

  1. scada/generate_synoptic guides an assistant to author ISA-101 synoptics in the dark industrial style (#090d16 canvas, #1e293b equipment, procedural pipes and tag bindings).
  2. plc/generate_st_program guides an assistant to write deterministic IEC 61131-3 Structured Text that follows the zero-allocation rule, direct addressing (%IX, %QX, %MW) and state-machine conventions.
  3. scada/diagnose_alarm is a root-cause sequence:
    • read the standing alarms resource;
    • analyse trends with scada_query_tag_history;
    • inspect live PLC values with plc_get_symbols;
    • propose a corrective setpoint with scada_stage_tag_write.

An AI assistant must never actuate equipment directly.

SequenceA staged write, from the AI client to the equipment
A staged write, from the AI client to the equipmentThe AI client stages a tag write through the MCP gateway. The eaxScada server checks it, records it in the audit trail and queues it as PENDING; nothing is sent. A reviewer is told and either rejects it with a reason or approves it with an electronic signature. An approval passes its own checks and is recorded before the server writes the value through the driver.A CHECK FAILSREJECTEDAPPROVEDAI clienteaxScadaMCP gatewayAudit trailReviewerEquipment1scada_stage_tag_writetag path, value, reasonStaging checksruntime running, primary nodea role that may stageread access to the tagan audit trail (not Free)not a safety write targetthe write policy's limitsthe tag existsRefused, isError: truenothing is staged2Records STAGE_ACTION firstStaged: ACT-…, PENDINGnothing is sent3HITL_STAGEDto people who may read the tagRejects, with a reasonREJECTED, recorded, nothing written4Approves, with e-signatureApproval checkstag not a safety target, else REFUSEDnot the AI co-pilot accountnot the account that staged itpublish permission on the tagwrite policy and signatureruntime running, still PENDINGA check fails: refusedstays PENDING (safety target: REFUSED)5Records HITL_APPROVE_AI_ACTIONnot written: stays PENDING, 5036Writes the value, APPROVEDthrough the driver of the tagCMD
Staging sends nothing. Only an approval by another person, signed and recorded first, writes the value.
  • Product
  • Data store
  • Device or controller
  • Person or role
  • External system
  • Data or telemetry
  • Command to equipment
  • Authentication
  • Refusal
Read as text

The AI client stages a tag write through the MCP gateway. The eaxScada server checks it, records it in the audit trail and queues it as PENDING; nothing is sent. A reviewer is told and either rejects it with a reason or approves it with an electronic signature. An approval passes its own checks and is recorded before the server writes the value through the driver.

Participants

  • AI client (external system)
  • eaxScada (product): MCP gateway
  • Audit trail (data store)
  • Reviewer (person or role)
  • Equipment (device or controller)

Steps, in order

  1. AI client → eaxScada (data or telemetry): scada_stage_tag_write. tag path, value, reason
  2. eaxScada: Staging checks: runtime running, primary node; a role that may stage; read access to the tag; an audit trail (not Free); not a safety write target; the write policy's limits; the tag exists
  3. A check fails:
    1. eaxScada → AI client (refusal): Refused, isError: true. nothing is staged
  4. eaxScada → Audit trail (data or telemetry): Records STAGE_ACTION first
  5. eaxScada → AI client (reply): Staged: ACT-…, PENDING. nothing is sent
  6. eaxScada → Reviewer (data or telemetry): HITL_STAGED. to people who may read the tag
  7. Rejected:
    1. Reviewer → eaxScada (data or telemetry): Rejects, with a reason. REJECTED, recorded, nothing written
  8. Approved:
    1. Reviewer → eaxScada (authentication): Approves, with e-signature
    2. eaxScada: Approval checks: tag not a safety target, else REFUSED; not the AI co-pilot account; not the account that staged it; publish permission on the tag; write policy and signature; runtime running, still PENDING
    3. eaxScada → Reviewer (refusal): A check fails: refused. stays PENDING (safety target: REFUSED)
    4. eaxScada → Audit trail (data or telemetry): Records HITL_APPROVE_AI_ACTION. not written: stays PENDING, 503
    5. eaxScada → Equipment (command to equipment): Writes the value, APPROVED. through the driver of the tag

The account that staged an action cannot also approve it, and neither can the AI co-pilot account. A tag that does not exist, a safety write target and a value outside the write policy’s limits are refused at staging time. The staged action is announced over the WebSocket as HITL_STAGED, only to the people who may read its tag. The approved value is written by the driver of the tag’s channel (or by the tag engine for a tag no channel maps); a read-only mapping, a value outside the tag’s range or a channel that is not running refuses it there, and the failure is recorded as HITL_APPROVE_AI_ACTION_FAILED.

Field Content
id ACT- and eight hexadecimal characters
tag_path the tag the value is proposed for
proposed_value the value the AI client proposes (a number; true and false are staged as 1 and 0)
current_value the tag’s value when it was staged
reason the client’s reason (proposed over MCP (no reason given) when it gives none)
agent_id the client’s own name for itself (mcp when it gives none)
staged_by the signed-in account that staged it
timestamp, timestamp_iso when it was staged, in nanoseconds since 1970 and as UTC text
status PENDING, APPROVED, REJECTED, WITHDRAWN or REFUSED
approved_by the person who approved, rejected or withdrew it
approval_sig the signature of an approval
State machineThe five states of a staged write
The five states of a staged writeA staged write starts PENDING. Another person can approve it (APPROVED, then the write) or reject it with a reason (REJECTED). The person who staged it can withdraw it with a reason (WITHDRAWN). If its tag has become a safety write target by the time someone approves it, it is REFUSED and never written. The four end states are final.PENDINGwaits for a personAPPROVEDrecorded, then writtenREFUSEDnever writtenREJECTEDnothing writtenWITHDRAWNnothing writtenanother person approves,with e-signaturerejected,with a reasonthe stagerwithdrawstag is now asafety write targetAn end state is final:it cannot be approved,rejected or withdrawn.
Only APPROVED leads to a write, and only after the approval is recorded.
  • Refusal
Read as text

A staged write starts PENDING. Another person can approve it (APPROVED, then the write) or reject it with a reason (REJECTED). The person who staged it can withdraw it with a reason (WITHDRAWN). If its tag has become a safety write target by the time someone approves it, it is REFUSED and never written. The four end states are final.

States

  • PENDING (state): waits for a person
  • APPROVED (state): recorded, then written
  • REFUSED (state): never written
  • REJECTED (state): nothing written
  • WITHDRAWN (state): nothing written

Transitions

  • Start → PENDING (transition). Staging records STAGE_ACTION and queues the write as PENDING.
  • PENDING → APPROVED (transition): another person approves, with e-signature. Not the AI co-pilot account and not the account that staged it. The approval is recorded in the audit trail first; then the value is written. A write that fails is recorded and the state stays APPROVED. Any other failed check of the approval leaves the write PENDING.
  • PENDING → REJECTED (transition): rejected, with a reason. A reviewer rejects it; a reason is required.
  • PENDING → WITHDRAWN (transition): the stager withdraws. Only the account that staged it, with a reason. When that account uses the reject route, the write is withdrawn too. An API token cannot withdraw.
  • PENDING → REFUSED (refusal): tag is now a safety write target. Checked when someone approves, before any signature. Recorded as HITL_REFUSED_SAFETY_TARGET and AI_PROPOSAL_REFUSED.

An end state is final: it cannot be approved, rejected or withdrawn.

6.3 Changes on the emergency-stop signal and safety tags are refused

Section titled “6.3 Changes on the emergency-stop signal and safety tags are refused”

An AI client never adds or changes a command on a safety write target, never makes one writable and never stages a value for one. The change is refused, not merely flagged: a person makes it in the Studio. The safety write targets are:

  • the plant emergency-stop signal: the tag set in the project’s settings (Plant/Safety/EmergencyStop in a new project), and the system’s legacy path Site1/Safety/PlantEmergencyStop, which projects created before the setting existed still use;
  • every tag watched by an alarm of category Safety (any case), or by a built-in alarm (plant emergency stop, PLC faults, server resources).

They are read from the live alarm definitions at every check, so a tag that became safety-related after a proposal was made is protected when the proposal is applied.

Data flowHow an AI change near a safety target is refused
How an AI change near a safety target is refusedEvery change an AI proposes, whether a screen, a dashboard, a tag mapping, an eaxTag, a script or a staged write, is checked against the safety write targets: the e-stop signal tag and the tags watched by Safety or built-in alarms. If the check cannot run, or the change touches a target, it is refused and recorded. A change that passes waits for a person and is checked again when it is applied or approved.An AI changescreen, dashboard,tag, eaxTag, script,staged writeCan the check run?safety checkavailable, documentreadableTouches a target?e-stop signal tag,tags of Safety orbuilt-in alarmsRefusedrecorded, nothingsaved or writtenWaits for a persona proposal toapply, a writeto approveChecked againwhen it isapplied orapprovedAppliedor approvedand writtenyesno: failsclosedtouchesonenotouches onenowno
The check fails closed, and it runs twice: when the AI proposes and when a person applies.
  • Service or process
  • Check or decision
  • Refusal
Read as text

Every change an AI proposes, whether a screen, a dashboard, a tag mapping, an eaxTag, a script or a staged write, is checked against the safety write targets: the e-stop signal tag and the tags watched by Safety or built-in alarms. If the check cannot run, or the change touches a target, it is refused and recorded. A change that passes waits for a person and is checked again when it is applied or approved.

Parts

  • An AI change (service or process): screen, dashboard, tag, eaxTag, script, staged write
  • Can the check run? (check or decision): safety check available, document readable
  • Touches a target? (check or decision): e-stop signal tag, tags of Safety or built-in alarms
  • Refused (outcome): recorded, nothing saved or written
  • Waits for a person (service or process): a proposal to apply, a write to approve
  • Checked again (check or decision): when it is applied or approved
  • Applied (outcome): or approved and written

Connections

  • Start → An AI change (next step)
  • An AI change → Can the check run? (next step)
  • Can the check run? → Touches a target? (next step): yes
  • Can the check run? → Refused (refusal): no: fails closed. When the safety check is not available on the server, or a stored document cannot be read, the change is refused.
  • Touches a target? → Refused (refusal): touches one. The change is refused, recorded as AI_PROPOSAL_REFUSED, and the tool answers isError: true.
  • Touches a target? → Waits for a person (next step): no
  • Waits for a person → Checked again (next step)
  • Checked again → Refused (refusal): touches one now. At apply, a proposal that now touches a target is closed as failed and answered with HTTP 409, status refused. A staged write whose tag became a target is REFUSED at approval, before any signature.
  • Checked again → Applied (next step): no

The same server check covers MCP clients (the AI_CoPilot account, an IDE agent) and the in-product AI assistant:

AI change Refused when
A screen (scada_propose_screen, an assistant display) An object adds or changes a command on a target: a button, an input, a faceplate, an interaction write, a dashboard placed on the screen, whatever the value (raising or clearing the signal). Also when the tag an object writes cannot be derived and could be a target: a {Param} pattern that matches it, a faceplate writing under a folder, and every run_command script.
A dashboard (scada_propose_dashboard) A card writes a target (push button, reactor START / STOP / E-STOP, pump, PID mode or setpoint).
A tag mapping or eaxTag (scada_propose_tag_mapping, an assistant driver tag or eaxTag) It binds the emergency-stop signal, or gives write access to a tag watched by a safety alarm.
A staged setpoint (scada_stage_tag_write, POST /api/mcp/stage) The tag is a target: nothing is staged. An action staged before its tag became one is refused at approval and never written.
An eaxTags script (the assistant’s eax_script) A tags.set(...) writes a target, by its path, a constant, a list of paths, a template or a name the code computes that can be one ('Plant/Safety/' + name). Also when the script’s writes cannot be derived: tags used other than as tags.get(...) or tags.set(...) (an alias, a method taken as a value), eval, Function, this, globalThis, with, classes, .constructor, call / apply / bind, or a member read by a computed name on anything but a list or record the script declares.

Screen scripts. The AI co-pilot account never holds the right screens.script: a screen saved through the MCP screen tools under that account that adds or changes a screen script (a Run script action, a startup script) is refused and nothing is saved. An AI proposal applied by a person is checked as that person.

What stays allowed:

  • Reading. A screen or card that only shows the signal, and a script that reads it (if (tags.get('Plant/Safety/EmergencyStop') > 0) ...), are not commands.
  • Removing. Removing a command on a target, or deleting a screen that holds one, is allowed; the proposal carries a note such as “Removes the operator command on the emergency-stop signal …”. An AI change elsewhere on a screen that keeps a person’s emergency-stop button unchanged is allowed.

How it is checked:

  • When the change is proposed, and again when a person applies it, against the alarms and the emergency-stop setting as they are then. A proposal refused at apply is closed (failed, with the reason) and nothing is saved.
  • The check never writes anything. A script is analysed from its source, never run.
  • It fails closed: if the check cannot run on the server, the change is refused.
  • Every refusal is journaled in the security audit trail as AI_PROPOSAL_REFUSED (author, kind, target, reason).
  • An MCP client gets a tool result with isError: true and the reason, for example refused: object btn_estop writes Plant/Safety/EmergencyStop, the plant emergency-stop signal; AI clients cannot add or change commands on it - a person does that in the Studio. Applying an older proposal answers 409 with status refused.
  • The AI assistant panel shows a refused proposal as a card marked Refused by the safety check, with the server’s reason as written (which tag, which safety alarm, the script line) and no Apply button. A proposal refused when it is applied changes to Refused by the safety check when applied. The notes of a change that removes a command are listed under Safety notes. The assistant is told that a refusal is final: it explains it and does not try again in another form.
  • Operators see no change on their screens: nothing was saved.

The refusal applies to AI clients only. To change a command on the emergency-stop signal or on a safety tag, a person does it:

  1. Sign in to the Studio with your own engineering account (not the AI co-pilot account) and make the change yourself: the screen command, the dashboard card, the tag mapping, the eaxTag or the script. The change is journaled under your name.
  2. To have the change signed, turn on Require an e-signature to deploy: the changed screens reach the operators only with your electronic signature over what is deployed.
  3. For a command that writes the signal or a safety tag, choose Require E-Signature as its confirmation: every write is then signed by the operator and checked by the server (see How eaxScada protects tag writes).
  4. To move the emergency-stop signal to another tag, change the plant emergency-stop signal tag in the project’s settings. The change is refused while the signal is raised or its alarm is not back to normal.
  5. A tag stops being a safety write target only when the alarm that watches it changes (another category or another tag). That is an engineering change by a person, and the next check uses it.

No role, flag or signature lets an AI client’s change on a safety write target through.

6.4 Withdrawing a proposal or a staged write

Section titled “6.4 Withdrawing a proposal or a staged write”

The person who made a proposal or staged a tag write can close it before it is reviewed:

Route Body Result
POST /api/mcp/withdraw/proposal {"id": "...", "reason": "..."} The proposal is closed with status withdrawn, journaled AI_PROPOSAL_WITHDRAWN.
POST /api/mcp/withdraw {"action_id": "...", "reason": "..."} The staged write is closed with status WITHDRAWN; nothing is written.
  • Only the author may withdraw: anyone else gets 403. A reviewer who does not want the change rejects it instead (POST /api/mcp/reject/proposal, POST /api/mcp/reject).
  • A reason is required: a blank one answers 400 with reason_required.
  • The caller is a signed-in person at supervisor level. The AI co-pilot account and API tokens are refused.

Assistants read history in one of two ways, both under the read permissions of the account they sign in with:

  • scada_query_tag_history (every account): the assistant names the tags (exact paths, up to 20) and a time range. Each tag is checked against the account’s subscribe rules; if any is not readable, the request is refused with 403 and nothing is returned. The query is built by the server with parameters: no SQL comes from the assistant.
  • scada_query_historian (free SQL): reserved for accounts that may read every tag, that is the Administrator role or a > subscribe rule with no deny rule. A free query can reach any row, and eaxScada does not try to read tag filters out of SQL, so it is refused (403) for every other account. The queries it runs stay governed: a single SELECT over the history table only, parsed and allow-listed, no files, URLs, settings or functions that reach the host, a row cap of 1000 and a 5 s timeout, on a connection whose changes are rolled back.

Every edition stores history in the columnar historian engine, its single store: no CSV copy is written next to it. For files analysis tools can read directly, Pro and Enterprise export each closed day to Hive-partitioned Parquet (historian.export).

7.1 Data quality in the values the assistant reports

Section titled “7.1 Data quality in the values the assistant reports”

The assistant reports history values to people, so non-Good data is never averaged in:

  • Buckets use Good samples only. When scada_query_tag_history returns buckets (bucket_seconds), each bucket’s min, max and avg are worked out from its Good samples only. A bucket with no Good sample has no average, minimum or maximum (null).
  • Each bucket gives its quality: good (every sample Good), bad (every sample Bad) or uncertain (anything in between: some Uncertain or overridden samples, or Bad samples beside Good ones), with good_count, uncertain_count and bad_count; count is every sample. An overridden value (entered by an operator) counts as Uncertain, never Good.
  • First and last are the bucket’s first and last samples whatever their quality; first_quality and last_quality say which.
  • The sample before the range, on request. A tag logged on change that has been Bad, or steady, for longer than the range has no sample inside it. With "include_before": true, each tag’s entry also gets before: its last sample before from, with timestamp_iso, value, quality (the code) and quality_class (good, uncertain or bad). It comes with raw points and with buckets, only when the entry holds the whole range (not cut by limit), and only when the tag has a sample before the range. The search is not bounded in time. Without include_before, the answer is unchanged. See The sample before a range.
  • The assistant is told to say so. The tool’s description tells the assistant that an uncertain or bad bucket is not a plain reading: it must report it as uncertain or bad, with its counts, never as a normal value. Each tag’s answer gives buckets_not_good, the number of its buckets that are not good.
  • Free SQL (scada_query_historian) returns every sample, Bad and Uncertain ones too, and the query is never rewritten. Each row that carries a sample’s quality code gets quality_class (good, uncertain or bad; <alias>_quality_class for a quality column under another name; a column of the query’s own named quality_class is never overwritten). A query that reads value but neither selects nor filters on quality is answered with a warning: “this query ignores sample quality; bad and uncertain samples are included — add the good-quality filter: (quality % 256) >= 192 AND quality <> 512”. Such a result is unchecked: the tool’s description tells the assistant to report it as unchecked, never as a plain reading, and to filter averages, minimums and maximums on Good samples with WHERE (quality % 256) >= 192 AND quality <> 512, or to select quality. The historian schema resource gives the same filter. Queries that filter on quality are answered as before, without a warning.

The answer of scada_query_historian (also through POST /api/mcp/tools/call, inside result):

Field Meaning
row_count the number of rows returned
rows the rows, each with quality_class (or <alias>_quality_class) when it carries a quality code
row_limit the row cap (1000): at the cap there may be more rows
warning only when the query reads value without selecting or filtering on quality: the text above

The full rule is in the historian’s quality in buckets and quality in free SQL answers.


Any MCP client that supports HTTP servers can connect to the gateway with the session token of a dedicated account in the Authorization header:

{
"mcpServers": {
"eaxscada": {
"type": "http",
"url": "http://localhost:8080/api/mcp",
"headers": { "Authorization": "Bearer <session token>" }
}
}
}

The assistant then acts with the permissions of the account it signs in with, for reads as well as writes. Give it the AI_CoPilot role, which can read and stage, but not write, and subscribe rules for the areas it may read. See Connect Claude or another MCP client and Security and 21 CFR Part 11.