loading…
Search for a command to run...
loading…
Enables AI assistants to interact with B\&R Automation Studio projects by building code, running ARsim simulators, and reading or writing OPC UA variables. It f
Enables AI assistants to interact with B\&R Automation Studio projects by building code, running ARsim simulators, and reading or writing OPC UA variables. It facilitates industrial automation development and real-time variable integration through natural language commands.
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.
git clone https://github.com/AndrewMusser/br-automation-mcp.git
cd br-automation-mcp
pip install -r requirements.txt
Edit server.py to match your environment:
Update these paths to match your Automation Studio installation:
AS_BUILD_PATH = "C:\\BrAutomation\\AS412\\bin-en\\BR.AS.Build.exe"
PVI_TRANSFER_PATH = "C:\\BrAutomation\\PVI\\V4.12\\PVI\\Tools\\PVITransfer\\PVITransfer.exe"
Common installation locations:
C:\BrAutomation\AS412\bin-en\BR.AS.Build.exeC:\BrAutomation\AS49\bin-en\BR.AS.Build.exeC:\BrAutomation\PVI\V4.x\PVI\Tools\PVITransfer\Configure the OPC UA connection settings for communicating with ARsim:
OPCUA_HOST = "localhost"
OPCUA_PORT = 4840
OPCUA_USERNAME = "Admin"
OPCUA_PASSWORD = "password"
Important: These credentials must match your Automation Studio project's OPC UA configuration:
Physical/<Config>/<CPU>/AccessAndSecurity/UserRoleSystem/Physical/<Config>/<CPU>/Connectivity/OpcUA/Choose the setup that matches how you run Claude Code:
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:
winget install Anthropic.ClaudeCode
Configuration file: %APPDATA%\Claude\settings.json
Add to settings:
{
"mcpServers": [
{
"name": "br-automation-mcp",
"type": "stdio",
"command": "python",
"args": ["D:\\path\\to\\br-automation-mcp\\server.py"],
"enabled": true
}
]
}
Architecture:
┌─────────────────────────────────────────────────────────────┐
│ Windows │
│ │
│ ┌─────────────┐ ┌─────────────────────────────────────┐ │
│ │ Claude Code │───▶│ server.py (MCP STDIO Server) │ │
│ │ (Git Bash) │ └───────────────┬─────────────────────┘ │
│ └─────────────┘ │ │
│ │ │
│ ┌───────────────────────────┼───────────────┐ │
│ ▼ ▼ ▼ │
│ ┌─────────────┐ ┌──────────────┐ ┌─────────┐ │
│ │ BR.AS.Build │ │ PVITransfer │ │ OPC UA │ │
│ │ (Build) │ │ (Simulate) │ │ (Test) │ │
│ └─────────────┘ └──────────────┘ └─────────┘ │
└─────────────────────────────────────────────────────────────┘
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:
{
"mcpServers": [
{
"name": "br-automation-mcp",
"type": "stdio",
"command": "powershell.exe",
"args": [
"-ExecutionPolicy",
"Bypass",
"-File",
"D:\\path\\to\\br-automation-mcp\\run-server.ps1"
],
"enabled": true
}
]
}
Architecture:
┌─────────────────────────────────────────────────────────────┐
│ WSL2 (Linux) │
│ ┌─────────────────┐ │
│ │ Claude Code │ │
│ │ │──── powershell.exe ────┐ │
│ └─────────────────┘ │ │
└─────────────────────────────────────────────│───────────────┘
│
┌─────────────────────────────────────────────│───────────────┐
│ Windows ▼ │
│ ┌─────────────────┐ ┌─────────────────────────────────┐ │
│ │ run-server.ps1 │───▶│ server.py (MCP STDIO Server) │ │
│ └─────────────────┘ └───────────────┬─────────────────┘ │
│ │ │
│ ┌───────────────────────────────┼───────────────┐ │
│ ▼ ▼ ▼ │
│ ┌─────────────┐ ┌──────────────┐ ┌─────────┐ │
│ │ BR.AS.Build │ │ PVITransfer │ │ ARsim │ │
│ │ (Build) │ │ (Simulate) │ │ (OPC UA)│ │
│ └─────────────┘ └──────────────┘ └─────────┘ │
└─────────────────────────────────────────────────────────────┘
After updating the configuration, restart Claude Code to load the MCP server.
build_automation_studio_projectCompiles an Automation Studio project for simulation.
Parameters:
project_file - Path to the .apj file (Windows path)configuration - Name of the configuration to buildExample prompt: "Build my project at D:\Projects\MyApp\MyApp.apj using the X20CPU configuration"
run_automation_studio_simulatorCreates 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_writeReads 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, StringExample prompts:
For task-local variables:
ns=6;s=::<TaskName>:<VariableName>
For global variables:
ns=6;s=::AsGlobalPV:<VariablePath>
Note: Variables must be exposed in the OPC UA configuration (OpcUaMap.uad) to be accessible.
Ensure Python is in your Windows PATH and the B&R tool paths in server.py are correct.
Ensure WSL2 has Windows interop enabled (default). Check with:
which powershell.exe
MIT License - see LICENSE for details.
Contributions are welcome! Please feel free to submit issues and pull requests.
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"b-r-automation-studio-mcp-server": {
"command": "npx",
"args": []
}
}
}