Festo Codesys MCP server
io.github.efranceschetti/festo-codesys-mcp·v1.0.1·2 starsMCP server for Festo/CODESYS PLCs: IEC 61131-3 ST + validated PLCopen XML generation.
2 stars37 downloads/wk
Reviews
Write oneNobody has reviewed Festo Codesys yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
Festo Codesys tools (38, 13 write)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
cpx_discover_systemConnects to a CPX-AP head at <ipAddress> and lists installed modules. Useful as a "is the bus alive?" check before deeper diagnostics.
cpx_read_channelReads a single channel (DI/DO/AI/AO) from a module by index.
cpx_system_stateDumps modules + all channel values. Heavier than discover_system — use sparingly.
cpx_write_channelwrite actionWrites 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.
create_data_typewrite actionGenerate a CODESYS data type: ENUM (E_*) or STRUCT (ST_*), with .st + PLCopen XML output. USE WHEN: you need an ENUM (state/mode) or STRUCT (config/record) to back FB, GVL, or program declarations. Name auto-corrected to E_ (enum) or ST_ (struct) prefix if missing.
create_function_blockwrite actionGenerate a CODESYS Function Block (.st + PLCopen XML) with the standard interface built in. USE WHEN: the user asks for a new FB and plc_library returned no reusable match. ALWAYS BEFORE: (1) plc_library action=search — never create what already exists; (2) plc_knowledge topics 'conventions' + 'abbreviations'. Standard pattern: bEnable/bExecute inputs, bDone/bBusy/bErr/nErrId outputs, nState state
create_gvlwrite actionGenerate a Global Variable List (.st + PLCopen XML) with {attribute 'qualified_only'}. USE WHEN: you need globals shared across POUs — I/O map, system flags, HMI tags (GVL_HMI), config. Name auto-corrected to GVL_ prefix if missing. Common: GVL_Sys, GVL_IO, GVL_HMI, GVL_Cfg.
create_programwrite actionGenerate a CODESYS Program (.st + PLCopen XML) for cyclic control logic. USE WHEN: you need a cyclic PRG (runs once per scan) — PRG_Main, PRG_Auto, sequence orchestration — and no reusable one exists. Programs run once per PLC scan (PRG_Main, PRG_Auto, etc.). Name auto-corrected to PRG_ prefix if missing.
create_project_structurewrite actionScaffold a standard CODESYS project directory for Festo CPX-E. USE WHEN: starting a new CODESYS project and you need the standard folder scaffold before creating POUs. Creates: src/0_Types, src/1_Globals, src/2_Programs, src/3_FunctionBlocks, src/4_Functions, src/5_Library, export/xml, docs. Set includeExamples=true to pre-populate with E_MachState, GVL_Sys, and PRG_Main stubs. After scaffolding,
debug_plc_codeStatic 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 t
edcon_drive_controlIssue 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)
edcon_pnu_readRead 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.
edcon_pnu_writewrite actionWrite 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.
edcon_position_taskMove the drive to a target position. Drive must already be in Operation Enabled state (call edcon_drive_control action=enable_powerstage first).
explain_error_codeDecode Festo/CODESYS/EtherCAT error codes using ALL embedded references. USE WHEN: any Festo/CODESYS/EtherCAT error code appears — 0x…, 16#…, drive fault, AL status. Never guess meanings. Accepts hex (0x7500), IEC (16#8011), or decimal formats. Searches: CiA 402, Festo PtP, CODESYS ground truth, ALL embedded topics, and all device manuals. If not found locally, search the web — then save useful fi
generate_plcopen_xmlBatch-convert a directory of .st files into a single PLCopen TC6 0200 XML for CODESYS import. USE WHEN: .st sources are final and reviewed, and the user wants a CODESYS-importable file. ALWAYS BEFORE: plc_knowledge topic 'ground-truth' (anti-hallucination XML rules) if you have not loaded it this session. ALWAYS AFTER: validate_plcopen_xml -> validate_plcopen_xsd -> validate_plcopen_semantic. Neve
ide_browse_project_treeReturns the hierarchical structure of the open project as JSON. Walks devices, applications, POUs, GVLs, folders. Read-only. Use this to discover what's in a project before reading or modifying specific POUs.
ide_compile_projectwrite actionRuns Build on the project. Look at the Message Store after for compile errors.
ide_create_methodwrite actionCreates a Method on an existing FB.
ide_create_pouwrite actionCreates 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.
ide_create_projectwrite actionCopies 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.
ide_create_propertywrite actionCreates a Property (getter+setter pair) on an existing FB.
ide_get_device_treeReturns the device hierarchy (PLC + I/O modules + bus configuration). Read-only. Crucial for Festo CPX-E setups where opening Device Editor in the GUI can crash; this script-based reading is robust. Set includeParameters=true to also include device parameter values (Symbol Configuration / IO mapping context).
ide_get_pou_codeReturns the Structured Text declaration and implementation of a POU. Read-only. Use before ide_patch_pou_code or ide_set_pou_code to know current state. POU path uses '/' segments (e.g., "Application/PRG_Main" or "Application/Folder/FB_X").
ide_open_projectOpens an existing .project file in the running CODESYS IDE. Requires FESTO_MCP_CODESYS_PATH and FESTO_MCP_CODESYS_PROFILE env vars.
ide_patch_pou_codewrite actionReplaces an exact text snippet inside a POU's declaration or implementation. The findText MUST occur exactly ONCE in the target section — if 0 matches OR ≥2 matches, the operation fails (forces caller to provide unique context, like Claude Code's Edit tool). Use ide_get_pou_code first to know current text. Safer than ide_set_pou_code for surgical edits.
ide_save_projectPersists pending changes of the open project to disk.
ide_set_pou_codeSets textual_declaration and/or textual_implementation of an existing POU. Pass either or both. Path: 'Application/POUName'.
plc_knowledgeplc_libraryAccess 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), util
plc_lookupQuick 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), 'f
plc_validateValidate PLC code against conventions — composable validators with consistent results. USE WHEN: you need to check ST against conventions programmatically — naming, FB interface, or state machine — without a full review. Actions: 'naming' (check variable names + Hungarian notation), 'fb_interface' (check FB pattern), 'state_machine' (check nState pattern), 'batch' (validate multiple items at once)
review_st_codeValidate 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-refer
st_find_referencesFind all references (usages) of an ST identifier across a directory of .st files — token-aware and comment/string-safe (unlike grep: ignores comments, strings, typed literals, and substring matches). USE WHEN: you need every usage of an ST identifier across files before renaming or refactoring. Each reference carries file, line/column, the line text, the containing POU, whether it is the declarati
st_symbolsvalidate_plcopen_semanticvalidate_plcopen_xmlvalidate_plcopen_xsd
Public scan report
scanner v0.1.9 · 2026-09-25 · same rubric, same numbers if you re-run it
- Code scan126 source files scanned25/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitylocal package, no credentials required12/15
- Maintenancelast push 7 days ago15/15
- Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
How Festo Codesys compares
Against every graded MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 92/100
- higher than 95% of 48,255 servers
- Tools
- 38
- the typical server has 7
- Tools that change things
- 34%
- typical: 0%. Fewer write tools means less an agent can break
- GitHub stars
- 2
- more than 75% of 28,688 servers
- Downloads a week
- 37
- more than 28% of 12,191 servers with a package
What its tools let an agent do: 24 read · 6 create · 8 change
Install Festo Codesys in Claude Code, Cursor or VS Code
Runs npx -y festo-codesys-mcp on your machine. Read the scan report first; the gateway never runs local packages.
claude mcp add festo-codesys-mcp -- npx -y festo-codesys-mcp
Festo Codesys: common questions
- Is Festo Codesys MCP server safe?
- Yes, by our scan: it is graded A (92/100). Read the Festo Codesys safety report
- How do I install Festo Codesys?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does Festo Codesys need an API key?
- No secret keys are declared. It reads 5 settings from the environment.
- Is Festo Codesys maintained?
- The last commit was 47 days ago (2026-09-18). The latest release is v1.0.1.
- How does Festo Codesys compare with other MCP servers?
- safety score 92/100 (higher than 95% of 48,255 servers); tools 38 (the typical server has 7); tools that change things 34% (typical: 0%. Fewer write tools means less an agent can break). Full comparison.