OPC UA

by kukapay

2 stars
474 downloads
Not rated
GitHub

About

Integrates with OPC UA industrial automation systems to enable reading and writing node values for monitoring and controlling connected devices

Details

Author
kukapay
Repository
kukapay/opcua-mcp
GitHub stars
2
Downloads
474
License
MIT License
Categories
Productivity, Design, Developer Tools, AI, Frontend, Infrastructure, Other

- 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.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name OPC UA
    Command (node, npx, python, etc.) python
    Arguments
    • Argument 1 path/to/opcua_mcp/main.py
    Environment
    • OPCUA_SERVER_URL your-opc-ua-server-url

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

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

read_opcua_node

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.

write_opcua_node

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.

Browse nodes

Request to list all OPC UA 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.

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.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

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

Linux

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

Macos

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

Windows

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

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.

GitHub License
Python Version
Status

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.
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.