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.
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.
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.
Model evaluation is optional and documented in the benchmark guide. Benchmark results are exploratory and do not establish PLC runtime correctness.
License and credits
MIT, as declared in pyproject.toml. Forked from apexsotjo-blip/control-expert-mcp and 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.3
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.3.tar.gz | 215.5 kB | With provenance | Details for control_expert_mcp-0.9.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| control_expert_mcp-0.9.3-py3-none-any.whl | Python 3 | none | any | Details for control_expert_mcp-0.9.3-py3-none-any.whl |
Total release size: 375.9 kB
Release files / control_expert_mcp-0.9.3.tar.gz
| Download URL | control_expert_mcp-0.9.3.tar.gz |
|---|---|
| Size | 215.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c82d31e887c198c8fe1b72812112256122369669611d239694fc2973db5112bc
|
|
BLAKE2b-256 checksum How to use checksums |
1103fab55fbdc375255628c10e8b78c7f1ad868735915f548a01ffd2a02ee45c
|
| 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 23, 2026.
Transparency logRelease files / control_expert_mcp-0.9.3-py3-none-any.whl
| Download URL | control_expert_mcp-0.9.3-py3-none-any.whl |
|---|---|
| Size | 160.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dc64e6ac7c813eefcaff298773d9b350e9eea562240c3096834d2a8ad3dbb816
|
|
BLAKE2b-256 checksum How to use checksums |
be583603dbed67139c2bf9a4ca057223336e678500c39c18fb56bd2954695a24
|
| 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 23, 2026.
Transparency logSecurity for control-expert-mcp 0.9.3
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.3.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 23, 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.