Connect OPC UA data to AI assistants through MCP
| Product | AI assistants and agents (Claude, ChatGPT, Microsoft Copilot) via the Model Context Protocol |
|---|---|
| Category | AI |
| OPC UA role | Upstream: an OPC UA client collects; the MCP server sits on the platform that stores the data |
OPC UA moves machine data; the Model Context Protocol (MCP) lets an AI assistant call governed functions on a system that already stored and contextualised that data. The sound architecture is OPC UA client → data platform → MCP server → assistant. Pointing a language model straight at a production OPC UA server is the pattern to avoid.
The architecture that works
- Collect with an OPC UA clientSubscriptions on the nodes that matter (state, counters, program, alarms), with StatusCode and SourceTimestamp kept on every value.
- Contextualise on a platformTurn raw values into events: run, stop, reason, product, order, shift. This is where OEE and loss Paretos are computed with one published definition.
- Expose an MCP server on that platformA short list of read-only tools such as "OEE for a line and period" or "stops above N minutes with reasons" (illustrative names). The assistant never sees the address space.
- Ask from the assistantClaude, ChatGPT, Copilot or an internal agent calls the tools and explains the result. People decide what to do with it.
Why not connect an LLM straight to the OPC UA server?
- Load. A model that browses and reads freely creates sessions, browse calls and history reads nobody sized the server for.
- Meaning. A raw NodeId and a counter value are not "line 3 lost 40 minutes to a jam". The context lives in the platform, not in the address space.
- Safety. Write and Call services exist. An assistant must never hold a session that can use them on production equipment.
- Auditability. MCP tool calls can be logged per user; ad hoc OPC UA sessions opened by an agent usually are not.
If you build a direct bridge for a lab or a prototype
- Use a dedicated OPC UA user whose role has no Write and no Call permission, on a test server or a read-only aggregating server.
- Allow-list the NodeIds the bridge may read; do not expose Browse on the whole address space.
- Bound every history read by time range and number of values.
- Return StatusCode and SourceTimestamp with each value so the model cannot present a bad or stale value as good.
- Sign and encrypt the session, and keep certificates out of prompts and logs.
- Treat it as a prototype: once it answers real questions, move the logic behind a platform and an MCP server with scopes and logging.
What the assistant needs from the address space
| Question people ask | Data behind it | Typical OPC UA source |
|---|---|---|
| Why did the line stop? | Stop events with start, end and reason | Machine state variable, alarms and conditions, operator-entered reason on the platform |
| How much did we produce? | Good and total counts per order | Part counters, job or order identifiers |
| Are we running at speed? | Actual versus ideal cycle time per product | Cycle time or speed variable, active program or recipe |
| Is this getting worse? | Weeks of history at event grain | Platform history; server-side historical access where it exists |
Companion specifications help because they name these things consistently across machines. The mapping from nodes to OEE inputs is the subject of the free kit below.
The traps
- Letting the model recalculate OEE from raw values: two people get two numbers. Return KPIs computed by the platform.
- Dropping status codes during collection, then asking an assistant to explain a gap it cannot see.
- Mixing local and UTC timestamps across machines; shift boundaries move by an hour.
- Assuming an assistant fixes missing data. Stops nobody captured do not exist for it.
- Giving an agent a general-purpose "execute" tool instead of narrow read-only ones.
Getting OEE answers out of it
The worked example on this site is the TEEPTRAK OEE platform page. Status in November 2026: TEEPTRAK uses retrieval-augmented generation (RAG) on performance data internally and with customers, and is developing an MCP server whose first scope is performance indicators, performance history and machine-stoppage analysis. No delivery date has been announced. Where machines have no usable OPC UA server, TEEPTRAK captures states and counts with a module wired into the electrical cabinet and a sensor at the edge of the line, without a PLC connection. Daystream, its daily shop-floor management app, carries the answer into the daily meeting.
Free kit: map machine data to OEE
The node-to-OEE mapping workbook: which variables feed availability, performance and quality, with a checklist per machine. Excel.
FAQ
Can an AI assistant read OPC UA data?
Not directly in a sound design. An OPC UA client collects the data into a platform, and an MCP server on that platform exposes read-only functions the assistant can call.
Is MCP a replacement for OPC UA?
No. OPC UA moves and models machine data. MCP exposes systems that already hold that data to AI assistants.
Should an LLM have write access to an OPC UA server?
No. Keep assistants read-only and away from Write and Call services on production equipment.
Last verified 27 November 2026. OPC UA Connect is an educational resource and is not affiliated with the OPC Foundation.