Control Expert MCP Server
English · Italiano
Connect an MCP client to a local EcoStruxure Control Expert (Unity Pro) installation. Inspect, create, edit, and build PLC projects through Schneider Electric's UDE COM automation API.
The foundation is Control Expert's Unity Developer Edition (UDE) interface: this server exposes its project engineering operations to MCP clients. Schneider Electric's public Control Expert V16 documentation identifies UDE as the API for automating engineering tasks; the detailed API reference is installed locally in Control Expert's Extra folder.
This is an experimental project for LLM-assisted PLC programming and debugging.
PyPI · Detailed guide · Benchmarks
Features
- Projects: create, open, save, import, and export Control Expert projects.
- Logic: inspect and edit ST, LD, FBD, SFC, and IL; manage variables, DFBs, and DDTs.
- Hardware and communications: configure CPUs, racks, modules, DTMs, Ethernet services, and Modbus scan requests.
- Validation: validate exchange XML, analyze and build projects, and inspect diagnostics.
- Documentation: search locally converted vendor manuals with source citations.
- Live access (opt-in): use OFS OPC DA for symbolic values or Modbus TCP for located values; commission and test with PLC Simulator.
Availability depends on the installed Control Expert version, license, hardware catalog, and DTM libraries. Clients expose the tools' argument schemas and descriptions; see the tool reference and guided workflows.
Requirements
- Windows with Python 3.11+.
- A licensed local installation of Control Expert or Unity Pro and its registered UDE COM broker (
PSBroker.PServerBroker.1). Tested with Control Expert 14.0 and 16.4. - An MCP client supporting stdio, such as Claude Desktop, Claude Code, VS Code with GitHub Copilot, Codex, or DeepSeek Harness.
Run the server on the same machine as Control Expert. The UDE automation server is included with Control Expert; the separate UDE package is needed only for its documentation.
Quick start
Install on the Windows machine running Control Expert:
py -3.11 -m pip install --upgrade control-expert-mcp
Configure your MCP client to launch control-expert-mcp with no arguments. For clients using mcpServers JSON, such as Claude Desktop:
{
"mcpServers": {
"control-expert": {
"command": "control-expert-mcp",
"args": [],
"env": {
"CE_MCP_ENABLE_ONLINE": "0"
}
}
}
}
For Codex CLI:
codex mcp add control-expert --env CE_MCP_ENABLE_ONLINE=0 -- control-expert-mcp
The client starts and manages the server. If it cannot find the command, use the executable's absolute path, or the installing Python interpreter with arguments ["-m", "control_expert_mcp"].
See the client configuration guide for Claude Desktop, Claude Code, VS Code, Codex, and DeepSeek Harness. Ready-to-edit examples are in samples/.
Usage
Start with a disposable project or a copy. Example requests:
- “Open this project and summarize its CPU, tasks, sections, and global variables.”
- “Create an ST section for a motor interlock, declare its variables, and build the project.”
- “Inspect the hardware tree and list the configured Modbus devices.”
- “Search the local manuals for
READ_VARand cite the relevant topic.”
Build after changes, inspect the result, and save explicitly. Imports can replace existing sections; close_project discards changes unless save=true. Opening a .sta archive creates an unsaved application: save it to an explicit .stu path.
A successful build does not prove runtime correctness. Check build_state, errors, and raw output alongside parsed diagnostics. For runtime tests, observe outputs against expected results and restore test inputs. See authoring and build results.
Configuration
Set these variables in the MCP client's server environment:
| Variable | Purpose |
|---|---|
CE_MCP_ENABLE_ONLINE |
Set to 1 and restart to expose online tools. Disabled by default; session consent is still required. |
CE_MCP_OPC_PYTHON |
Python matching the OPC Automation DLL bitness, with pywin32 installed. OFS commonly needs a separate 32-bit interpreter. |
CE_MCP_SCHEMA_DIR |
Override the auto-discovered Control Expert SrcXmlSchema directory. |
CE_MCP_MANUALS_DIR |
Converted and indexed local manuals. Set an absolute path for packaged installations. |
CE_MCP_SIMULATOR_EXE |
Optional simulator executable override for custom installation paths or startup without an open project. |
PLC and simulator access
Enabling online tools does not grant access to a controller. Use get_live_access_setup and configure_live_access to record the user's choices for each server session. Confirm OFS availability and the device alias for OPC; obtain separate approval for closed-loop writes and PLC control.
Prefer OFS OPC DA for simulator tests and symbolic variables, including exposed unlocated variables and DFB members. The running application's data dictionary must expose the required symbols. Modbus TCP supports located %M / %MW values.
Follow the live-access and commissioning guide for setup, dictionary settings, download steps, and the conditional “Family check failed” workaround.
Local manuals
Manual search works without a COM session or PLC connection. Convert your locally installed help and build its index first; generated vendor content stays local. See manual conversion and search.
Troubleshooting
- COM startup fails: check licensing and UDE registration. If the broker reports an integrity error, restart it after checking the Windows
CommonProgramFilesenvironment paths. - CPU or module not found: use the exact reference and version from the installed catalog.
- First call times out: project loading can take 30–120 seconds; increase the client's tool timeout.
- XML import fails: export a similar object and run
validate_xmlbefore importing.
More cases are in the troubleshooting guide. Report reproducible problems in GitHub Issues, with versions, tool calls, and sanitized errors.
Benchmarks
The dedicated ce-bench iec suite covers native ST, LD, FBD, SFC and IL logic
on disposable M580 demo copies. It adds deterministic in-MAST capture, percentage
correctness, strict verdicts and PNG/SVG progress overviews. See the
IEC benchmark guide and
example configuration.
The offline suite covers seven tasks: project inspection, threshold and temperature
logic changes, fault repair, gated hysteresis alarms, weighing analysis, and I/O
mapping. Each task runs on a disposable project copy in two conditions: without
and with installed-manual search. Edits are independently reopened and built;
inspection answers use deterministic grading, including a fixed Markdown table
format for I/O mappings. A separate M580 simulator test checks that TEST_LLM
increments once per second through OFS OPC DA observations.
Results are exploratory; offline acceptance does not establish PLC runtime correctness. See the benchmark guide for test definitions, scoring, setup, and limitations, and the archived results for individual run reports.
Development
git clone https://github.com/PBrunot/control-expert-mcp.git
cd control-expert-mcp
py -3.11 -m venv .venv
.venv\Scripts\python.exe -m pip install -e ".[benchmark,test]"
.venv\Scripts\python.exe -m compileall -q src
.venv\Scripts\python.exe -m unittest discover -s tools -p "test_*.py"
For a source installation, point the MCP client to the absolute .venv\Scripts\python.exe path with arguments ["-m", "control_expert_mcp"].
See AGENTS.md for repository conventions, the development guide for architecture and integration checks, and packaging and releases for distribution commands. Review integration scripts before running them: they can modify projects or terminate Control Expert.
License and credits
This repository is a fork of apexsotjo-blip/control-expert-mcp, with additional work by Pascal Brunot. The upstream repository did not include a license file, so the MIT license in this fork applies to Pascal Brunot's contributions and does not relicense upstream contributions or third-party materials. See LICENSE and the upstream repository history for provenance. This project is also inspired by tiaportal-mcp.
Not affiliated with or endorsed by Schneider Electric. Control Expert and Unity Pro software, licenses, and documentation are supplied separately.
Metadata
Release files for control-expert-mcp 0.9.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| control_expert_mcp-0.9.4.tar.gz | 274.1 kB | With provenance | Details for control_expert_mcp-0.9.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| control_expert_mcp-0.9.4-py3-none-any.whl | Python 3 | none | any | Details for control_expert_mcp-0.9.4-py3-none-any.whl |
Total release size: 471.1 kB
Release files / control_expert_mcp-0.9.4.tar.gz
| Download URL | control_expert_mcp-0.9.4.tar.gz |
|---|---|
| Size | 274.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4a401690e26e752d4ad0ad0c3a491203283c9823795d524e69ccfa650b23ed59
|
|
BLAKE2b-256 checksum How to use checksums |
c0f67ca7ea11f18982f43cc20dccd988e09326287e0ca8d38c36a03622c54b74
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.
Transparency logRelease files / control_expert_mcp-0.9.4-py3-none-any.whl
| Download URL | control_expert_mcp-0.9.4-py3-none-any.whl |
|---|---|
| Size | 197.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
40d6cf3c1fde9039215545ad67802e67b366ffae162b94938664a05d62c37190
|
|
BLAKE2b-256 checksum How to use checksums |
3b0d23082673dd0ed044b9adcc2c3e8ce3365c190a78d08b89d733835e1fb2f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.
Transparency logSecurity for control-expert-mcp 0.9.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for control_expert_mcp-0.9.4.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.