cx-programmer-mcp
cx-programmer-mcp
OMRON CX-Programmer 래더 로직 프로그램을 GUI를 열지 않고 프로그래밍 방식으로 편집하기 위한 MCP(Model Context Protocol) 서버입니다.
OMRON CJ/CP/CS 시리즈 PLC용 .CXP / .CXT 파일과 함께 작동합니다.
범위: 프로그램, 섹션, 래더 니모닉, 런 주석 및 심볼 테이블만 해당합니다.
PLC 설정, I/O 테이블, 네트워크 구성, 비밀번호 또는 PLC 전송은 다루지 않습니다.
작동 방식
OMRON은 .CXP를 .CXT의 압축 버전으로 문서화합니다. .CXT는 CX-Programmer가 가져오기/내보내기할 수 있는 텍스트 기반 형식입니다. 이 서버는 .CXP 또는 .CXT를 읽고, 메모리에서 프로그램을 편집한 다음, 실제 PLC에 배포하기 전에 CX-Programmer에서 검토할 수 있도록 결과를 .CXT / .CXP로 저장합니다.
Python MCP SDK v2 (MCPServer)와 stdio 전송을 사용합니다.
Related MCP server: TwinCAT Validator MCP Server
요구 사항
Python >= 3.10
uv 패키지 관리자
CX-Programmer 설치 필요 (
.cxp출력을 열고 PLC에 다운로드하려면)
설치
cd cx-programmer-mcp
uv sync
uv run cx-programmer-mcp프로젝트 템플릿 설정
기본 제공 템플릿 (CJ2M CPU11)
CJ2M CPU11 네이티브 템플릿이 포함되어 있습니다. 빈 프로젝트를 생성합니다:
uv run python make_template.py기타 PLC 모델
각 PLC 모델은 서로 다른 바이너리 구성을 가집니다. CJ2M CPU11 이외의 모델의 경우:
사용자 컴퓨터에서 CX-Programmer를 엽니다
PLC 모델(CP1L, CS1G 등)에 대한 새 빈 프로젝트를 만듭니다
.CXP또는.CXT로 저장합니다파일을
project/폴더에 넣습니다make_template.py가 해당 파일을 가리키도록 업데이트합니다:
SRC = Path(__file__).parent / "project" / "your_blank_template.cxp"make_template.py를 한 번 실행합니다
예제 프로그램
예제 래더 프로그램이 포함되어 있습니다: project/example_basic_io.cxp
다음 기능을 갖춘 간단한 컨베이어/IO 컨트롤러를 보여줍니다:
수동 출력 제어(hold-to-run)
RTC를 통한 예약 자동 실행(DM으로 구성 가능)
타이머 기반 지속 시간
SET/RSET 래치
비상 리셋
소스에서 다시 빌드하려면:
uv run python make_template.py
uv run python build_program.py출력: project/example_basic_io.cxp — 검토 및 다운로드를 위해 CX-Programmer에서 엽니다.
프로그램 검토
uv run python review_program.pyMCP 클라이언트 구성
MCP 클라이언트 구성(Claude Desktop, Kiro, Cline 등)에 추가합니다:
{
"mcpServers": {
"cx-programmer": {
"command": "uv",
"args": ["run", "cx-programmer-mcp"],
"cwd": "ABSOLUTE_PATH_TO_THIS_FOLDER"
}
}
}Windows 예시:
"cwd": "C:\\Users\\yourname\\cx-programmer-mcp"선택 사항 — 특정 폴더로 파일 액세스를 제한합니다:
CX_MCP_ALLOWED_ROOTS=C:\PLC_Projects런타임 일정 변경
CX-Programmer Online Mode → PLC Memory → DM Area를 사용합니다:
DM | Function | Default |
| 일정 1 — 시간 | 6 |
| 일정 1 — 분 | 0 |
| 일정 2 — 시간 | 16 |
| 일정 2 — 분 | 0 |
| 실행 시간 x100ms | 300 (=30s) |
변경 사항은 PLC를 재시작하지 않아도 즉시 적용됩니다.
테스트 실행
uv run pytest -q사용 가능한 MCP 도구
Tool | Description |
|
|
| 프로젝트의 모든 프로그램 나열 |
| 프로그램의 섹션 나열 |
| 프로그램의 전체 래더 콘텐츠 가져오기 |
| 섹션의 런 가져오기 |
| 런의 명령어 교체 |
| 새 런 삽입 |
| 런 삭제 |
| 런 주석 설정 |
| 여러 런 편집을 원자적으로 일괄 적용 |
| 새 섹션 추가 |
| 기존 섹션 이름 변경 |
| 심볼 추가 또는 업데이트 |
| 범위 내 모든 심볼 지우기 |
| 모든 심볼 나열 |
| XML 구조 검증 |
|
|
| 재인코딩하여 |
| 사용 가능한 기본 제공 템플릿 나열 |
| 템플릿에서 새 빈 프로젝트 생성 |
| 니모닉 명령어 검증 |
| 런의 부울 시뮬레이션 |
| 런 구조 분석 |
| 전체 프로그램 진단 |
| AI 검토용 의미론적 JSON 스냅샷 |
| 저장 후 CX-Programmer에서 열기 (Windows) |
프로젝트 구조
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.toml참고
실제 PLC에 다운로드하기 전에 항상 CX-Programmer의 Program Check를 실행하십시오.
이 도구는 프로그램 로직만 편집합니다 — I/O 테이블, 유닛 설정 및 PLC 구성은 템플릿에서 그대로 유지됩니다.
.CXP출력은 CJ2M CPU11에서 CX-Programmer 9.73과 바이너리 호환됩니다.다른 PLC 모델의 경우 자체 빈
.CXP템플릿을 제공하십시오 (프로젝트 템플릿 설정 참조).
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