Skip to main content
Glama
README.md
<p align="center">
  <img src="public/mascot.png" alt="PLC Agentics mascot" width="300" />
</p>

# PLC Agentics

> An MCP server that gives any AI expert-level knowledge of PLC programming (IEC 61131-3).

![license](https://img.shields.io/badge/license-MIT-blue)
![node](https://img.shields.io/badge/node-%3E%3D18-green)

## What it does

PLC Agentics is a [Model Context Protocol](https://modelcontextprotocol.io) server. It gives AI
assistants such as Claude Desktop, ChatGPT or Gemini structured knowledge about PLC brands, IEC 61131-3
languages and proven code templates.

Describe what you need in plain language ("a motor start/stop with fault latch for a Siemens S7-1500")
and the model uses these tools to generate code that matches the target IDE, language and conventions.

It runs over stdio for MCP clients. An optional HTTP mode exposes the same tools as a REST API for
assistants without MCP support.

## Supported brands

| Brand | IDE | Languages |
| --- | --- | --- |
| Siemens S7 | TIA Portal V17+ | SCL, LAD, FBD, STL, GRAPH |
| Allen-Bradley / Rockwell | Studio 5000 Logix Designer | LD, ST, FBD, SFC |
| CODESYS 3.5 | CODESYS Development System | ST, LD, FBD, SFC, IL, CFC |
| Schneider Electric | EcoStruxure Control Expert | ST, LD, FBD, SFC, IL |
| Mitsubishi MELSEC | GX Works 3 | LD, ST, FBD, SFC |
| Omron NJ/NX | Sysmac Studio | ST, LD, FBD, SFC |
| Beckhoff TwinCAT 3 | TwinCAT 3 XAE | ST, LD, FBD, SFC, IL, CFC |

## Installation

### Claude Desktop (recommended)

Add this to your Claude Desktop config (`~/.config/Claude/claude_desktop_config.json` on Linux):

```json
{
  "mcpServers": {
    "plc-agentics": {
      "command": "npx",
      "args": ["-y", "plc-agentics"]
    }
  }
}
```

### From source

```bash
git clone https://github.com/lucasavilanoriega-ux/plc-agentics.git
cd plc-agentics
npm install
node src/cli.js --help
```

### HTTP mode (ChatGPT / Gemini / DeepSeek)

```bash
HTTP_PORT=3000 node src/cli.js serve
```

Endpoints: `GET /openapi.json`, `GET /tools`, `POST /tool/<name>`.

## Available MCP tools

| Tool | Description |
| --- | --- |
| `list_brands` | Lists the supported PLC brands |
| `get_brand_config` | Returns IDE, languages, naming and export conventions for a brand |
| `get_code_template` | Returns a code template for an automation pattern in a chosen language |
| `list_templates` | Lists all available code templates |
| `get_iec61131_reference` | Returns IEC 61131-3 language and topic reference |

## Code templates

- `motor_control`: start/stop/fault with manual/auto mode
- `pid_loop`: closed-loop PID with output scaling
- `conveyor_sequence`: multi-zone sequencer with jam detection
- `safety_estop`: dual-channel E-stop monitoring and restart
- `alarm_management`: priority, acknowledge, reset and history
- `batch_recipe`: ISA-88 inspired step sequencer
- `modbus_read`: cyclic Modbus TCP holding-register read

Run `list_templates` for the full, current list.

## Usage examples

- "Write a motor control block in SCL for a Siemens S7-1500 with fault latch."
- "Give me a PID loop in Structured Text for CODESYS with anti-windup."
- "Create an alarm manager for Allen-Bradley with acknowledge and history."
- "Build a 3-zone conveyor sequence for Beckhoff TwinCAT."

> Generated code must be reviewed and tested by a qualified engineer before it runs on real equipment.
> This applies especially to safety functions.

## Deploying the landing page

The landing page is a static `index.html` and deploys to Vercel with no build step.
See `vercel.json` for headers and caching.

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md). Fork, branch, open a PR.

## License

MIT

TDQS

A4/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a clearly distinct purpose within the PLC knowledge lookup domain: listing brands vs. getting brand config, listing templates vs. retrieving a template, and fetching IEC 61131-3 reference. The descriptions explicitly clarify when to use each, so an agent should not confuse them.

Naming Consistency5/5

All names follow a consistent snake_case verb_noun pattern: list_brands, list_templates, get_brand_config, get_code_template, get_iec61131_reference. The convention is predictable throughout the set.

Tool Count5/5

Five tools is well-scoped for a reference/lookup server focused on PLC brands, templates, and language references. Each tool earns its place and there is no redundant or trivial tool.

Completeness4/5

The surface covers the core lookup lifecycle: discover brands, retrieve brand configuration, list and retrieve code templates, and access IEC 61131-3 syntax rules. Minor gaps remain, such as a dedicated validation tool or template search by pattern, but agents can work around these using existing tools.

Maintenance

ActivityMaintained
ResponsivenessNo issues