Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BnRClaudePlugin

A Claude Code plugin marketplace providing B&R Automation Studio build tools via the Model Context Protocol (MCP).

Available Plugins

br-build

Build B&R Automation Studio projects directly from Claude Code. 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, configurations) from an .apj file
parse_build_log Parse build output into structured errors and warnings
get_config Show the current MCP server configuration

Installation

As a Claude Code Plugin (Recommended)

From a local clone:

/plugin marketplace add C:\path\to\BnRClaudePlugin
/plugin install br-build@br-automation

From GitHub:

/plugin marketplace add googoles/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:

  1. C:/Program Files (x86)/BrAutomation/AS6/bin-en/BR.AS.Build.exe
  2. C:/Program Files/BrAutomation/AS6/bin-en/BR.AS.Build.exe
  3. C:/BrAutomation/AS6/bin-en/BR.AS.Build.exe
  4. 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

BnRClaudePlugin/
├── .claude-plugin/
│   └── marketplace.json          # Plugin marketplace catalog
├── .gitignore
├── plugins/
│   └── br-build/
│       ├── .claude-plugin/
│       │   └── plugin.json       # Plugin manifest
│       ├── src/                  # TypeScript source
│       ├── dist/                 # Compiled JavaScript
│       ├── node_modules/         # Committed (required for plugin install)
│       ├── package.json
│       └── tsconfig.json
├── README.md
└── LICENSE.md

License

MIT License - see LICENSE.md

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages