Skip to main content
Glama
BlackUppsss

cx-programmer-mcp

by BlackUppsss

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 이외의 모델의 경우:

  1. 사용자 컴퓨터에서 CX-Programmer를 엽니다

  2. PLC 모델(CP1L, CS1G 등)에 대한 새 빈 프로젝트를 만듭니다

  3. .CXP 또는 .CXT로 저장합니다

  4. 파일을 project/ 폴더에 넣습니다

  5. make_template.py가 해당 파일을 가리키도록 업데이트합니다:

SRC = Path(__file__).parent / "project" / "your_blank_template.cxp"
  1. 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.py

MCP 클라이언트 구성

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

D0

일정 1 — 시간

6

D1

일정 1 — 분

0

D2

일정 2 — 시간

16

D3

일정 2 — 분

0

D4

실행 시간 x100ms

300 (=30s)

변경 사항은 PLC를 재시작하지 않아도 즉시 적용됩니다.


테스트 실행

uv run pytest -q

사용 가능한 MCP 도구

Tool

Description

load_project

.cxp 또는 .cxt 파일을 세션에 로드

list_programs

프로젝트의 모든 프로그램 나열

list_sections

프로그램의 섹션 나열

get_program_context

프로그램의 전체 래더 콘텐츠 가져오기

get_rungs

섹션의 런 가져오기

replace_rung

런의 명령어 교체

insert_rung

새 런 삽입

delete_rung

런 삭제

set_rung_comment

런 주석 설정

patch_program

여러 런 편집을 원자적으로 일괄 적용

create_section

새 섹션 추가

rename_section

기존 섹션 이름 변경

upsert_symbol

심볼 추가 또는 업데이트

clear_symbols

범위 내 모든 심볼 지우기

list_symbols

모든 심볼 나열

validate_program

XML 구조 검증

save_cxt

.cxt로 저장

save_cxp

재인코딩하여 .cxp로 저장

list_project_templates

사용 가능한 기본 제공 템플릿 나열

create_project_from_template

템플릿에서 새 빈 프로젝트 생성

compile_rung

니모닉 명령어 검증

simulate_rung

런의 부울 시뮬레이션

analyze_rung

런 구조 분석

program_diagnostics

전체 프로그램 진단

semantic_snapshot

AI 검토용 의미론적 JSON 스냅샷

launch_in_cx_programmer

저장 후 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 템플릿을 제공하십시오 (프로젝트 템플릿 설정 참조).

Install Server
F
license - not found
B
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • A
    license
    B
    quality
    C
    maintenance
    An 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.
    16
    33
    MIT
  • F
    license
    Not graded
    quality
    A
    maintenance
    MCP 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

View all related MCP servers

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.

View all MCP Connectors

Latest Blog Posts

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