OPC UA MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/kukapay/opcua-mcp.git
cd opcua-mcp
pip install mcp[cli] opcua cryptography
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add -e "OPCUA_SERVER_URL=${OPCUA_SERVER_URL}" opc-ua -- python "<FULL_PATH_TO_MCP_UASERVER>/dist/index.js"

Replace <FULL_PATH_TO_MCP_UASERVER>/dist/index.js with the actual folder you prepared in step 1.

Required:OPCUA_SERVER_URL
README.md

Connects AI agents to OPC UA-enabled industrial systems for real-time monitoring

OPC UA MCP Server

An MCP server that connects to OPC UA-enabled industrial systems, allowing AI agents to monitor, analyze, and control operational data in real time.

This project is ideal for developers and engineers looking to bridge AI-driven workflows with industrial automation systems.

Features

  • Read OPC UA Nodes: Retrieve real-time values from industrial devices.
  • Write to OPC UA Nodes: Control devices by writing values to specified nodes.
  • Browse nodes: Request to list allopcua nodes
  • Read multiple OPC UA Nodes: Retrieve multiple real-time values from devices.
  • Write to multiple OPC UA Nodes: Control devices by writing values to multiple nodes.
  • Seamless Integration: Works with MCP clients like Claude Desktop for natural language interaction.

Tools

The server exposes five tools:

  • read_opcua_node:

    • Description: Read the value of a specific OPC UA node.
    • Parameters:
      • node_id (str): OPC UA node ID (e.g., ns=2;i=2).
    • Returns: A string with the node ID and its value (e.g., "Node ns=2;i=2 value: 42").
  • write_opcua_node:

    • Description: Write a value to a specific OPC UA node.
    • Parameters:
      • node_id (str): OPC UA node ID (e.g., ns=2;i=3).
      • value (str): Value to write (converted based on node type).
    • Returns: A success or error message (e.g., "Successfully wrote 100 to node ns=2;i=3").
  • Browse nodes:

    • Description: Read the value of a specific OPC UA node.
  • Read multiple OPC UA Nodes:

    • Description: Read the value of a specific OPC UA node.
  • Write to multiple OPC UA Nodes:

    • Description: Read the value of a specific OPC UA node.

Example Prompts

  • "What’s the value of node ns=2;i=2?" → Returns the current value.
  • "Set node ns=2;i=3 to 100." → Writes 100 to the node.

Installation

Prerequisites

  • Python 3.13 or higher
  • An OPC UA server (e.g., a simulator or real industrial device)

Install Dependencies

Clone the repository and install the required Python packages:

git clone https://github.com/kukapay/opcua-mcp.git
cd opcua-mcp
pip install mcp[cli] opcua cryptography

MCP Client Configuration

{
 "mcpServers": {
   "opcua-mcp": {
     "command": "python",
     "args": ["path/to/opcua_mcp/main.py"],
     "env": {
        "OPCUA_SERVER_URL": "your-opc-ua-server-url"
     }
   }
 }
}

License

This project is licensed under the MIT License. See the LICENSE file for details.

Tools (5)

read_opcua_nodeRead the value of a specific OPC UA node.
write_opcua_nodeWrite a value to a specific OPC UA node.
Browse nodesRead the value of a specific OPC UA node.
Read multiple OPC UA NodesRead the value of a specific OPC UA node.
Write to multiple OPC UA NodesRead the value of a specific OPC UA node.

Environment Variables

OPCUA_SERVER_URLrequiredThe URL of the OPC UA server to connect to

Configuration

claude_desktop_config.json
{"mcpServers": {"opcua-mcp": {"command": "python", "args": ["path/to/opcua_mcp/main.py"], "env": {"OPCUA_SERVER_URL": "your-opc-ua-server-url"}}}}

Try it

What is the current value of node ns=2;i=2?
Set the value of node ns=2;i=3 to 100.
Can you read the current status of the industrial device at node ns=2;i=5?
Update the operational parameter at node ns=2;i=10 to 50.

Frequently Asked Questions

What are the key features of OPC UA MCP Server?

Read real-time values from industrial devices. Write values to specific OPC UA nodes for device control. Browse available OPC UA nodes. Read and write to multiple OPC UA nodes simultaneously. Seamless integration with MCP clients like Claude Desktop.

What can I use OPC UA MCP Server for?

Monitoring real-time sensor data from industrial machinery. Remotely adjusting operational setpoints on factory floor equipment. Integrating industrial automation data into AI-driven analytical workflows. Automating device configuration updates via natural language commands.

How do I install OPC UA MCP Server?

Install OPC UA MCP Server by running: git clone https://github.com/kukapay/opcua-mcp.git && cd opcua-mcp && pip install mcp[cli] opcua cryptography

What MCP clients work with OPC UA MCP Server?

OPC UA MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep OPC UA MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare