Skip to main content
Glama
phobicdotno

Codesys-MCP-Master

by phobicdotno

Codesys-MCP-Master

One MCP server for every installed CODESYS 3.5 version (SP18, SP19, SP21, SP22; every offline tool live-tested on all four, online tools against a local soft PLC on SP18, SP19 and SP21). Each tool call picks the install from the project file's saved version. It launches CODESYS with its UI visible, keeps it running, and drives it through 132 tools: project and POU authoring, compile, online/runtime, devices and tasks, symbol configuration, multi-device projects, and a version + git release pipeline. The CODESYS menus stay usable while it is connected, and on SP22 the CODESYS-shipped MCP server's tools are available alongside (ide_ prefix).

Started as a fork of luke-harriman/Codesys-MCP, which stopped working on SP21+. About 13% of the code here is still from that project (measured 2026-10-06: roughly one line in eight of the TypeScript, Python scripts and tests); the rest was written for this one. Why and what changed: docs/whats-new.md.

Quick start

npm install -g codesys-mcp-master
codesys-mcp-master --print-config      # one MCP config entry for all installed CODESYS versions

Paste the entry into .mcp.json (or claude mcp add ...) and restart Claude Code. Details, install from source and config options: docs/installation.md.

Related MCP server: T-IA Connect (Siemens TIA Portal)

Working in natural language

You do not call the tools yourself. You tell Claude (or another MCP client) what you want in plain words, and it picks the tools, fills in the arguments and reports back. For example:

  • "Open the pump project and add a function block FB_PumpControl with a start and a stop input."

  • "Compile it and fix whatever errors come up."

  • "Where is nSpeed used? Rename it to nMotorSpeed everywhere."

  • "Switch the PLC to simulation, start the application and watch PLC_PRG.nCycles and GVL.bAlarm for ten seconds."

  • "Download the project to the PLC at 192.0.2.10 and tell me which version is running."

  • "Release the next minor version with a changelog entry."

Each request becomes one or more tool calls: create_pou, compile_project and get_compile_messages, find_references and rename_symbol, set_simulation_mode and monitor_variables, download_to_device and read_running_version_online, release_project_version. The client shows each call, so you can see what was done, and whether a call that changes something (a download, a write to a PLC) needs your approval first is up to the client and its permission settings. The server itself stops and asks in a few cases: before it closes another CODESYS, discards unsaved projects or starts a second CODESYS next to yours.

Name things the way you would to a colleague: project file names, object paths such as Application/PLC_PRG, variable expressions, PLC addresses. If something is ambiguous (several installs, a PLC that is in use, a project open in another CODESYS), the answer says so instead of guessing.

Documentation

Doc

Contents

docs/installation.md

npm and source install, MCP config, several installs

docs/tools.md

All 132 tools and the resources, per category

docs/cli-reference.md

CLI flags, env vars, --detect, --ssh-version

docs/installs-and-profiles.md

How one server picks the install per call, additional folders, version pin

docs/auto-mirror.md

Live source-control diff via --auto-mirror

docs/codex-cli.md

Using the server from OpenAI Codex CLI

docs/troubleshooting.md

Execution modes and troubleshooting

docs/vs-codesys-sp22-mcp.md

Quick comparison with the MCP server CODESYS ships in SP22

CHANGELOG.md

Changes per version

docs/whats-new.md

What this fork adds and fixes, with rationale

docs/development.md

Build, test, source layout

ARCHITECTURE.md

IPC protocol, watcher, lifecycle

docs/RELEASING.md

npm release procedure

Credits and license

Upstream architecture and the original tool set: luke-harriman/Codesys-MCP. This fork: phobicdotno/Codesys-MCP-Master, Karstein Kvistad. MIT.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    B
    maintenance
    MCP server that connects AI assistants to Siemens TIA Portal via the Openness API. AI-assisted PLC programming, project management, hardware configuration, cross-reference analysis, and deployment. 19 tools, 230 actions.
    42
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    MCP server for XS Studio that integrates with CODESYS toolkit and adds a custom create_dut tool, enabling project management, code generation, and DUT creation workflows.
    -