CODESYS MCP Toolkit
MCP server for CODESYS V3.5: Claude reads and edits Structured Text, compiles with the real compiler and runs the simulation.
- 133 ★ on the repository
- Last commit
- MIT
Broad access
Why this level
- Writes, renames and deletes CODESYS project objects, and one tool approval covers such actions.
- Autosave writes the project to disk after every change by default.
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add mcp/codesys-mcp-toolkitDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- Writes, renames and deletes CODESYS project objects, and one tool approval covers such actions.
- Autosave writes the project to disk after every change by default.
This is third-party code. Review the repository files before installing.
What it does
The server keeps one CODESYS session open in the background and gives the agent a single `codesys` tool with a set of actions: open and create a project, read the object tree, search code, write or rename POUs, methods, properties, interfaces, DUTs and GVLs as Structured Text. Compile errors come back with object, line and code, including for code that no task calls yet. For testing there is CODESYS simulation itself: start, step an exact number of cycles, read, write and force values. A live panel shows the project tree, code as it is written, compile results and Accept and Revert buttons for each change. The `batch` action joins up to 50 operations into one call.
Who it is for. Automation engineers writing PLC programs in CODESYS who want Claude to handle routine Structured Text work with compiler verification.
Good fit when
- You need to create a function block, call it from `PLC_PRG`, compile and prove in simulation that an output toggles.
- The project is large and the agent needs an overview: outlines, the I/O list, the device tree and library interfaces.
- You want controlled edits: each change is reviewed in the panel and accepted or reverted.
- You need to run the project through the CODESYS compiler and work through errors with line numbers.
Not a fit when
- You need to edit SFC, CFC, LD or FBD: version 2 edits Structured Text only.
- You work on Linux or macOS: the server platform is Windows.
- You need work against a real controller: the server goes online only to the simulation.
Example request
Create BlinkDemo.project, add a function block that toggles an output once per second, call it from PLC_PRG, compile it and prove in simulation that the output toggles.MCP
- Transport
- stdio
- Authentication
- not required
Limitations
Requires Windows, CODESYS V3.5 with the Scripting add-on (tested on SP21 and SP22 with Scripting 4.2 and SP21 with Scripting 4.1, SP16 and later should work) and Node.js 20 or newer. Schneider EcoStruxure Machine Expert is not supported yet. A cold CODESYS start takes one to three minutes, later starts about ten seconds. Graphical objects show in the tree and read as PLCopenXML but cannot be edited. One tool approval covers the actions that change or delete code, so work on a copy of the project or under version control. The live panel needs a client with MCP Apps support.
How to disable. Remove the codesys block from `claude_desktop_config.json` and restart the client. `npm uninstall -g @codesys/mcp-toolkit` removes the package. The CODESYS session ends two minutes after the last client disconnects.
FAQ
How do I connect CODESYS MCP Toolkit to Claude Desktop?
Install the package with `npm install -g @codesys/mcp-toolkit` and add a server to `claude_desktop_config.json` with the command `codesys-mcp-tool` and the args `--codesys-path`, `--codesys-profile`, `--workspace`. The first two are optional: without them the newest CODESYS install is used.
Can the server damage a real controller?
No, the server does not log in to a controller or download to it. The only online connection is to CODESYS simulation, and every online call first checks that simulation mode is on.
How do I undo a mistaken agent edit?
A checkpoint is taken when a project opens, and `revert_object` puts an object back to it with its methods and properties. In the live panel each change has Accept and Revert buttons.
Which CODESYS versions are supported?
SP21 and SP22 with Scripting 4.2 and SP21 with Scripting 4.1 are tested, and SP16 and later should work. For several versions add one server entry per version, each with its own `--codesys-path` and `--codesys-profile`.
Can it edit graphical PLC languages?
No, version 2 edits Structured Text only. SFC, CFC, LD and FBD objects show in the project tree and can be read as PLCopenXML.
Discussion
No questions or reviews yet.
Related
MCP serversAn MCP server that builds a code graph once and serves the answer to the agent instead of re-reading files
A CODESYS project as text files for Git and LLM agents: export, build, Structured Text analysis and tests in simulation
An MCP server that builds a code graph of functions, classes, calls and routes and answers the agent's structural queries locally
A VS Code extension that runs a local MCP server so an agent can search symbols, edit files and run commands in the terminal
An MCP server that lets an agent read files, search code and run commands in a workspace
Developer tools for the 1C MCP Server Constructor
Инструменты для разработки — MCP Tools для Конструктора MCP серверов 1С
Four ready MCP tools for executing code, running queries and diagnosing a 1C infobase, loaded into the third-party 1C MCP Server Constructor product
README in short
The README gives a Claude Desktop quick start, a table of actions by area from projects and code reading to simulation, a live-panel section and a list of safety measures. It continues with launch options, working with several CODESYS versions and a diagram of how the server talks to the CODESYS process through request and result files.