codesys-mcp-server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
CODESYS MCP
CODESYS V3 automation through MCP: project editing, Structured Text refactoring, PLC operations, and searchable engineering documentation.
Quick start · Capabilities · Architecture · Security · Configuration · Development
A Model Context Protocol server for CODESYS Development System V3. It combines project and PLC automation through the CODESYS ScriptEngine with searchable, curated engineering documentation.
The server supports local stdio integration and an authenticated Streamable HTTP endpoint. HTTP is read-only for CODESYS operations by default.
Highlights
Create and inspect POUs, interfaces, DUTs, GVLs, methods, properties and actions.
Edit Structured Text, build applications and manage project libraries.
Work with devices, tasks, PLCopenXML, symbol configuration and network variable lists.
Read, write, force and monitor online values; manage the application lifecycle where explicitly enabled.
Search curated CODESYS guidance, local PDF manuals and allowlisted official documentation.
Use snapshots, dry runs and project-wide reference analysis before risky changes.
Run a warm CODESYS daemon for low-latency operations or an isolated cold process per call.
Related MCP server: CODESYS MCP Server
Requirements
Node.js 20 or newer.
npm.
Windows and CODESYS Development System V3 with ScriptEngine for project or PLC automation.
Documentation tools do not require a CODESYS installation.
Installation
git clone https://github.com/NPavii/codesys-mcp.git
cd codesys-mcp
npm install
npm run buildFor agent-guided installation and client registration, see agent.md.
Quick start
Stdio — recommended for local agents
npm run start:stdioOr register the built entry point directly:
node dist/src/cli.js --stdioStdio does not require an HTTP token. It exposes the complete trusted-local toolset, including codesys_eval, and inherits the launching user's permissions.
HTTP
Generate a token and place it in .env:
cp .env.example .env
node -e "console.log(require('node:crypto').randomBytes(32).toString('hex'))"MCP_TOKEN=<generated-token>Start the server:
npm startThe default endpoint is:
http://127.0.0.1:3000/mcpClients must send:
Authorization: Bearer <MCP_TOKEN>HTTP defaults to loopback only, denies browser Origins and exposes only read-only CODESYS tools. See SECURITY.md before enabling network access or write operations.
Architecture
MCP client
│
├── stdio
│
└── authenticated HTTP
│
▼
Transport and tool policy
│
▼
Node.js bridge
│
├── cold CODESYS process per operation
│
└── warm daemon with a per-user task queue
│
▼
CODESYS ScriptEngine
│
.project / .library / PLCThe warm daemon keeps the ScriptEngine session open and reduces typical operation latency from tens of seconds to a few seconds. Exactly one daemon should serve one isolated bridge runtime.
Multiple agents working on different projects should use separate MCP processes and isolated bridge runtimes. They must not share a daemon, queue, ping file, project file or online PLC session.
Tool catalogue
Area | Representative tools |
Project inspection |
|
Project editing |
|
Refactoring |
|
Build and lifecycle |
|
Libraries |
|
Tasks and devices |
|
Data exchange |
|
Online operations |
|
PLC application |
|
PLC files and source |
|
Symbols and NVL |
|
Safety and recovery |
|
Documentation |
|
Official online help |
|
Destructive operations that accept confirm require an explicit confirm: true. This field is an operational safeguard, not a replacement for authentication or authorization.
Recommended project workflow
Inspect the project tree and read existing objects before editing.
Keep the target project closed in the CODESYS GUI while the bridge owns it.
Create a snapshot before risky changes.
Use
codesys_batchfor related edits; use dry-run mode when available.Run builds as standalone operations, not inside a batch.
Treat the compiler summary as the build verdict and resolve errors and warnings.
Close the project or stop the warm daemon before returning to manual GUI work.
Warm daemon
Start the configured launcher:
bridge/bridge_daemon.cmdUseful environment switches:
Variable | Purpose |
| Do not open the companion monitor window. |
| Do not terminate existing CODESYS processes before startup. |
| Override the per-user warm-daemon queue. Keep its ACL private. |
| Semicolon-separated project list for warm-up. |
| Disable daemon auto-start from MCP. |
Machine-specific paths belong in bridge/bridge_daemon.local.ps1, which is excluded from Git and npm packages.
Configuration
Variable | Default | Description |
|
| HTTP port. |
|
| Bind host. Non-loopback requires |
| empty | Required for HTTP; minimum 32 characters. |
| local hosts | Comma-separated exact Host allowlist. |
| empty | Exact browser Origin allowlist; empty denies browser calls. |
|
| Enables CODESYS writes and online control over HTTP. |
|
| Independently enables ScriptEngine eval over HTTP. |
|
| Enables batch; nested batch and disallowed operations remain blocked. |
|
| Maximum simultaneous MCP sessions. |
|
| Idle session lifetime. |
|
| Per-source HTTP request limit. |
|
| Enables allowlisted official CODESYS lookup. |
|
| Fetch timeout per official page. |
|
| In-memory documentation cache TTL. |
|
| Streaming limit for external responses. |
|
| Enables local PDF extraction and search. |
|
| Folder scanned for |
|
| Maximum extracted text stored per PDF. |
|
| PDFs above this size are skipped. |
| auto-detected | Full path to |
| CODESYS V3.5 SP21 Patch 1 | Profile used for headless execution. |
|
| Bridge runtime directory. |
|
| Bridge operation timeout. |
|
| Maximum pending bridge calls. |
Enabling writes does not enable batch or eval. Non-loopback HTTP must be placed behind an HTTPS reverse proxy.
Local documentation
Place PDF manuals, datasheets and project notes in:
docs/pdfs/The server extracts and indexes their text. Scanned PDFs without a text layer may require OCR. Engineering decisions should always be checked against the original document and the target runtime.
Operational notes
Text writes require the project to be primary in the ScriptEngine session; the bridge handles promotion and demotion.
Create interfaces empty and add members individually. Do not replace an interface declaration with
codesys_set_code.Do not place build, clean or close-project operations inside
codesys_batch.Incremental builds can hide errors after type changes; perform a clean build when required.
Changing types of existing persistent variables can invalidate the persistent list; prefer adding new variables.
Some ScriptEngine operations vary by CODESYS service pack. The bridge returns an error instead of silently claiming success.
Security
Read SECURITY.md for the security model, private vulnerability reporting and release requirements.
Key defaults:
local-only HTTP binding;
mandatory HTTP authentication;
no wildcard CORS;
exact Host and Origin validation;
read-only HTTP CODESYS tools;
independent write, batch and eval opt-ins;
bounded sessions, requests, queues and external responses;
no runtime artifacts in npm packages.
Development and verification
npm test
npm run build
npm run lint
npm audit
npm run pack:checkThe test suite includes functional tests and dedicated security suites for HTTP boundaries, tool policy, resource limits, secret-bearing artifact cleanup and package contents.
License
Released under the MIT License. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Build and run AI workflows, agents, data tables and 1000+ API integrations from any MCP client.
Query your team's AI coding history and act on HypAware recommendations from any MCP client.
GitHub Copilot MCP: code, repo, PR, workflow tools for AI assistants.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceA 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,571 npm146MIT
- AlicenseNot gradedqualityDmaintenanceEnables CODESYS development assistance via MCP, including curated guidance, Structured Text writing help, local PDF search, and live official documentation lookup.1MIT
- FlicenseNot gradedqualityCmaintenanceMCP 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.67-
- FlicenseNot gradedqualityAmaintenanceMCP server for TwinCAT 3 PLC development enabling AI coding agents to build, configure, deploy, and debug TwinCAT PLC projects through a standard tool interface.2-