MCP server for Festo/CODESYS PLC engineering — IEC 61131-3 ST generation, validated PLCopen XML, embedded knowledge base (27 topics, 19 manuals, BM25 search), 38-block ST library, optional CODESYS IDE driving and hardware commissioning
Strong foundation with 19 well-named tools covering PLC engineering, code analysis, IDE automation, and hardware commissioning. Tool names follow verb_noun pattern (debug_plc_code, review_st_code, ide_open_project). Descriptions are detailed and context-rich, averaging 180 - 250 chars with clear USE WHEN guidance. Input schemas present for all tools with type constraints (enums, minLength, patterns). However, output schemas are not documented, LLMs cannot predict response structure. Error handling guidance is minimal; most tools lack recovery hints. Tool annotations present (readOnlyHint, destructiveHint, idempotentHint) but inconsistently applied. Some parameter descriptions could be more concise; a few lack explicit format guidance (e.g., ipAddress validation relies on minLength=7 rather than regex).
Connects to a CPX-AP head at <ipAddress> and lists installed modules. Useful as a "is the bus alive?" check before deeper diagnostics.
Reads a single channel (DI/DO/AI/AO) from a module by index.
Dumps modules + all channel values. Heavier than discover_system — use sparingly.
Writes a value to a channel (DO/AO) on a module. Bypasses the PLC — for bench commissioning only. Will fail if a PLC has the bus locked.
Static analysis for Structured Text bugs — run BEFORE deploying to a real PLC. USE WHEN: ST code is convention-clean and you need runtime-bug analysis, or the user reports misbehavior. Catches: WHILE/REPEAT loops (watchdog risk), missing error handling (bErr/nErrId), CiA 402 safety gaps (MC_Power without MC_Stop), state machine issues (missing IDLE/ERROR), Hungarian notation violations, REAL-INT type mismatches, unused timer outputs. Returns categorized Critical/Warning/Suggestion results.
Output schemas not documented. LLMs cannot predict response structure for any tool. Responses appear to be free-form text or structured objects, but no schema is visible in tool definitions.
Error handling lacks recovery guidance. Tools do not document what errors are retryable, what user actions are needed, or what to try next. E.g., ide_open_project may fail if CODESYS_PATH env var is missing, but no guidance is provided.
IP address validation relies on minLength=7 rather than regex pattern. This allows invalid IPs like '1.2.3.4' (7 chars) and rejects valid ones like '::1' (IPv6). Use pattern: '^([0-9]{1,3}\.){3}[0-9]{1,3}$' or accept both IPv4 and IPv6.
Inferred effective spec: 2025-06-18+.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 62 | 2025-06-18+ | v2 |
Issue a CiA 402 state-machine action on a Festo drive. Actions: - ack_faults clear latched faults (no-op if none) - enable_powerstage drive to Operation Enabled state (drives can now move) - disable drive to Switch On Disabled - reference run drive-controlled homing (referencing_task)
Read a Parameter Number Unit (PROFIDRIVE PNU = CiA 402 SDO object). Examples: - PNU 1124 = Firmware version (safe diagnostic) - PNU 24700 (0x607C) = Home Offset / Reference Offset Returns hex-encoded bytes.
Write a Parameter Number Unit. **Destructive — modifies drive parameters.** For Reference Offset commissioning: pnu=24700 (0x607C), valueHex=little-endian INT32. Always read first with edcon_pnu_read to confirm current value before writing.
Move the drive to a target position. Drive must already be in Operation Enabled state (call edcon_drive_control action=enable_powerstage first).
Runs Build on the project. Look at the Message Store after for compile errors.
Creates Program / FunctionBlock / Function inside a CODESYS project. Parent path uses '/' segments. Application root is typically "Application". For example: parentPath="Application" creates the POU at the Application root.
Copies a CODESYS Standard.project template to a new path and opens it. Template path comes from FESTO_MCP_CODESYS_TEMPLATE env var (or pass templatePath explicitly). Requires FESTO_MCP_CODESYS_PATH and FESTO_MCP_CODESYS_PROFILE.
Opens an existing .project file in the running CODESYS IDE. Requires FESTO_MCP_CODESYS_PATH and FESTO_MCP_CODESYS_PROFILE env vars.
Persists pending changes of the open project to disk.
Sets textual_declaration and/or textual_implementation of an existing POU. Pass either or both. Path: 'Application/POUName'.
Load embedded PLC reference documentation — the source of truth for Festo/CODESYS/EtherCAT/PLCopen. USE WHEN: before writing ANY Structured Text (load 'conventions' + 'abbreviations' first), before generating XML (load 'ground-truth'), before motion code (load 'festo-ptp' + 'ethercat-cia402'), or whenever a technical fact is needed — never answer from memory. Actions: 'topic' (load by name), 'search' (BM25 full-text across ALL topics + manuals), 'list_manuals', 'read_manual'. Topics (27): conventions, abbreviations, hungarian-notation, state-machines, engineering-discipline, ground-truth, xml-rules, plcopen-schema, plcopen-example, plcopen-extensions, festo-cpx, festo-ptp, festo-cdpx-hmi, festo-vtux-terminal, festo-cmmt-st, festo-mqtt, motion-patterns, ethercat-cia402, eplan, hmi-web-architecture, opcua-websocket-gateway, hmi-embedded-deploy, plc-architecture-patterns, plc-alarm-patterns, codesys-recipe-manager, codesys-gotchas, plc-testing-twin. Covers: Festo CPX/PtP/CMMT/MQTT, CODESYS, EtherCAT CiA 402, PLCopen XML, naming conventions, engineering discipline & quality gates, custom Web HMI + OPC-UA gateway, PLC program architecture + alarm design, recipes, testing without hardware, CODESYS gotchas, 19 device manuals. If information is not found here, you may search the web — but suggest saving useful findings to knowledge/manuals/ for future use.
Access the 38-block reusable ST library (30 Function Blocks + 8 shared DUTs) — ALWAYS check here BEFORE creating new FBs. USE WHEN: about to create any FB, or looking for ready-made motor/valve/PID/sensor/safety logic. Actions: 'search' (keyword match), 'list' (browse by category), 'get' (full source code). Categories: types (8), motion (4), actuators (5), sensors (4), safety (2), system (5), utilities (10). Contains ready-to-use blocks for motors, valves, PID, sensors, safety, and more. DO NOT create a new FB if a similar one already exists here.
Quick lookup for PLC conventions and error codes — instant answers without loading full knowledge topics. USE WHEN: you need a single fact — prefix, state number, error code — without loading a full topic. Try this BEFORE plc_knowledge for point lookups. Actions: 'hungarian' (type→prefix), 'type_prefix' (POU→prefix), 'state' (state number→name), 'error_code' (decode Festo/CiA402/CODESYS error), 'fb_interface' (standard FB pattern), 'list_standard' (full reference).
Validate ST code against naming conventions — returns ONLY violations, not reference dumps. USE WHEN: immediately after writing or editing any ST code. Checks: Hungarian notation (b=BOOL, n=INT, r=REAL, t=TIME, fb=FB instance), POU prefixes (FB_, PRG_, FC_), FB interface pattern (bEnable/bDone/bBusy/bErr/nErrId), state machine (0=IDLE, 90=DONE, 99=ERROR), snake_case detection. Includes quick-reference table when violations are found.
Destructive tools (cpx_write_channel, edcon_drive_control, edcon_position_task, edcon_pnu_write) lack confirmation or dry-run support. Agents can accidentally modify hardware state without a safety gate.
IDE tools (ide_open_project, ide_create_project, ide_save_project) depend on environment variables (FESTO_MCP_CODESYS_PATH, FESTO_MCP_CODESYS_PROFILE, FESTO_MCP_CODESYS_TEMPLATE) but do not document what happens if they are missing. No fallback or error guidance provided.