cx-programmer-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cx-programmer-mcp@cx-programmer-mcp Add a rung in Main to set output 100.00 when input 0.00 is ON"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
cx-programmer-mcp
An MCP (Model Context Protocol) server for editing OMRON CX-Programmer ladder logic programs programmatically — without opening the GUI.
Works with .CXP / .CXT files for OMRON CJ/CP/CS series PLCs.
Scope: Programs, Sections, Ladder Mnemonics, rung comments, and symbol table only.
Does not touch PLC Setup, I/O Table, network configuration, passwords, or transfer to PLC.
How it works
OMRON documents .CXP as a compressed version of .CXT. .CXT is a text-based format that CX-Programmer can import/export. This server reads .CXP or .CXT, edits the program in memory, then saves the result as .CXT / .CXP for review in CX-Programmer before deploying to a real PLC.
Uses Python MCP SDK v2 (MCPServer) with stdio transport.
Related MCP server: TwinCAT Validator MCP Server
Requirements
Python >= 3.10
uv package manager
CX-Programmer installed (to open
.cxpoutput and download to PLC)
Installation
cd cx-programmer-mcp
uv sync
uv run cx-programmer-mcpProject Template Setup
Built-in template (CJ2M CPU11)
A native CJ2M CPU11 template is included. Generate a blank project:
uv run python make_template.pyOther PLC models
Each PLC model has a different binary configuration. For models other than CJ2M CPU11:
Open CX-Programmer on your machine
Create a new empty project for your PLC model (CP1L, CS1G, etc.)
Save it as
.CXPor.CXTPlace the file in the
project/folderUpdate
make_template.pyto point to your file:
SRC = Path(__file__).parent / "project" / "your_blank_template.cxp"Run
make_template.pyonce
Example Program
An example ladder program is included: project/example_basic_io.cxp
It demonstrates a simple conveyor/IO controller with:
Manual output control (hold-to-run)
Scheduled auto run via RTC (configurable via DM)
Timer-based duration
SET/RSET latch
Emergency reset
To rebuild it from source:
uv run python make_template.py
uv run python build_program.pyOutput: project/example_basic_io.cxp — open in CX-Programmer to review and download.
Review Program
uv run python review_program.pyMCP Client Configuration
Add to your MCP client config (Claude Desktop, Kiro, Cline, etc.):
{
"mcpServers": {
"cx-programmer": {
"command": "uv",
"args": ["run", "cx-programmer-mcp"],
"cwd": "ABSOLUTE_PATH_TO_THIS_FOLDER"
}
}
}Windows example:
"cwd": "C:\\Users\\yourname\\cx-programmer-mcp"Optional — restrict file access to specific folders:
CX_MCP_ALLOWED_ROOTS=C:\PLC_ProjectsRuntime Schedule Changes
Use CX-Programmer Online Mode → PLC Memory → DM Area:
DM | Function | Default |
| Schedule 1 — hour | 6 |
| Schedule 1 — minute | 0 |
| Schedule 2 — hour | 16 |
| Schedule 2 — minute | 0 |
| Run duration x100ms | 300 (=30s) |
Changes take effect immediately without PLC restart.
Run Tests
uv run pytest -qAvailable MCP Tools
Tool | Description |
| Load a |
| List all programs in the project |
| List sections in a program |
| Get full ladder content of a program |
| Get rungs in a section |
| Replace a rung's instructions |
| Insert a new rung |
| Delete a rung |
| Set a rung comment |
| Batch multiple rung edits atomically |
| Add a new section |
| Rename an existing section |
| Add or update a symbol |
| Clear all symbols in a scope |
| List all symbols |
| Validate XML structure |
| Save as |
| Re-encode and save as |
| List available built-in templates |
| Create a new blank project from template |
| Validate mnemonic instructions |
| Boolean simulation of a rung |
| Analyze rung structure |
| Full program diagnostics |
| Semantic JSON snapshot for AI review |
| Save and open in CX-Programmer (Windows) |
Project Structure
cx-programmer-mcp/
├── src/cx_programmer_mcp/ # MCP server and CXT library
│ ├── server.py # MCP tool definitions
│ ├── cxt.py # CXT/CXP parser and editor
│ ├── ladder.py # Mnemonic compiler and simulator
│ ├── diagnostics.py # Program diagnostics
│ ├── recipes.py # Reusable ladder patterns
│ ├── templates/ # Built-in PLC templates
│ │ └── CJ2M_CPU11.cxt # Native CJ2M CPU11 template
│ └── ...
├── tests/ # Test suite (16 tests)
├── project/ # Output folder
│ └── example_basic_io.cxp # Example ladder program
├── build_program.py # Builds the example ladder program
├── write_build.py # Regenerates build_program.py
├── make_template.py # Generates blank template from base
├── review_program.py # Prints program content to console
└── pyproject.tomlNotes
Always run Program Check in CX-Programmer before downloading to a real PLC.
This tool edits program logic only — I/O table, unit setup, and PLC configuration are preserved as-is from the template.
.CXPoutput is binary-compatible with CX-Programmer 9.73 on CJ2M CPU11.For other PLC models, provide your own blank
.CXPtemplate (see Project Template Setup).
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceA Model Context Protocol server that enables seamless interaction between MCP clients (like Claude Desktop) and CODESYS V3 programming environments, allowing automation of project management, POU creation, code editing, and compilation tasks.131114MIT
- AlicenseBqualityCmaintenanceAn MCP server for validating, auto-fixing, and scaffolding TwinCAT 3 XML files using deterministic code quality tools and IEC 61131-3 OOP checks. It enables AI assistants to perform structural validation, apply safe fixes, and generate canonical code skeletons for industrial automation projects.1633MIT
- FlicenseNot gradedqualityAmaintenanceMCP 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. 16 tools, 166 actions.27
- AlicenseBqualityBmaintenanceMCP server that enables AI agents to read, edit, and create PLC projects in EcoStruxure Control Expert via COM automation.52MIT
Related MCP Connectors
MCP Server for Slima - AI Writing IDE for Novel Authors with AI Beta Reader.
MCP server for generating rough-draft project plans from natural-language prompts.
2,000+ MCP servers read at source level. Know what one does before you connect. Free, no key.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/BlackUppsss/Cx-Proggrammer-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server