Skip to main content

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.

Metadata

Release files for iflow-mcp_kukapay-opcua-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iflow-mcp_kukapay-opcua-mcp 0.1.0
File Size Uploaded
iflow_mcp_kukapay_opcua_mcp-0.1.0.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iflow-mcp_kukapay-opcua-mcp 0.1.0
File Interpreter ABI Platform
iflow_mcp_kukapay_opcua_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.5 kB

Release files / iflow_mcp_kukapay_opcua_mcp-0.1.0.tar.gz

Download URL iflow_mcp_kukapay_opcua_mcp-0.1.0.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c001d2754fd88d2ce8ab29b5c7639df14b18f698d483d08d01b1506611afbe42
BLAKE2b-256 checksum
How to use checksums
33570648aa08d1b60ab1d959b8fbd8e4be6f71f9bfac8bab1e7d8fa9ac9885bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / iflow_mcp_kukapay_opcua_mcp-0.1.0-py3-none-any.whl

Download URL iflow_mcp_kukapay_opcua_mcp-0.1.0-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c701ee90b3f54b72de293e1ca6333f9925ecc2de8e994cca786d20f807109fb8
BLAKE2b-256 checksum
How to use checksums
fea93460351e7ae17ba20b91b63a9b427f85ce06ae10010d0e0a27c67327ae36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page