L5X MCP
l5x-mcp is a Python MCP server that gives a coding agent (Claude Code, VS Code Chat, etc.) structured access to Rockwell Studio 5000 Logix Designer projects exported as .L5X files. The agent can explore tasks, programs, routines, tags, UDTs, AOIs and I/O modules, read logic, and find cross-references without reading the large raw XML files.
It can also edit projects and create Import Component files (UDTs, AOIs, programs, routines, rungs, tags). Edits never modify the source project: every change is written to a new .L5X file that you open or import in Studio 5000.
Routines in all four languages are supported: ladder (RLL), structured text (ST), function block diagram (FBD) and sequential function chart (SFC).
Quick Start
uv is the recommended way to install and run l5x-mcp. uvx downloads and caches the package, so nothing needs to be installed in a specific folder or environment.
uvx l5x-mcp --help
The server is normally started by your MCP client (see Register the MCP Server). It looks for .L5X files in the folder it is started in, so with Claude Code, start claude in the folder that holds your exports.
Install as a Tool with UV (optional)
uv can also install l5x-mcp as a tool. This puts l5x-mcp on your PATH.
uv tool install l5x-mcp
Upgrade later with uv tool upgrade l5x-mcp.
Register the MCP Server
Claude Code
-s user registers the server for all your projects. Leave it out to add it to the current project only.
claude mcp add -s user l5x -- uvx l5x-mcp
If you installed it with uv tool install, replace uvx l5x-mcp with l5x-mcp. Server options go after the command and environment variables in -e options before --, for example:
claude mcp add -s user l5x -e L5X_MCP_READ_ONLY=1 -- uvx l5x-mcp
Other MCP clients
Other clients (e.g. VS Code .vscode/mcp.json) need the same command and arguments. Set L5X_MCP_ROOT (or --root) when the client does not start the server in your project folder.
{
"servers": {
"l5x": {
"type": "stdio",
"command": "uvx",
"args": ["l5x-mcp"],
"env": { "L5X_MCP_ROOT": "/path/to/exports" }
}
}
}
With uv tool install, use "command": "l5x-mcp" and no args.
Configuration
| Env var | CLI flag | Meaning |
|---|---|---|
L5X_MCP_ROOT |
--root |
Folder searched (recursively) for .L5X files. Default: the current working directory. |
L5X_MCP_OUTPUT_DIR |
--output-dir |
Where write tools put output given as a bare file name, relative to the root. Default: l5x-mcp-output. |
L5X_MCP_READ_ONLY |
--read-only |
Register only the read tools. Write tools are enabled by default. |
L5X_MCP_STRUCTURED_OUTPUT |
--structured-output |
Also return MCP structuredContent and output schemas. Results are always returned as compact JSON text. |
Flags take precedence over environment variables. Boolean variables accept 1, true, yes or on. Restart the server after changing its configuration.
Finding .L5X files
.L5Xfiles are found anywhere under the root. Hidden folders,node_modules,__pycache__andvenvare skipped.- When exactly one project is found it is used automatically. Otherwise every tool takes a
path(absolute or relative to the root). - Files are re-read when they change on disk, so saving (and re-exporting) the project in Studio 5000 is picked up without a restart.
- Files in the output folder are skipped when picking the default project, so edits don't hide the source.
Tools
Read tools
| Tool | Description |
|---|---|
list_l5x_files |
List the .L5X files under the root. |
project_overview |
Summarize the controller, tasks, programs, AOIs, UDTs and modules. |
list_tasks / get_task |
Tasks with type, rate, priority, watchdog and scheduled programs. |
list_programs / get_program |
Programs with main routine, flags, routines and tags. |
list_routines |
Routines of a program or AOI, with their language and size. |
get_routine_logic |
Rungs, ST lines, or a text rendering of FBD/SFC diagrams, with a description of every operand. Paged to fit a size budget. |
list_tags / get_tag |
Controller, program and module I/O tags. get_tag resolves operand paths such as Tag.Member[3].1 or Local:1:I.Pt00.Data. |
list_data_types / get_data_type |
UDTs, their members and where they are used. |
list_aois / get_aoi |
Add-On Instructions with parameters, local tags, instances and (optionally) logic. |
list_modules / get_module |
The I/O tree and module details. |
find_references |
Where a tag, instruction or text is used in program and AOI logic. |
instruction_usage |
How often each instruction is used. |
Write tools
| Tool | Description |
|---|---|
get_spec |
An existing UDT, AOI, program, tag or routine as an editable spec. |
add_tags / remove_tags / rename_tag / set_tag_values / update_tag |
Tags, values, descriptions and operand comments. |
add_routine / remove_routine / rename_routine |
Program routines in any language. |
add_rungs / replace_rung / remove_rungs |
Ladder rungs. |
set_st_lines / set_routine_content |
Replace the code of an ST routine, or the diagram of an FBD/SFC routine. |
add_* / replace_* / rename_* / remove_* for data types, AOIs, programs |
UDTs, AOIs and programs. Replacing migrates existing instances. |
schedule_program / set_description |
Task scheduling and descriptions. |
export_component |
Write existing objects to an Import Component file, with their dependencies. |
create_*_file |
Build a new UDT, AOI, program, routine, rungs or tags as an Import Component file. |
How editing works:
- Every write tool needs an
output_path. The source project is never modified, and existing files are not replaced (except, withoverwrite=true, files the server wrote earlier in the same session). - To make several changes, pass each result's
fileas the next call'spath. - To change a UDT, AOI, program or routine:
get_spec, edit the spec, then call the matchingreplace_*(orset_routine_content) tool. - Renaming or removing tags, routines and programs does not rewrite the logic that uses them; the result lists the remaining
referencesso they can be fixed. - Use instructions that exist in your project's version (v36+ uses
MOVE,EQ, … instead ofMOV,EQU, …). - Source-protected AOIs and routines can be listed and exported but their logic cannot be read or edited.
Development
Install from source
git clone https://github.com/zwood16/l5x-mcp
cd l5x-mcp
uv sync
To use a checkout with Claude Code, register uv run --project /path/to/l5x-mcp --no-sync l5x-mcp. Use --project, not --directory, so the server still starts in your project folder.
Running Tests
This project uses pytest for tests and ruff for linting. Both are dev dependencies:
uv run pytest
uv run ruff check
uv run ruff format
The tests never need Windows or Rockwell software. Generated files are compared byte-for-byte with golden files that were imported and built in Studio 5000 through the Logix Designer SDK; see tools/sdk/README.md to re-run that verification after changing generated output.
Metadata
Release files for l5x-mcp 0.4.0
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 |
|---|---|---|---|---|
| l5x_mcp-0.4.0.tar.gz | 104.8 kB | With provenance | Details for l5x_mcp-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| l5x_mcp-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for l5x_mcp-0.4.0-py3-none-any.whl |
Total release size: 221.8 kB
Release files / l5x_mcp-0.4.0.tar.gz
| Download URL | l5x_mcp-0.4.0.tar.gz |
|---|---|
| Size | 104.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6bf047c39abbb8f52f315b95f9aa9b4ac10aeccc3c5d75c303108947ad092d81
|
|
BLAKE2b-256 checksum How to use checksums |
0999002369a179662099980ec67a741433ac092e2f813cb3668b209bcab1203f
|
| 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 Dec 1, 2026.
Transparency logRelease files / l5x_mcp-0.4.0-py3-none-any.whl
| Download URL | l5x_mcp-0.4.0-py3-none-any.whl |
|---|---|
| Size | 117.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2cd7f035400bde05168794db2e859350a2da851d97c60fb6ff7d9788394753e3
|
|
BLAKE2b-256 checksum How to use checksums |
b7998c50558559c0806d9b61cd224763d2a873f1b839a4f3f0fa36d51089e462
|
| 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 Dec 1, 2026.
Transparency logSecurity for l5x-mcp 0.4.0
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 l5x_mcp-0.4.0.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 Dec 1, 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.