Skip to main content
Glama
control-expert-mcp

control-expert-mcp

Control Expert MCP Server

An MCP server that connects AI agents (Claude Desktop, Claude Code, VS Code Copilot, or any MCP client) to a local EcoStruxure Control Expert (formerly Unity Pro) installation — so the AI can read, edit, and create PLC projects from scratch.

Inspired by tiaportal-mcp for Siemens TIA Portal. Where TIA Portal exposes the Openness API, Control Expert exposes the Unity Developer's Edition (UDE) COM automation server (PSBroker.PServerBroker) — this server drives it through pywin32 and exposes it as MCP tools over stdio.

AI agent (Claude, Copilot, ...) ──MCP/stdio──> control-expert-mcp ──COM──> Control Expert

What the AI can do

  • Projects: create from scratch for any CPU in the hardware catalog (M340, M580, Premium, Quantum...), open/save .stu/.sta, import/export .xef/.zef

  • Browse: tasks, sections, variables, DFB/DDT types, CPU/hardware info, build state

  • Program: create/read/delete sections in ST, LD, FBD, SFC, IL; write logic by importing Control Expert XML (the AI reads an existing section's XML once and mirrors the schema — validated round-trip for all five languages)

  • Hardware: walk the full bus → drop → rack → module topology, add/remove IO modules by catalog part number, change the CPU

  • Modbus / DTMs (validated live on M580): browse the DTM topology, add slave DTMs (add_dtm("Modbus Device", ..., parent_dtm="BMEP58_ECPU_EXT") — the protocol id is Modbus and is auto-tried), set device IP addresses, read the scanner state (get_dtm_control_parameters), and add Modbus scan requests (read/write addresses + sizes) by editing the master DTM dataset through get_master_dtm_dataset / set_master_dtm_dataset — a ManagedModbusRequest template with the numbering rules is built into the tool description; a written scan line builds built_ok and shows up as a ModbusScanLine in the scanner config

  • Networks (Premium/Quantum): create logical Ethernet networks and set their IP service configuration

  • Variables: list/create/update/delete global variables incl. type, comment, address (%MW...), initial value

  • Build: analyze and build the project, get the resulting build state

  • UI: pop the Control Expert window open so a human can watch or take over, and open an animation table's editor live (open_animation_table) to watch values animate while the AI drives a test

  • Online (opt-in): connect to PLC/simulator, download/upload, run/stop

  • Live values (opt-in): read and write running PLC/simulator values over Modbus TCP (modbus_connect → read_tags/write_tags) — the UDE/COM API has no live tag access, so this is the channel for testing logic against a running controller (located %M/%MW tags; mirror unlocated DFB internals to %MW first)

Related MCP server: TwinCat-MCP

Requirements

  • Windows with EcoStruxure Control Expert (or Unity Pro) installed and licensed — tested against Control Expert 14.0, but any version that registers PSBroker.PServerBroker.1 should work (the UDE automation server ships with Control Expert itself; the separate UDE package is only needed for documentation)

  • Python 3.10+ with pywin32

  • The server must run on the same machine as Control Expert (DCOM remoting is possible but not configured here)

Install

cd control-expert-mcp
python -m venv .venv
.venv\Scripts\pip install -e .

Hook up an AI client

The server speaks MCP over stdio. Point your client at the venv's Python:

Claude Desktop

%APPDATA%\Claude\claude_desktop_config.json (see samples/claude_desktop_config.json):

{
  "mcpServers": {
    "control-expert": {
      "command": "C:\\path\\to\\control-expert-mcp\\.venv\\Scripts\\python.exe",
      "args": ["-m", "control_expert_mcp"]
    }
  }
}

Claude Code

claude mcp add control-expert -- C:\path\to\control-expert-mcp\.venv\Scripts\python.exe -m control_expert_mcp

VS Code (GitHub Copilot agent mode)

.vscode/mcp.json (see samples/vscode-mcp.json):

{
  "servers": {
    "control-expert": {
      "type": "stdio",
      "command": "C:\\path\\to\\control-expert-mcp\\.venv\\Scripts\\python.exe",
      "args": ["-m", "control_expert_mcp"]
    }
  }
}

Tools

Tool

Purpose

get_status

Server version, open project, CPU, build state

open_project

Open .stu / .sta / .xef / .zef

new_project

Create a project for a CPU (e.g. BMX P34 2020 + 02.70)

save_project / close_project

Persist / close (close discards unless save=true)

build_project / analyze_project

Build or analyze; returns resulting build state

get_project_structure

Tasks, sections (+language), events, fct modules

list_variables

Variables with type/comment/address/initial value

create_variable / update_variable / delete_variable

Variable editing

read_section

Section logic as Control Expert XML

write_st_logic

Write ST logic as plain IEC text (no XML) — creates or replaces a section, with inline variable declarations

get_language_reference

Authoring guide + validated example for ST/LD/FBD/SFC/IL — the exchange-XML structure rules an AI client needs to write graphical logic (FBD pin-geometry rule, LD line/cell model, SFC chart layout)

validate_xml

Pre-validate candidate exchange-XML against the installed SrcXmlSchema XSDs before import/build — instant structural errors with the legal value sets

place_fb_in_ladder

Drop any project DFB into Ladder, no template — reads the DFB interface and generates the correct (CE-owned) pin geometry automatically, then bind pins

use_fb_in_ladder

Clone a GUI-authored block-in-LD template and rebind instance + variables (fallback for elementary EFBs / exact GUI geometry)

create_section / delete_section

Section management (ST/LD/FBD/SFC/IL)

create_task

Add MAST/FAST/AUX/SAFE task

import_xml

The main write path — import section logic, variables, DFB/DDT types, configuration, or whole-project exchange files (inline XML or file)

export_xml

Export variables / program / configuration / one DFB / one section as XML

export_project

Full application export to .xef / .zef

list_data_types

DFB + DDT types

get_hardware

CPU + bus → drop → rack → module tree

add_io_module / remove_io_module

Add/remove rack modules by part number + catalog version (e.g. BMX DDI 1602 + 02.00)

add_drop / add_rack

Build out remote drops/racks (e.g. an X80 EIO drop + BME XBP 1200 rack on an M580 RIO bus)

change_cpu

Swap the CPU reference

list_animation_tables / create_animation_table / delete_animation_table

Watch/animation tables (accepts hierarchical paths like Pump1.Speed, SFC_Demo.S_Init.x) for monitoring/forcing values online

list_dtms

DTM Browser topology with names, types, addresses

add_dtm / delete_dtm

Add communication DTMs or slave devices (e.g. Modbus Device under the M580 CPU DTM)

set_dtm_address

Set a slave's IP / bus address (+ optional gateway/subnet — fixes the "IP Address and Gateway address are not in the same domain" build warning)

configure_cpu_ethernet

M580 CPU embedded Ethernet: IP/subnet/gateway + Security-screen services (tftp/eip/dhcp_bootp/ftp/web/snmp). Enabling tftp+eip+dhcp_bootp clears the remote-EIO CRA build error

get_dtm_control_parameters / set_dtm_control_parameters

Modbus TCP I/O scanner config XML (CetControlParameter* schema): IP, unit id, timeouts, ModbusTcpRequest scan lines

get_dtm_dataset / set_dtm_dataset

A slave DTM's own dataset (identity + bus address)

get_master_dtm_dataset / set_master_dtm_dataset

The master/CPU DTM dataset (via ZEF round-trip) — <SlaveDevices>/<ManagedModbusRequestList> holds the Modbus scan lines; write a ManagedModbusRequest node to add a request

list_networks / add_network / set_network_ip

Logical networks on Premium/Quantum

show_ui

Make the Control Expert window visible (read-only by default so it can follow along / open editors while the client keeps write)

open_animation_table

Open an animation table's editor in the live CE window so a human watches values animate during a test

plc_* (opt-in)

Online: setup/connect/disconnect/state/transfer/run/stop

modbus_connect / modbus_disconnect / modbus_status (opt-in)

Open/close a Modbus TCP link to the CPU/simulator's server (127.0.0.1:502 for the sim) for live values

read_tags / write_tags (opt-in)

Read/write LIVE located-tag values (%M/%MW) by name or address (%MW86, %MW2:REAL); the only live read/write path (COM API has none)

How the AI writes logic

Program sections are exchanged as Control Expert XML. An ST section looks like:

<STExchangeFile>
  <fileHeader company="Schneider Automation" product="Control Expert V14.0 - 190112"
              dateTime="date_and_time#2026-6-11-1:0:0" content="Structured source file"
              DTDVersion="41"></fileHeader>
  <contentHeader name="Project" version="0.0.000"></contentHeader>
  <program>
    <identProgram name="Logic01" type="section" task="MAST"></identProgram>
    <STSource>
IF StartButton AND NOT StopButton THEN
    MotorRun := TRUE;
ELSE
    MotorRun := FALSE;
END_IF;
    </STSource>
  </program>
</STExchangeFile>

import_xml(kind="section", xml_content=...) creates the section if it doesn't exist, or deletes-and-replaces it on conflict. The agent should declare referenced variables first (create_variable) or include a <dataBlock>, then build_project to validate.

Online tools (live PLC / simulator) — disabled by default

Tools that touch a controller (plc_connect, plc_transfer, plc_command, ...) are not registered unless you set the environment variable:

CE_MCP_ENABLE_ONLINE=1

Starting/stopping a PLC or downloading an application affects the physical process. Only enable this on test benches or with the simulator, and keep a human in the loop.

Simulator commissioning (validated end to end): launch the PLC simulator first — start_simulator or PLC_Simulator\sim.exe from the Control Expert install (it sits in the tray) — then plc_setup_connection("simulator", "127.0.0.1") → plc_connect("simulator") → plc_transfer("pc_to_plc") → plc_command("run"). The project must build clean (built_ok) before download. plc_state reports connection + run/stop and whether PC == PLC.

Known limitation: a freshly started simulator with no station loaded (plc_state = no_conf) rejects plc_transfer with "Family check failed" — the API download (unlike the Control Expert GUI's) requires the sim to already have a station of a matching family. Seed it once by transferring any project from the Control Expert GUI (PLC → Simulation Mode → Connect → Transfer); the loaded station persists while sim.exe runs, and all API downloads work from then on (stop the PLC first — transfer to a running PLC fails).

Live values over Modbus TCP (validated end to end)

The UDE/COM automation API serves the project database — it has no live tag-value read/write (animation tables only render in the GUI; IVariable exposes only the offline initial value). Live values go over the CPU's Modbus TCP server instead — the same channel SCADA/Vijeo use:

modbus_connect(host="127.0.0.1")          # the sim's Modbus server; or a real CPU IP, port 502
read_tags("EMFM1FLOW, RESIDUAL2CLTHSP, %MW0, %MW2:REAL")
write_tags({"RESIDUAL2CLTHSP": 4.0, "%MX100.0": true})
  • Tags are global variable names (address + IEC type resolved from the project) or explicit addresses with optional :TYPE (%MW86, %MW2:REAL, %MW70:UDINT, %M3, %MW10.2 bit). Decoding is type-driven (INT/UINT, DINT/UDINT, REAL, BOOL coil/word-bit).

  • Only LOCATED %M/%MW tags are reachable. Unlocated DFB internals (e.g. Pump1.Running) must be mirrored to %MW/%M in the program first (see the test_logic_live prompt).

  • 32-bit REAL/DINT use Schneider low-word-first order by default; pass word_order="high_first" if a server differs.

  • The Control Expert simulator exposes a Modbus server on 127.0.0.1:502, so the whole read/write test loop works against the sim — no hardware required.

Prompts (guided workflows)

The server ships MCP prompts (src/control_expert_mcp/prompts.py) — reusable recipes that encode the validated flows and their non-obvious gotchas so a client doesn't rediscover them by trial and error. In Claude Code they appear as /mcp__control-expert__<name> slash commands; other MCP clients list them in their prompt picker.

Prompt

What it walks you through

commission_simulator

Build → start sim → connect → transfer → run, incl. the manual first-transfer / "Family check failed" seed step

test_logic_live

The Modbus test loop for a DFB instance, incl. mirroring unlocated internals to %MW and word-order gotcha

author_logic

The get_language_reference → write/import → build_project → fix-from-output loop (per language)

scaffold_project

new_project (exact CPU+version) → rack/PSU/IO → build → save

add_modbus_device

Add a Modbus-TCP slave DTM under the M580 CPU and configure a scan line

Extending the server

When you add a tool or capability, also add (or extend) an MCP prompt in prompts.py that walks a client through using it. This is a project convention, not an afterthought: a good prompt turns an hour of trial-and-error into one slash command.

Write a prompt for anything a client cannot guess from the tool description alone — an environment flag (CE_MCP_ENABLE_ONLINE), a manual GUI step (the simulator family-check seed), an ordering constraint (stop the PLC before transfer), or an addressing rule (located-only Modbus, low-word-first REALs). Rules of thumb:

  • Each new workflow → a prompt; each new tool → at least a mention in a relevant prompt.

  • Put the gotcha in the prompt text explicitly (the steps that cost you time while building it).

  • Mirror the validated sequence (tool names + argument shapes), and reference related prompts by name.

  • Keep the standing orientation in the server instructions string short; put step-by-step recipes in prompts.

Troubleshooting

  • Catalog object not found on new_project — the CPU part number/version must exactly match the hardware catalog of your Control Expert version (spacing matters: BMX P34 2020, firmware like 02.70 is required).

  • application object reference is not found in the catalog on add_io_module — same rule for modules: the catalog version is mandatory (02.00 for most M340 IO modules, 01.00 for racks/power supplies).

  • new_project fails with a bare Exception occurred for a CPU family — your Control Expert license/DTM library probably doesn't include that platform. The error carries no description; test the same CPU in the Control Expert GUI to confirm.

  • add_dtm says "protocol Id parameter is empty or invalid" / "Impossible to create a new DTM object" — slave DTMs need the FDT protocol name as protocol_id (Modbus for the generic Modbus TCP device; the server auto-tries Modbus and EtherNet/IP when empty) and a device_type_name that exactly matches the DTM catalog (Modbus Device). List the catalog names with tools/list_dtm_catalog.py.

  • set_master_dtm_dataset crashes the server (RPC failed) — almost always malformed request XML; in particular requestUniqueID must be a fresh GUID, not an integer. Mirror the validated template in the tool description exactly.

  • Write access mode is already reserved by another client — Control Expert (the GUI) or another automation client has the project open for writing. Close it there first. The server holds one write token per session by design.

  • Broker creation fails — Control Expert isn't installed, or its COM registration is broken (re-register by repairing the installation).

  • First call is slow — open_project/new_project start the Unity server process and can take 30–120 s for large projects. Configure generous tool timeouts in your client.

  • Import fails with Invalid file — the XML doesn't match the exchange schema. Export a similar object first (read_section, export_xml) and mirror its structure, including fileHeader/contentHeader.

Architecture notes

  • All COM calls run on a single dedicated STA worker thread (COM apartment affinity); MCP tool calls are marshalled onto it (the dispatcher is reentrant — nested bridge calls on the worker thread execute directly).

  • Hardware and DTM objects expose their members on secondary dual interfaces (IProject3, IConfiguration2, IBus, IModule, IPServerDtm*, ...) that the default dispinterface doesn't include. The bridge QIs each object with IIDs harvested from HKCR\Interface and wraps the result as IDispatch (_qi), which is the only way to reach DTMRoot, InternalBuses, AddChild, etc. from late-bound clients.

  • The write-access token (app.Project(1)) is acquired once per session and cached; failed-call tracebacks are stripped so they can't pin COM references and deadlock ProjectClose.

  • Project is a parameterized COM property — it is invoked with explicit DISPATCH_PROPERTYGET flags because pywin32 dynamic dispatch can't call it.

  • Import temp files get the extension matching the XML root element (STExchangeFile → .xst, VariablesExchangeFile → .xsy, ...) because Control Expert picks the parser from the extension.

  • Enum constants (languages, export options, PLC commands...) were extracted from PServer.tlb — see src/control_expert_mcp/constants.py.

Disclaimer

Not affiliated with Schneider Electric. The UDE automation interface is provided by Schneider "as is" and is no longer commercialized; this project drives it at your own risk. Never point online tools at production equipment without qualified supervision.

Available Tools

52 tools
add_dropA

Add a drop to a bus — e.g. a remote X80 EIO drop on the EIO/RIO bus of an M580 ('M580 Drop for Ethernet'). bus is a substring of the bus name from get_hardware (e.g. 'EIO'); drop is the drop topo number. Then use add_rack and add_io_module to populate it (remote racks need their own power supply).

Inputs: bus (required), drop (required), part_number (required), version.

add_dtmA

Add a DTM to the project topology.

Top-level communication DTM: leave parent_dtm empty (e.g. on M580 the CPU DTM 'BMEP58_ECPU_EXT' usually exists already). Slave device under a master DTM: set parent_dtm to the master's name and device_type_name to the catalog entry — e.g. add a generic Modbus TCP slave with device_type_name='Modbus Device' under the M580 CPU DTM. After adding, set its IP with set_dtm_address and configure scan requests with get/set_dtm_dataset or set_dtm_control_parameters.

Inputs: device_type_name (required), dtm_name (required), parent_dtm, protocol_id, +2 more.

add_io_moduleA

Add a hardware module (IO, communication, ...) to a rack slot.

part_number and version must exactly match the hardware catalog for the PLC family, e.g. 'BMX DDI 1602' (16x DI), 'BMX DDO 1602' (16x DO), 'BMX AMI 0410' (4x AI), 'BMX NOE 0100' (Ethernet) — version '02.00' fits most M340 IO modules ('01.00' for some; try both). slot is the rack position (the CPU usually occupies slot 0). rack/drop/bus default to the local rack on the local bus; use get_hardware to see the topology.

Inputs: part_number (required), slot (required), version, rack, +2 more.

add_networkA

Create a logical network (Premium/Quantum platforms; family e.g. 'Ethernet'). On M340/M580, configure communication on modules/DTMs instead.

Inputs: name (required), family (required).

add_rackA

Add a rack to a drop (e.g. 'BME XBP 1200' in a remote EIO drop). Then add a power supply and modules with add_io_module (set drop/bus to target the remote rack; remote drops start with a CRA adapter in slot 0).

Inputs: bus (required), drop (required), rack (required), part_number (required), +1 more.

analyze_projectA

Run a syntax/semantic analysis of the project without generating code. Faster than a build; use it to validate edits.

Inputs: no named parameters.

build_projectA

Build the project (incremental by default, full rebuild with rebuild_all=True). Returns the resulting build state and, when available, the Control Expert output window text with errors/warnings. A successful build is required before transferring to a PLC or simulator.

Inputs: rebuild_all.

change_cpuB

Replace the project's CPU with another from the hardware catalog (e.g. 'BMX P34 2020' + '02.70').

Inputs: part_number (required), version (required).

close_projectA

Close the open project, optionally saving first. Unsaved changes are discarded when save=False.

Inputs: save.

configure_cpu_ethernetA

Configure the M580 CPU's embedded Ethernet: main IP/subnet/gateway (+ ip_a/ip_b for the HSBY A/B addresses and ip_d for address D) and the Security-screen service flags.

Service args: -1 = leave unchanged, 0 = disable, 1 = enable. A remote EIO drop's CRA requires tftp, eip and dhcp_bootp ENABLED, otherwise the build fails with "CRA doesn't work when TFTP, EIP and DHCP_BOOTP settings are disabled". Updates every stored copy (application channel config words, DTM binary parameter container, DTM dataset XML) via a project-archive round-trip, so the project is reloaded and UNSAVED — build_project to validate, then save_project. For a slave device's gateway-domain warning use set_dtm_address(gateway=...) instead.

Inputs: ip, subnet, gateway, ip_a, +8 more.

create_animation_tableA

Create an animation table (or add to an existing one) and fill it with variables to watch. variables is a comma-separated list of variable names, e.g. 'Motor, StartPB, UF1_Sequence.S_Service.x, Level'. With the project online (simulator or PLC), the table shows live values in the Control Expert UI.

Inputs: name (required), variables (required).

create_sectionA

Create a new empty program section in a task.

language: ST, LD, FBD, SFC, IL or LL984. To fill it with logic, follow up with import_xml(kind='section') using XML in the shape returned by read_section.

Inputs: task (required), name (required), language.

create_taskA

Add a task to the project. task_type: MAST, FAST, AUX0..AUX3 or SAFE. periodicity_ms > 0 makes the task periodic with that period.

Inputs: task_type (required), periodicity_ms.

create_variableC

Create a global variable.

type_name is an IEC type ('BOOL', 'EBOOL', 'INT', 'DINT', 'REAL', 'TIME', 'STRING', ...), an array ('ARRAY[0..9] OF INT'), a DDT or a DFB type name. address is an optional topological address like '%MW100' or '%Q0.2.0'.

Inputs: name (required), type_name (required), comment, address, +1 more.

delete_animation_tableA

Delete an animation table by name.

Inputs: name (required).

delete_dtmA

Delete a DTM (and its children) from the topology by name.

Inputs: name (required).

delete_sectionC

Delete a program section from a task.

Inputs: task (required), section (required).

delete_variableB

Delete a global variable by name.

Inputs: name (required).

export_projectA

Export the full application to a .xef or .zef XML exchange file — useful for backup, diffing, or migrating between Control Expert versions.

Inputs: path (required).

export_xmlA

Export project content as Control Expert XML and return it inline.

kind: 'variables' (all variables), 'program' (all program logic), 'configuration' (hardware config), 'dfb' (one DFB type, requires name), 'section' (one section, requires task and name). Large exports are written to a temp file and the path is returned instead.

Inputs: kind (required), task, name.

get_dtm_control_parametersC

Read a master/communication DTM's control parameters as XML (CetControlParameterOutput schema): Modbus TCP I/O scanner lines with IP, unit id, timeouts, repetitive rate, and the ModbusTcpRequest entries (read/write start addresses and sizes).

Inputs: name (required).

get_dtm_datasetA

Export a DTM's full configuration dataset. For M580 master DTMs this is the XML dataset whose / nodes hold the Modbus scan lines (request read/write addresses, lengths, connection numbers, IO item names) — edit it and write back with set_dtm_dataset.

Inputs: name (required).

get_hardwareA

List the full hardware configuration: CPU plus the bus → drop → rack → module tree with part numbers, versions and topological addresses.

Inputs: no named parameters.

get_language_referenceA

REQUIRED READING before writing any program logic: the authoring guide for a Control Expert language ('ST', 'LD', 'FBD', 'SFC', 'IL').

Returns the exchange-XML structure rules (validated against a live Control Expert build) and a complete example section that imports and builds with 0 errors — mirror its shapes exactly. Workflow: read this guide -> write the section XML -> import_xml(kind='section') -> build_project -> fix any errors listed in the build output -> repeat. For ST, prefer the write_st_logic tool (no XML needed).

Inputs: language (required).

get_master_dtm_datasetA

Read the master/CPU DTM dataset XML — THE document holding the Modbus TCP scan lines (M580 DTMs XML Dataset spec).

Each scanned device is a under ; its holds one per scan line with Parameters attributes requestSettingBit (connection number), requestSettingRDAddress/RDLength, requestSettingWRAddress/WRLength, requestInputObjID/requestOutputObjID. dtm defaults to the first (CPU) DTM node.

Inputs: dtm.

get_project_settingA

Read a project setting value by its identifier (e.g. 'unity.multiAssign', 'unity.nestedComment', 'unity.RemanentLink'). Idents appear as in an exported .xef.

Inputs: ident (required).

get_project_structureA

List the program structure: tasks (MAST, FAST, ...) with their scan settings and the sections in each task (name + IEC language), plus counts of events and functional modules.

Inputs: no named parameters.

get_statusA

Get the current session status: Control Expert server version, whether a project is open, its file path, CPU, version and build state.

Inputs: no named parameters.

import_xmlA

Import Control Expert XML into the open project — the main way to write program logic and bulk content.

kind: 'section' (program logic, requires task), 'variables', 'dfb', 'ddt', 'configuration', or 'project' (generic project-level import of an exchange file). Provide the XML either inline via xml_content or as file_path. import_mode: 'overwrite' (default), 'keep_existing' or 'rename'.

Tip: export an existing object first (read_section / export_xml) and use its XML as the structural template — Control Expert validates the schema strictly.

Inputs: kind (required), xml_content, file_path, task, +1 more.

list_animation_tablesA

List the project's animation tables (watch tables used to monitor and force variable values online).

Inputs: no named parameters.

list_data_typesA

List user data types in the project: DFB types (function blocks) and DDTs (structured/array types) with their versions.

Inputs: no named parameters.

list_dtmsA

List the project's DTM topology (DTM Browser): communication/master DTMs and their slave devices, with names, DTM ids, types, and bus addresses (IP for Modbus TCP / EtherNet/IP devices).

Inputs: no named parameters.

list_networksA

List logical networks (Premium/Quantum: Ethernet, Modbus Plus, Fipway) with their IP service configuration where available.

Inputs: no named parameters.

list_variablesA

List global variables with type, comment, topological address (%MW..., %I..., etc.) and initial value. name_filter does a case-insensitive substring match on the variable name.

Inputs: name_filter, max_results.

new_projectA

Create a new project from scratch for a given PLC CPU.

cpu_part_number must exactly match a CPU reference in the installed Control Expert hardware catalog, e.g. 'BMX P34 2020' (M340), 'BME P58 2040' (M580), 'TSX P57 4634M' (Premium), '140 CPU 651 60' (Quantum). cpu_version is the firmware version offered by the catalog and is required, e.g. '02.70'. The project exists only in memory until save_project is called with a path.

Inputs: cpu_part_number (required), cpu_version (required), project_name.

open_projectA

Open a Control Expert project file.

Supports .stu (native project), .sta (archive), and .xef/.zef (XML exchange format, imported into a fresh application). Any previously open project is closed without saving. Opening can take 30-120 s for large projects.

Inputs: path (required).

read_sectionA

Read the logic of a program section as Control Expert XML. The XML contains the source code (ST text, ladder rungs, FBD networks...) and is the same format accepted by import_xml(kind='section').

Inputs: task (required), section (required).

remove_io_moduleC

Remove the module at a rack slot.

Inputs: slot (required), rack, drop, bus.

replace_io_moduleA

Replace a module in place (keeps the slot) — e.g. swap the default power supply new_project puts on the local rack. Old part number/version must match the current module exactly (see get_hardware).

Inputs: slot (required), old_part_number (required), old_version (required), new_part_number (required), +4 more.

replace_rackB

Replace a rack in place (e.g. the default BME XBP 0800 new_project creates -> BME XBP 0400). Modules on the rack are kept where the new rack has the same slots.

Inputs: rack (required), old_part_number (required), old_version (required), new_part_number (required), +3 more.

save_projectA

Save the open project. Pass path (ending in .stu) on first save or to save a copy under a new name; leave empty to save in place.

Inputs: path.

set_dtm_addressA

Set a slave DTM's bus address — for Modbus TCP / EtherNet/IP devices this is the IP address (e.g. '192.168.10.21'); for fieldbus slaves the node number. Optionally also set the device's gateway and subnet mask (the gateway must be in the same IP domain as the address or the build warns 'IP Address and Gateway address are not in the same domain'). Setting gateway/subnet rewrites the project archive: the project is reloaded and UNSAVED — build_project then save_project afterwards.

Inputs: name (required), address, gateway, subnet.

set_dtm_control_parametersA

Write a master DTM's control parameters (CetControlParameterInput XML) — scanner sizing and %MW mapping of the I/O scan. With build=True the DTM→PLC control information is rebuilt afterwards. Read the current values with get_dtm_control_parameters first and mirror the schema.

Inputs: name (required), xml (required), build.

set_dtm_datasetA

Import a slave DTM configuration dataset (previously exported with get_dtm_dataset, possibly modified).

Inputs: name (required), xml (required).

set_master_dtm_datasetA

Write back a modified master DTM dataset (adds/edits Modbus scan lines) and reload the project from the modified exchange archive.

To add a Modbus scan request, insert into the target SlaveDevice's a node shaped exactly like this (validated):

Rules (M580 CPU scanner): Index increments per request within the device starting at 0; requestSettingBit is the connection number (Modbus range 1-128, unique across the scanner); requestUniqueID must be a fresh GUID; requestInput/OutputObjID use an even/odd pair (n, n+1) from 1024-1279 per connection, 65535 for an unused direction; RD/WR address+length are in words (slave-index format, 0-based). After this call the project is reloaded and UNSAVED — run build_project to validate (the scan line then appears in get_dtm_control_parameters), then save_project.

Inputs: xml (required), dtm.

set_network_ipC

Set the static IP configuration of a logical Ethernet network.

Inputs: name (required), ip_address (required), subnet_mask (required), gateway (required).

set_project_settingsA

Set one or more project settings (build/language options). Common idents: 'unity.multiAssign'='1' allows chained assignments a:=b:=c (error E1203 if disabled), 'unity.nestedComment', 'unity.paramNotAssign', 'unity.emptyParaAllowed'. Values are strings ('0'/'1' for booleans). The project is reloaded from a patched archive and UNSAVED — build_project then save_project afterwards.

Inputs: settings (required).

show_uiA

Make the Control Expert window of this automation session visible so a human can watch or take over. state: show_normal, show_maximized, minimize, restore.

Inputs: state.

start_simulatorA

Start the Control Expert PLC simulator (sim.exe) so plc_connect can reach it. With enforce_security=False (default) the simulator's 'use default application (enforce security)' option is disabled in the registry first — otherwise sim.exe blocks on a warning dialog unless a password-protected default application is configured. Only use on a local test machine.

Inputs: enforce_security.

stop_simulatorB

Stop the PLC simulator process.

Inputs: no named parameters.

update_variableB

Update attributes of an existing variable. Only the non-empty arguments are applied. To clear an attribute, pass a single space.

Inputs: name (required), new_name, comment, address, +1 more.

write_st_logicA

Write a program section in plain IEC 61131-3 Structured Text — no XML required. Creates the section or replaces its logic if it exists.

st_source is raw ST (IF/CASE/FOR, FB calls like 'T1(IN := x, PT := t#3s, Q => y);', set()/reset() on EBOOLs, re()/fe() edges). declare optionally declares variables as a comma-separated 'name:TYPE' list, e.g. 'StartPB:BOOL, Delay1:TON, Level:REAL' — FB instances called in the code (TON/TOF/CTU/DFB types) must exist or be declared here. Run build_project afterwards and fix any errors from its output.

Inputs: task (required), section (required), st_source (required), declare.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 52 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes, with descriptions that specify their exact scope. A few pairs like get_dtm_dataset/get_master_dtm_dataset and set_dtm_dataset/set_master_dtm_dataset could cause confusion, but descriptions clarify the distinction.

    Naming Consistency4/5

    Tool names predominantly follow a verb_noun snake_case pattern (e.g., add_drop, create_section, list_variables). A few names like configure_cpu_ethernet are longer, and some use different verb prefixes (e.g., new_project, change_cpu), but overall the pattern is consistent.

    Tool Count3/5

    52 tools is high for a single server, but the domain of PLC configuration and programming is complex, justifying many tools. The number is borderline; some tools could be consolidated (e.g., multiple DTM-related tools), but the granularity aids clarity.

    Completeness5/5

    The tool set covers the full project lifecycle, hardware configuration, programming, variable management, simulation, and settings. All major operations are present, and there are no obvious gaps for the intended domain.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      C
      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.
      60
      -
    • A
      license
      B
      quality
      C
      maintenance
      Universal MCP server for industrial PLC communication, enabling AI agents to read sensors, alarms, status, setpoints, and write setpoints via adapters for Modbus, S7, or custom PLCs.
      6
      MIT