Skip to main content

Control Expert MCP Server

CI Platform: Windows Python: 3.11+

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_VAR and 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 CommonProgramFiles environment 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_xml before 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.

Benchmark overview: acceptance, I/O mapping correctness, time, and token usage

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.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for control-expert-mcp 0.9.5
File Size Uploaded Provenance Actions
control_expert_mcp-0.9.5.tar.gz 285.6 kB With provenance Details for control_expert_mcp-0.9.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for control-expert-mcp 0.9.5
File Interpreter ABI Platform Actions
control_expert_mcp-0.9.5-py3-none-any.whl Python 3 none any Details for control_expert_mcp-0.9.5-py3-none-any.whl

Total release size: 491.9 kB

Release files / control_expert_mcp-0.9.5.tar.gz

Download URL control_expert_mcp-0.9.5.tar.gz
Size 285.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a6e0005b50ea779918c7225f18a68cd2b450e9e45bc069cd8479572044f4474d
BLAKE2b-256 checksum
How to use checksums
82f55191bb798972c389219691a918c6d0dd9d60d591ab746600343b3e2ddc3e
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 27, 2026.

Transparency log

Release files / control_expert_mcp-0.9.5-py3-none-any.whl

Download URL control_expert_mcp-0.9.5-py3-none-any.whl
Size 206.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f74b36fdf7e22becb84129ba48d316a386893f100364c169f74733ec828b4d6
BLAKE2b-256 checksum
How to use checksums
d0878dd445f8706afccbd200f74034aba31b86d39e971ced144fa76d65e041af
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 27, 2026.

Transparency log

Security for control-expert-mcp 0.9.5

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.

Select from 2 files

Attestation for control_expert_mcp-0.9.5.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 27, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page