SuperAPIAI Directory

codesys-mcp-toolkit

github.com · AI developer platforms

codesys-mcp-toolkit is an MCP server for CODESYS V3.5 projects that lets Claude or other MCP clients directly read, write, compile, and simulate Structured Text. It maintains a CODESYS session in the background and uses the real CODESYS compiler to work with real projects, supporting editing of POUs, methods, properties, interfaces, DUTs, and GVLs; compile errors return the object, line number, and error code. It can also run in CODESYS's built-in simulation, step by cycle, read, write, and force variables, and provides a live panel with the project tree, code, compile results, and per-item accept/revert. In addition, it can generate browser HMIs and native CODESYS visualizations, export P&ID drawings, generate project reports, and export plain-text source code for git management. The runtime environment is Windows, CODESYS V3.5 with the Scripting plugin, and Node.js 20 or later; it connects only to CODESYS simulation and does not touch real controllers.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

Purpose: codesys-mcp-toolkit is an MCP server for connecting Claude or other MCP clients to CODESYS V3.5 projects. It maintains a CODESYS session in the background, letting the model directly operate on real projects and use the real CODESYS compiler rather than a simulated compiler.

Main capabilities:

  • Edit real projects: handle POUs, methods, properties, interfaces, DUTs, and GVLs as Structured Text.
  • Real compilation: return the object, line number, and error code where an error occurs, including code not yet called by any task.
  • Simulation testing: run in CODESYS's built-in simulation, step by precise cycles, read, write, and force variables, with no additional installation required.
  • Understand projects: provide outlines, I/O lists, device trees, and library interfaces without reading objects one by one.
  • Live panel: show the project tree, the code being written, and compile results, and let you choose Accept or Revert for each change.
  • Operator screen design: generate browser HMIs for programs, including production-line station overviews, process diagrams compliant with ISO 10628-2 and ISA-5.1, status indicators, values, trends, and alarms; can be exported as native CODESYS visualizations (including CODESYS alarms and user groups) or as P&ID drawings.
  • Handover and version control: generate project reports with commissioning checklists; export each object as plain text for git management, and support source comparison.
  • Graphical programming: create LD, FBD, CFC, and SFC programs and function blocks from simple descriptions, and return the same description when reading graphical POUs, making it easy to modify existing graphical code.

Usage: Install CODESYS V3.5 with the Scripting plugin on Windows, and prepare Node.js 20 or later. Add the server to Claude Desktop's %APPDATA%\Claude\claude_desktop_config.json and restart Claude Desktop. --codesys-path and --codesys-profile are optional parameters; if not provided, the latest CODESYS installation under Program Files and its latest profile are used. Schneider EcoStruxure Machine Expert is also supported V2.3, requires passing --codesys-path and omitting --codesys-profile. All operations are performed through a single MCP tool named codesys, with each operation corresponding to an action; batch can run up to 50 operations in a single call.

Use cases: writing and modifying structured text and graphical code in CODESYS V3.5 projects, compile verification, simulation debugging, HMI screen design and export, project handover documentation generation, and bringing projects under git version control.

Limitations: Windows only, requires CODESYS V3.5 and the Scripting plugin; SP21 and SP22 (Scripting 4.2) as well as SP21 (Scripting 4.1) have been tested, and SP16 and later versions should work. Connects only to CODESYS's built-in simulation, never to real controllers. Some operations (such as get_signature, find_references, rename_symbol, trace_setup, trace_record, debugging operations, hmi_export_codesys, alarm operations, and --show-window) are experimental features and may be unavailable or may not work on other versions. Panel cards require a client that supports MCP Apps. Native visualization export requires the FloatingPointUtils library from the CODESYS library repository. Trend display of current values is limited by the fact that scripts cannot yet create trend recordings. HMI screenshots require Microsoft Edge or Google Chrome to be installed.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools