OPC UA MCP Server — Claude Code MCP server
This MCP server for Claude Code connects an AI agent to an OPC UA server. It exposes equipment nodes, live values and historical readings to the agent.
MIT ★ 36 updated 2026-11-15
claude mcp add opcua -e OPCUA_SERVER_URL=<OPCUA_SERVER_URL> -e OPCUA_CLIENT_KEY=<OPCUA_CLIENT_KEY> -e OPCUA_PASSWORD=<OPCUA_PASSWORD> -e OPCUA_USER_KEY=<OPCUA_USER_KEY> -e OPCUA_PROFILE=<OPCUA_PROFILE> -e OPCUA_AUDIT_CHAIN_KEY_FILE=<OPCUA_AUDIT_CHAIN_KEY_FILE> -- npx -y opcua-mcp-serverWhat OPC UA MCP Server does
The server relays agent requests to an OPC UA system and returns its data. Its tools cover node browsing, value and history reads, change subscriptions, events and alarms; writing values and calling methods are also supported.
The observe profile is read-only by default. Control actions require a separate profile and an authenticated OPC UA server, and each such call is audited. A process handles one OPC UA endpoint, so separate endpoints need separate processes.
The Node route requires Node.js 22.13+ with npm/npx. The Python route needs Python 3.10+ and uv. An accessible OPC UA server and its address in OPCUA_SERVER_URL are also required.
What it helps with
- browse an OPC UA node tree
- read current sensor values
- retrieve value history and aggregates
- track value changes through subscriptions
- send writes or method calls under a control profile
Example prompts for the agent
- Browse the OPC UA server and read the sensor values.
- Get the history for the specified node.
- Subscribe to changes and list the available events and alarms.
How to install OPC UA MCP Server
Platform CLI
claude mcp add opcua -e OPCUA_SERVER_URL=<OPCUA_SERVER_URL> -e OPCUA_CLIENT_KEY=<OPCUA_CLIENT_KEY> -e OPCUA_PASSWORD=<OPCUA_PASSWORD> -e OPCUA_USER_KEY=<OPCUA_USER_KEY> -e OPCUA_PROFILE=<OPCUA_PROFILE> -e OPCUA_AUDIT_CHAIN_KEY_FILE=<OPCUA_AUDIT_CHAIN_KEY_FILE> -- npx -y opcua-mcp-serverReplace <…> with your own values. 27 more environment variables are in the server README
Platform CLI
codex mcp add industriagents-opc-ua-mcp-server --env OPCUA_SERVER_URL=<OPCUA_SERVER_URL> --env OPCUA_PYTHON_BACKEND=<OPCUA_PYTHON_BACKEND> --env OPCUA_SECURITY_POLICY=<OPCUA_SECURITY_POLICY> --env OPCUA_SECURITY_MODE=<OPCUA_SECURITY_MODE> --env OPCUA_CLIENT_CERT=<OPCUA_CLIENT_CERT> -- npx -y opcua-mcp-serverReplace <…> with your own values. 27 more environment variables are in the server README
Config file
{
"mcpServers": {
"industriagents-opc-ua-mcp-server": {
"command": "npx",
"args": [
"-y",
"opcua-mcp-server"
],
"env": {
"OPCUA_SERVER_URL": "<OPCUA_SERVER_URL>",
"OPCUA_PYTHON_BACKEND": "<OPCUA_PYTHON_BACKEND>",
"OPCUA_SECURITY_POLICY": "<OPCUA_SECURITY_POLICY>",
"OPCUA_SECURITY_MODE": "<OPCUA_SECURITY_MODE>",
"OPCUA_CLIENT_CERT": "<OPCUA_CLIENT_CERT>"
}
}
}
}Replace <…> with your own values. 27 more environment variables are in the server README
Config file
{
"servers": {
"industriagents-opc-ua-mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"opcua-mcp-server"
],
"env": {
"OPCUA_SERVER_URL": "<OPCUA_SERVER_URL>",
"OPCUA_PYTHON_BACKEND": "<OPCUA_PYTHON_BACKEND>",
"OPCUA_SECURITY_POLICY": "<OPCUA_SECURITY_POLICY>",
"OPCUA_SECURITY_MODE": "<OPCUA_SECURITY_MODE>",
"OPCUA_CLIENT_CERT": "<OPCUA_CLIENT_CERT>"
}
}
}
}Replace <…> with your own values. 27 more environment variables are in the server README
Platform CLI
gemini mcp add -e OPCUA_SERVER_URL=<OPCUA_SERVER_URL> -e OPCUA_PYTHON_BACKEND=<OPCUA_PYTHON_BACKEND> -e OPCUA_SECURITY_POLICY=<OPCUA_SECURITY_POLICY> -e OPCUA_SECURITY_MODE=<OPCUA_SECURITY_MODE> -e OPCUA_CLIENT_CERT=<OPCUA_CLIENT_CERT> industriagents-opc-ua-mcp-server npx -y opcua-mcp-serverReplace <…> with your own values. 27 more environment variables are in the server README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about OPC UA MCP Server
How do I install OPC UA MCP Server in Claude Code?
Run `claude mcp add opcua -e OPCUA_SERVER_URL=<OPCUA_SERVER_URL> -e OPCUA_CLIENT_KEY=<OPCUA_CLIENT_KEY> -e OPCUA_PASSWORD=<OPCUA_PASSWORD> -e OPCUA_USER_KEY=<OPCUA_USER_KEY> -e OPCUA_PROFILE=<OPCUA_PROFILE> -e OPCUA_AUDIT_CHAIN_KEY_FILE=<OPCUA_AUDIT_CHAIN_KEY_FILE> -- npx -y opcua-mcp-server. Set OPCUA_SERVER_URL` to the server address.
What does OPC UA MCP Server do?
It connects an AI agent to an OPC UA server. The agent can browse nodes, read current and historical data, receive events, and use control operations when a control profile is configured.
What does OPC UA MCP Server need to run?
It needs an accessible OPC UA server and its address in OPCUA_SERVER_URL. The Node setup requires Node.js 22.13+ and npm/npx; the Python setup requires Python 3.10+ and uv.