Enables interaction with B&R Automation Studio projects, allowing for project compilation, launching the ARsim simulator, and reading or writing PLC variables in real-time through OPC UA integration.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@B&R Automation Studio MCP Serverbuild the project and launch the ARsim simulator"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
B&R Automation Studio MCP Server
An MCP (Model Context Protocol) server that enables AI assistants like Claude to interact with B&R Automation Studio projects. Build projects, run simulators, and read/write OPC UA variables - all through natural language.
Features
Build Projects - Compile Automation Studio projects for simulation
Run Simulator - Launch ARsim and connect automatically
OPC UA Integration - Read and write PLC variables in real-time
Prerequisites
Windows 10/11 with B&R Automation Studio 4.x installed
Python 3.10+ on Windows (with pip)
Claude Code (native Windows or WSL2)
Installation
1. Clone this repository
2. Install Python dependencies
3. Configure server settings
Edit server.py to match your environment:
3a. B&R Tool Paths
Update these paths to match your Automation Studio installation:
Common installation locations:
AS 4.12:
C:\BrAutomation\AS412\bin-en\BR.AS.Build.exeAS 4.9:
C:\BrAutomation\AS49\bin-en\BR.AS.Build.exePVI: Typically under
C:\BrAutomation\PVI\V4.x\PVI\Tools\PVITransfer\
3b. OPC UA Parameters
Configure the OPC UA connection settings for communicating with ARsim:
Important: These credentials must match your Automation Studio project's OPC UA configuration:
User/role settings:
Physical/<Config>/<CPU>/AccessAndSecurity/UserRoleSystem/OPC UA config:
Physical/<Config>/<CPU>/Connectivity/OpcUA/
4. Configure Claude Code
Choose the setup that matches how you run Claude Code:
Option A: Native Windows (Recommended)
Claude Code now runs natively on Windows via Git Bash, PowerShell, or CMD. This is the simplest setup since both Claude Code and Automation Studio run on the same machine.
Install Claude Code on Windows:
Configuration file: %APPDATA%\Claude\settings.json
Add to settings:
Architecture:
Option B: WSL2 (Cross-Platform)
If you run Claude Code in WSL2, it can invoke the Windows Python server via PowerShell interop.
Configuration file: ~/.claude/settings.json
Add to settings:
Architecture:
5. Restart Claude Code
After updating the configuration, restart Claude Code to load the MCP server.
Available Tools
build_automation_studio_project
Compiles an Automation Studio project for simulation.
Parameters:
project_file- Path to the .apj file (Windows path)configuration- Name of the configuration to build
Example prompt: "Build my project at D:\Projects\MyApp\MyApp.apj using the X20CPU configuration"
run_automation_studio_simulator
Creates ARsim structure and launches the simulator.
Parameters:
ruc_package- Path to RUCPackage.zip (generated by build)start_simulator- Whether to start immediately (default: true)
Example prompt: "Start the simulator using the RUC package at D:\Projects\MyApp\Binaries\X20CPU\X20CP1686X\RUCPackage\RUCPackage.zip"
opcua_read_write
Reads or writes OPC UA variables on the running simulator.
Parameters:
node_id- OPC UA node identifier (e.g.,ns=6;s=::TaskName:varName)operation- "read" or "write"value- Value to write (for write operations)value_type- Data type: Boolean, Int16, Int32, Float, Double, String
Example prompts:
"Read the temperature variable from the TempCtrl task"
"Set the targetTemp to 75.0 in the TempCtrl task"
OPC UA Node ID Format
For task-local variables:
For global variables:
Note: Variables must be exposed in the OPC UA configuration (OpcUaMap.uad) to be accessible.
Troubleshooting
"Command not found" errors
Ensure Python is in your Windows PATH and the B&R tool paths in server.py are correct.
OPC UA connection failures
Verify the simulator is running
Check that variables are exposed in OpcUaMap.uad
Default credentials are Admin/password
WSL2 can't find powershell.exe
Ensure WSL2 has Windows interop enabled (default). Check with:
License
MIT License - see LICENSE for details.
Contributing
Contributions are welcome! Please feel free to submit issues and pull requests.
Acknowledgments
Model Context Protocol by Anthropic
FastMCP for the Python MCP SDK
B&R Automation for Automation Studio