
How to add OPC UA MCP Server to Windsurf
Connect AI agents to OPC UA industrial systems to monitor, analyze, and control operational data in real time. Paste the config into ~/.codeium/windsurf/mcp_config.json and restart Windsurf.
Last updated June 14, 2026 · 27★ · stdio · no auth
Windsurf config for OPC UA MCP Server
git clone https://github.com/kukapay/opcua-mcp.git && cd opcua-mcp && pip install mcp[cli] opcua cryptography{
"mcpServers": {
"opc-ua-mcp-server": {
"command": "python",
"args": [
"path/to/opcua_mcp/main.py"
],
"env": {
"OPCUA_SERVER_URL": "your-opc-ua-server-url"
}
}
}
}Setup steps
- 1Open Windsurf → Cascade → the hammer/MCP icon → Configure (or edit ~/.codeium/windsurf/mcp_config.json).
- 2Paste the OPC UA MCP Server config below.
- 3Fill in placeholder secrets, then save.
- 4Click Refresh in the MCP panel.
- 5OPC UA MCP Server's tools become available to Cascade.
Before you start
- Python 3.13 or higher
- An OPC UA server (a simulator or a real industrial device)
- OPCUA_SERVER_URL environment variable pointing to the target OPC UA server
What OPC UA MCP Server can do in Windsurf
read_opcua_nodeRead the value of a specific OPC UA node. Takes a node_id (e.g. ns=2;i=2) and returns a string with the node ID and its value (e.g. 'Node ns=2;i=2 value: 42').
write_opcua_nodeWrite a value to a specific OPC UA node. Takes a node_id (e.g. ns=2;i=3) and a value (converted based on node type), and returns a success or error message (e.g. 'Successfully wrote 100 to node ns=2;i=3').
browse_nodesBrowse the OPC UA address space, listing the available nodes on the connected server.
read_multiple_opcua_nodesRetrieve real-time values from multiple OPC UA nodes in a single batch read.
write_multiple_opcua_nodesWrite values to multiple OPC UA nodes in a single batch operation to control several devices at once.
Security
The server can write values to OPC UA nodes, which controls live industrial devices. Restrict the OPCUA_SERVER_URL to trusted/isolated networks and review write operations carefully, as incorrect values can affect physical equipment. The README's example configuration connects without authentication or encryption; use OPC UA security (user credentials and certificates) for production deployments.
OPC UA MCP Server + Windsurf FAQ
Where is the Windsurf config file?
Windsurf reads MCP servers from ~/.codeium/windsurf/mcp_config.json. Paste the OPC UA MCP Server config there under the "mcpServers" key and restart the client.
Is OPC UA MCP Server safe to use with Windsurf?
The server can write values to OPC UA nodes, which controls live industrial devices. Restrict the OPCUA_SERVER_URL to trusted/isolated networks and review write operations carefully, as incorrect values can affect physical equipment. The README's example configuration connects without authentication or encryption; use OPC UA security (user credentials and certificates) for production deployments.
What is OPC UA?
OPC UA (Open Platform Communications Unified Architecture) is a standardized machine-to-machine communication protocol widely used in industrial automation to read and write data from PLCs, sensors, and other devices.
How do I point the server at my OPC UA system?
Set the OPCUA_SERVER_URL environment variable in the MCP client configuration to your OPC UA server's endpoint URL.
Can it control physical equipment?
Yes. The write tools send values to OPC UA nodes, which can change setpoints and control live industrial devices, so write operations should be reviewed carefully.