BnRClaudePlugin (br-build)

A Claude Code and MCP-compatible plugin marketplace providing deterministic B&R Automation Studio project inspection and CLI compilation (BR.AS.Build.exe) via the Model Context Protocol (MCP).
Looking for live PLC runtime connectivity, PVI variable read/write, SQLite symbol indexing, and 10–100ms real-time trending?
See the full 38-tool companion repository: br-automation-pvi-mcp-server and the architecture overview in automation-engineering-with-codex.
Why This Plugin Exists
Industrial PLC projects in B&R Automation Studio (.apj, .pkg, .var, .typ) cannot be validated by standard LLM syntax checks alone. BnRClaudePlugin equips AI coding agents with a closed-loop Inspect $\rightarrow$ Edit $\rightarrow$ Compile (BR.AS.Build.exe) $\rightarrow$ Parse Diagnostics workflow so generated Structured Text (IEC 61131-3) or ANSI C/C++ control code is verified against the actual B&R compiler before transfer.
Available Plugins
br-build
Build and inspect B&R Automation Studio projects directly from your AI coding agent. Provides 5 MCP tools:
| Tool | Description |
|---|
build_project | Build a B&R AS project (Build, Rebuild, BuildAndTransfer, BuildAndCreateCompactFlash) |
list_projects | Scan directories recursively for .apj project files |
get_project_info | Read project metadata (name, active/available hardware configurations, AS version) from an .apj file |
parse_build_log | Parse BR.AS.Build.exe output into structured compiler errors, warnings, file paths, and line numbers |
get_config | Show the current MCP server configuration and resolved BR.AS.Build.exe path |
Installation
As a Claude Code Plugin (Recommended)
From GitHub:
/plugin marketplace add controlguy-ys/BnRClaudePlugin
/plugin install br-build@br-automation
From a local clone:
/plugin marketplace add C:\path\to\BnRClaudePlugin
/plugin install br-build@br-automation
Manual MCP Configuration
If you prefer manual setup, add to your ~/.claude/.mcp.json:
{
"mcpServers": {
"br-build": {
"command": "node",
"args": ["<path-to>/BnRClaudePlugin/plugins/br-build/dist/index.js"],
"env": {
"BR_BUILD_EXE": "C:/Program Files (x86)/BrAutomation/AS6/bin-en/BR.AS.Build.exe",
"BR_PROJECTS_ROOT": "C:/Users/YourName/Projects"
}
}
}
}
Configuration
The server auto-detects B&R Automation Studio installation paths. Override with environment variables:
| Variable | Description | Default |
|---|
BR_BUILD_EXE | Path to BR.AS.Build.exe | Auto-detected from standard install paths |
BR_PROJECTS_ROOT | Root directory for project scanning | Current working directory |
BR_BUILD_TIMEOUT_MS | Build timeout in milliseconds | 300000 (5 minutes) |
BR_EXCLUDED_DIRS | Comma-separated directories to exclude from scanning | node_modules,Temp,Binaries,.git |
Auto-detection paths
The server checks these locations for BR.AS.Build.exe:
C:/Program Files (x86)/BrAutomation/AS6/bin-en/BR.AS.Build.exe
C:/Program Files/BrAutomation/AS6/bin-en/BR.AS.Build.exe
C:/BrAutomation/AS6/bin-en/BR.AS.Build.exe
- Any
AS* version directory under the above paths
Usage Examples
Once installed, Claude Code gains access to B&R build tools:
> Build my project at C:\Projects\MyProject\MyProject.apj
> List all B&R projects in C:\Projects
> What configurations are available in my project?
> Parse this build log for errors
Build Modes
| Mode | Description |
|---|
Build | Build active configuration (default) |
Rebuild | Full rebuild of active configuration |
BuildAndTransfer | Build and prepare for transfer (no actual transfer) |
BuildAndCreateCompactFlash | Build for offline installation |
Return Values
| Exit Code | Description |
|---|
| 0 | No errors or warnings |
| 1 | Warnings only |
| 3 | Build error |
Development
To modify the br-build plugin:
cd plugins/br-build
npm install
npm run build # Compile TypeScript
After changes, rebuild and commit dist/ (required for plugin distribution).
Repository Structure