opcua-twin-gateway
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
opcua-twin-gateway
数字管道的建筑师 · 第六块积木:把标准 OPC UA 工业协议接入 MCP 生态 前五块:workflow-templates / digital-twin-mcp / factory-twin-viz / workflow-mcp / pdf2voice
OPC UA(IEC 62541)是工业 4.0 的事实标准协议。本项目用真实 OPC UA 协议(asyncua)搭了一条完整的"模拟 PLC → 标准协议 → MCP 工具"数据管道:
[OPC UA 模拟服务器] ──OPC UA 协议──▶ [opcua-twin-gateway MCP] ──MCP──▶ [WorkBuddy / Claude Desktop / Cursor]为什么真实协议:digital-twin-mcp 用的是"模拟 PLC 接口",而本项目直接走 OPC UA 标准—— 换掉
ots_server.py指向任何真实 OPC UA 服务器(西门子/倍福/OPC UA 网关),网关零改动。
组件
文件 | 作用 |
| OPC UA 工厂模拟服务器:6 台设备、随机游走漂移、节点可写 |
| MCP Server:asyncua Client 通过标准协议读写节点 |
| 直连演示:不经过 MCP,用原生 OPC UA 协议读数据 |
Related MCP server: OPC UA MCP Server
MCP 工具
工具 | 说明 |
| 列出全部设备节点(设备/指标/node_id/是否可写) |
| 读单个节点实时值 |
| 读全量快照(类比 digital-twin-mcp 的 get_scene_snapshot) |
| 写入控制值(仅可写节点,为控制闭环铺路) |
快速开始
pip install -r requirements.txt # asyncua + fastmcp
# 终端 1:启动 OPC UA 模拟服务器
python ots_server.py
# 终端 2:原生 OPC UA 直连演示(不经过 MCP)
python demo_client.py
python demo_client.py im-01 temperature
python demo_client.py --write im-01 temperature 300
# 终端 2:MCP 自检(进程内)
python examples/check_gateway.py
# MCP Server(stdio,供 WorkBuddy 等客户端接入)
python gateway.py与 digital-twin-mcp 的衔接
digital-twin-mcp 的 BasePLCDriver 是模拟驱动;本项目的 gateway.py 是真实 OPC UA 驱动的实现示例。
把网关的 read_all() 输出映射到 digital-twin-mcp 的 get_scene_snapshot 格式,
factory-twin-viz 就能直接渲染真实协议数据——模拟与真实协议平滑切换。
接入 WorkBuddy
合并 examples/workbuddy_mcp.json 到 ~/.workbuddy/mcp.json,在连接器管理页「信任」后,
对话中可直接说"读一下注塑机温度"。
许可
MIT License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Single-connection MCP gateway discovering and executing 490+ verified MCP & A2A tools.
Global CAD/BIM, industrial engineering (FEM, CFD) and property tools via one MCP endpoint.
Unified MCP Server is a remote MCP connector for AI agents and vertical AI products that provides access to 22,000+ authorized SaaS tools across 400+ integrations and 24 categories directly inside LLMs (Claude, GPT, Gemini, Cohere). Tools operate only on explicitly authorized customer connections, enabling agents to safely read and write against live third-party systems.
MCP gateway and cloud hosting for MCP servers, agents and apps like RAG, managed from your agent.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that connects to OPC UA-enabled industrial automation systems.31MIT
- AlicenseNot gradedqualityDmaintenanceConnects to any OPC UA server and exposes its node tree and data via MCP, with tools to read values and search nodes.5MIT
- AlicenseNot gradedqualityDmaintenanceAn open-source MCP server that bridges AI models with industrial equipment, supporting multiple protocols like Modbus, OPC UA, and MQTT for reading data and controlling machines.2Apache 2.0
- AlicenseBqualityDmaintenanceUniversal MCP server for industrial PLC communication, enabling AI agents to read sensors, alarms, status, setpoints, and write setpoints via adapters for Modbus, S7, or custom PLCs.6MIT