CODESYS MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@CODESYS MCP Server Create a new CODESYS project at C:\work\demo.project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
CODESYS MCP Server (standalone)
A standalone MCP server for official CODESYS engineering through the vendor ScriptEngine.
It is spawn-only: every request starts a private CODESYS.exe --runscript process, edits a
.project file on disk, and exits. There is no IDE plugin, no attach mode, no named pipe, and
no online/PLC access.
This build supports the official CODESYS.exe only. OEM editions such as InoProShop are not supported by this package.
Requirements
Item | Requirement |
OS | Windows 10/11 x64 |
Node.js | 18 or newer |
CODESYS | Official CODESYS installed and activated on the same machine |
Tested baseline | CODESYS V3.5 SP21 Patch 6. Other V3.5 releases may work but are not verified |
Related MCP server: inoproshop
Install
cd C:\Tools\codesys-mcp-standalone
npm installOr use the package directly from a release archive; only the node_modules dependencies are
needed at runtime.
Required configuration
The MCP server process must receive these two environment variables. They are read on every tool call, so the client configuration below is the recommended place to set them.
Variable | Required | Meaning | Example |
| yes | Absolute path to the official |
|
| yes | Exact profile name installed next to CODESYS |
|
CODESYS_EXE must point to a file named CODESYS.exe. The server derives the profile
directory from it:
<install>\CODESYS\Common\CODESYS.exe
<install>\CODESYS\Profiles\<CODESYS_PROFILE>.profile.xmlOptional configuration
Variable | Default | Meaning |
|
| Timeout for one request. On timeout the IDE is not killed automatically; the error contains the run directory to inspect |
|
| Request temp folders and the |
| not set |
|
Attach-related variables (CODESYS_MODE=attach, CODESYS_ATTACH_*, CODESYS_PID,
CODESYS_PROJECT, instance) do not exist in this package. Setting CODESYS_MODE to anything
other than spawn is reported as a configuration error.
Find the executable and profile
# Change this to your CODESYS installation
$exe = "C:\Program Files\CODESYS 3.5.21.60\CODESYS\Common\CODESYS.exe"
# The executable must exist and be CODESYS.exe
Test-Path $exe
# Available profile names
$profiles = Join-Path (Split-Path (Split-Path $exe -Parent) -Parent) "Profiles"
Get-ChildItem "$profiles\*.profile.xml" |
ForEach-Object { $_.Name -replace '\.profile\.xml$', '' }Validate the configuration
$env:CODESYS_EXE = "C:\Program Files\CODESYS 3.5.21.60\CODESYS\Common\CODESYS.exe"
$env:CODESYS_PROFILE = "CODESYS V3.5 SP21 Patch 6"
node tools/check-config.mjsExpected output:
CODESYS_EXE = C:\Program Files\CODESYS 3.5.21.60\CODESYS\Common\CODESYS.exe
CODESYS_PROFILE = CODESYS V3.5 SP21 Patch 6
CODESYS_TIMEOUT_MS = 660000
CODESYS_DATA_DIR = C:\Users\<user>\AppData\Local\CodesysMcp\standalone
Profiles dir = C:\Program Files\CODESYS 3.5.21.60\CODESYS\Profiles
Available profiles:
- CODESYS V3.5 SP21 Patch 6
Data directory: writable
Configuration OK.On failure the command lists every problem and exits with code 1.
MCP client configuration
Claude Desktop, Cursor, or any MCP client that supports stdio:
{
"mcpServers": {
"codesys": {
"command": "node",
"args": ["C:/Tools/codesys-mcp-standalone/server.mjs"],
"env": {
"CODESYS_EXE": "C:/Program Files/CODESYS 3.5.21.60/CODESYS/Common/CODESYS.exe",
"CODESYS_PROFILE": "CODESYS V3.5 SP21 Patch 6"
}
}
}
}Forward slashes work on Windows. If you use backslashes, double them in JSON
(C:\\Program Files\\...). A ready-to-edit file is included at
examples/mcp-config.json.
Tool
The server exposes exactly one tool: codesys_engineering.
Field | Type | Meaning |
|
| Create a new empty project container, or run steps |
| string | Absolute path to a |
| boolean | Optional: use an isolated user profile so an already-open IDE does not block the run |
| array | 1..200 |
batch stops on the first error. Compiler errors also stop the remaining steps. Failed batches
are not retried.
Create an empty project
{
"action": "create_empty",
"project": "C:/work/demo.project"
}create_empty creates only the project container (no controller). Add devices with the
add_device operation.
Read and edit
{
"action": "batch",
"project": "C:/work/demo.project",
"steps": [
{ "op": "tree", "args": {} },
{ "op": "read", "args": { "path": "Application/PLC_PRG" } },
{ "op": "write", "args": { "path": "Application/PLC_PRG", "implementation": "n := n + 1;" } },
{ "op": "compile", "args": {} },
{ "op": "save", "args": {} }
]
}Only save (or save: true on a step) writes the project back to its current path. save_as,
convert, and open_archive write to the paths you specify; export/build operations write only
the output file you pass.
Operations
Group | Operations |
Read |
|
Edit |
|
Build |
|
Project/files |
|
Device/config |
|
Full parameters and return shapes: docs/operations.md.
Behavior and safety
One request at a time. A second concurrent request is rejected; requests are not queued.
A lock file prevents two server processes from running CODESYS at the same time. If a run crashes, inspect the lock file shown in the error before deleting it.
deleterequiresrecursive: truewhen the target has children.open_archiveandconvertdepend on the local CODESYS installation, converters, and licenses. They return a clear error when the environment cannot satisfy them.isolated: truecreates a temporary user profile. CODESYS may ask for activation or start with default settings in that profile.No login, download, online value access, gateway, or PLC file transfer is implemented.
Troubleshooting
Message | Fix |
| Add it to the MCP client |
| Check the absolute path and |
| Point to the official executable; OEM editions are not supported |
| Use one of the names printed by |
| Close it, or pass |
| Another run is active or crashed; inspect the lock path in the message |
Timeout | Inspect the run directory in the error; check the IDE window and license state |
License
MIT. See LICENSE.
Available Tools
1 toolcodesys_engineeringA
Official CODESYS engineering through the ScriptEngine, spawn-only. Launches a private CODESYS.exe --runscript process, edits the given .project file, and exits. Without save=true nothing is written to disk. No attach mode, no plugin, no online/PLC access. Requires CODESYS_EXE and CODESYS_PROFILE environment variables; run "node tools/check-config.mjs" to validate them. create_empty creates a new empty .project container (no controller). batch runs 1..200 steps and stops on the first failure. Close other CODESYS instances first, or pass isolated=true for a separate user profile.
Inputs: action (required), project (required), steps, isolated.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
There is only one tool, so an agent cannot misselect between competing options. The internal sub-operations (create_empty, batch, save) are documented within the single description rather than exposed as separate confusable tools.
With a single tool there is nothing to be inconsistent with, and codesys_engineering is clear and snake_case. It is a noun/domain name rather than the verb_noun convention, which is a minor deviation but not confusing.
A single monolithic tool covering an entire CODESYS engineering domain feels thin, essentially a dispatcher hiding create/batch/save operations behind one entry point. It is defensible as a deliberately minimal spawn-only wrapper, but offers no granular surface.
The offline project-file editing scope is coherent (create empty container, batch edits, optional save), but notable gaps exist: no read/inspect operations, no listing or deleting project objects, and explicitly no online/PLC or attach access. Agents can do write workflows but have limited introspection.
Maintenance
Related MCP Connectors
Global CAD/BIM, industrial engineering (FEM, CFD) and property tools via one MCP endpoint.
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
Hosted MCP server and Agent Skills for specs, engineering threads, and project memory.
Verified component catalog over remote MCP: agents pick component ids and get a stamped project repo that builds. Connect at https://www.botkelp.com/mcp. Auth: MCP OAuth 2.1, or a Bearer bk_live_ API key; initialize and tools/list are open.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceA Model Context Protocol server that enables seamless interaction between MCP clients (like Claude Desktop) and CODESYS V3 programming environments, allowing automation of project management, POU creation, code editing, and compilation tasks.1,455 npm159MIT
- AlicenseNot gradedqualityBmaintenanceEnables local stdio-based MCP integration with InoProShop/CODESYS for project structure reading, POU editing with verified writes, compilation, task configuration, and persistent session recovery.6MIT
- AlicenseNot gradedqualityBmaintenanceEnables driving any installed CODESYS 3.5 version (SP18–SP22) from a single MCP server, automatically selecting the right install from each project file's saved version. Exposes 127 tools covering project and POU authoring, compile, online/runtime control, devices and tasks, symbol configuration, multi-device projects, and a version plus git release pipeline.7MIT
- AlicenseNot gradedqualityCmaintenanceEnables read-only TwinCAT ADS diagnostics and symbol reads, offline PLC XML source-edit previews with diffs, and template-based Scope acquisition candidate generation over MCP stdio.2MIT