WinProLadder MCP
Offline WinProLadder MCP server for generating, inspecting, analyzing, validating, simulating, and safely modifying ladder projects without PLC access.
Generate new
.ldrfiles from single controls, systems, sequences, native/common FUN specs, or caller-provided Ladder IR.Generate limited
.pdwprojects from sampled templates/IR, restricted X-to-Y rung replacement, metadata rewrites, and retrieve/inspect PDW artifacts.Read, inspect, analyze, compare, validate, simulate, export, and modify
.ldrnetworks using workspace/output constraints, hashes, and no-overwrite safety.Create separate CP950/Big5 component-comment
.txtimport files only when explicitly requested.Query server capabilities, instruction/FUN limits, PLC manual references, design workflow guidance, and validate caller-supplied RTC register snapshots offline.
Does not connect to or download to PLCs; GUI/PLC verification remains external, and simulations/PDW support are bounded offline models.
Click on "Deploy 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., "@WinProLadder MCP create a start/stop ladder template and validate it"
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.
本專案不是 FATEK 官方產品,不會連線或下載程式到 PLC。
主要功能
產生啟停、自保持、計時、計數、正反轉、星三角與順序控制。
支援自訂 Ladder IR,以及多種 FATEK 原生 FUNC 編解碼。
generate_common_fun_ldr可將參數化 MOV、四則運算、INC/DEC、AND/OR/XOR/XNR、 CMP/ZNCMP、DIV48/SUM、MEAN/SQRT/NEG/ABS/EXT、ADCNV/MLC、BITRD/BITWR、 19 種浮點運算、FCMP/FZCP、table/matrix、packing/shift、資料轉換、 WDT/RSWDT、FUN92 HSC0–3/HSTA 與取樣的 FUN93D HSC0、UDCTR、comparison contacts、 明確 I/O/profile 的周邊/脈波/TPCTL、 file/memory-pack、STAT、Timer/Counter 與 PID 組成完整.ldr, 並沿用 Production codec、CRC 與輸出 bytes 回讀驗證。產檔前檢查 I/O、元件範圍、重複 writer、工作區政策及實際輸出 bytes。
提供有限的離線掃描模型與 acceptance cases。
讀取、比較、分析及安全地另存
.ldr。依使用者要求另產生 CP950/Big5 元件註解
.txt。使用本機範本檢查及產生實驗性的
.pdw專案。
Related MCP server: OpenFab MCP
版本與執行中能力
最新版本
目前版本為 v1.3.0,提供 25 個 MCP tools。本版完善本機範本 .pdw 的分析、
生成與安全改寫,新增狀態頁、通訊表格欄位編輯、具名副程式連結及專案名稱管理;
並擴充原生計時、PID、M-BUS、比較接 MOV 與週排程形式。
generate_common_fun_ldr 仍提供 131 個 Common FUN evidence keys。
已發布內容與下載請見 Releases
與 CHANGELOG。
PDW 範圍與驗證
.pdw 專案產生器使用使用者提供的本機相容範本,支援
FBs-10MC/14MC/20MC/24MC/32MC/40MC/60MC 與 44MN 的已驗證版面。
測試專案已由使用者在 WinProLadder 開啟、檢視及另存;另存後指令 bytes、
副程式連結、狀態頁與通訊表格保持一致。這些證據只涵蓋測試過的形式,
不代表全部指令、CPU、版本或實體 PLC 執行均已驗證。範本不隨專案散布。
查詢目前 server
呼叫 get_capabilities 可查看執行中 server 的 version、build.commit、
build.distribution_state 與 response_mode。預設是精簡回應;只有需要完整 schema 與
證據細節時才傳入 detail=true,或以 --full-responses 啟動。
快速安裝
下載原始碼並在專案目錄執行:
Windows PowerShell
powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1macOS / Linux
sh install.sh安裝完成後,將 .install/mcp-config.json 或 .install/mcp-config.toml 中的
winproladder 設定加入 MCP client,再重新連線。詳細說明見安裝指南。
使用範例
直接用自然語言描述控制需求與 I/O:
X0 啟動、X1=1 停止、Y0 自保持,停止優先。驗證後產生 motor.ldr。
需要元件註解時一併說明:
另外新增元件註解:X0 是啟動按鈕,Y0 是馬達輸出。
MCP 會回傳可下載的 .ldr;明確要求註解時,另回傳 .txt。預設輸出位於
artifacts/,且不覆寫同名檔案。
驗證邊界
本專案負責離線產生、解析與驗證檔案。WinProLadder GUI 匯入、PLC 下載及實機測試由使用者在目標環境完成。離線模型通過不等於實體設備已驗證。
目前私有紀錄顯示 131 個 Common evidence keys 各至少一個代表 form 可在 GUI 顯示;這不等於 131 個不同 FUN,也不代表所有參數、GUI 另存再開啟或 PLC 執行均已驗證。
文件
版本內容與後續變更統一記錄在 CHANGELOG。
授權
本專案原創程式碼與文件採用 MIT License,Copyright © 2026 syrup2718。
Available Tools
25 toolsanalyze_ldrARead-only
Explain the behavior and device usage of one existing valid .ldr file.
Use this for per-network meaning, decoded counts, device read/write references, timer
settings and completeness warnings. Use read_ldr when full decoded logic or raw payloads
are needed, or inspect_ldr for framing and CRC evidence. Bad CRC or unknown framing returns
an error; opaque networks produce an explicit incomplete-analysis warning. Nothing is
written or sent to a PLC.
Inputs: path (required). Returns: object
compare_ldrARead-only
Compare two existing .ldr files and report their structural and CRC differences.
This only aligns decoded display-order networks as insert/delete/replace. It does not
validate IR, simulate behavior or write a file: use validate_ladder, simulate_ladder or
generate_ldr for those actions. Use read_ldr for either file's decoded network contents.
Inputs: left_path (required), right_path (required). Returns: object
export_ldrA
Re-encode one existing .ldr into a separate new .ldr artifact.
Use this for a lossless round trip that preserves unknown payloads and the source file's CRC
validity state; it does not change network logic. The source remains untouched and an
existing output_name is rejected. Returns the new artifact link, size, SHA-256 and warnings.
Use modify_network to insert, replace or delete logic, or generate_ldr for new Ladder IR.
Inputs: path (required), output_name (required). Returns: Structured result for artifact-writing and artifact-retrieval tools.
generate_common_fun_ldrB
Generate .ldr from native FUN entries with series EN.
Prefer native FUN (scaling: lcnv). get_instruction_capabilities gives setup/evidence;
LCNV needs an initialized table and has no offline model.
Inputs: spec (required), io_contract (required), output_name (required), acceptance, +3 more. Returns: Structured result for artifact-writing and artifact-retrieval tools.
generate_component_commentsA
Create only a separate CP950 WinProLadder component-comment import .txt file.
Call this only when the user explicitly requests 新增元件註解 or component comments. It
does not inspect, analyze, generate or modify ladder logic or PDW projects; use analyze_ldr
to explain the logic and device references in an existing .ldr.
Rows use REF/COMMENT/DESCRIPTION, tabs, CRLF and CP950/Big5; COMMENT is at most 16
encoded bytes. Never overwrites a file.
Inputs: entries (required), output_name (required). Returns: Structured result for artifact-writing and artifact-retrieval tools.
generate_control_ldrA
Generate a new .ldr for exactly one supported control recipe in a ControlSpec.
Never use this for multiple independent controls, ordered steps or caller-authored IR: use
generate_system_ldr, generate_sequence_ldr or generate_ldr respectively. Supports latch,
toggle, edges, delays, pulse, counter, direction interlock and star/delta. Physical I/O must
be explicit; validation failure writes nothing. generate_component_comments creates only a
separate comment-import .txt.
Inputs: spec (required), io_contract (required), output_name (required), acceptance, +3 more. Returns: Structured result for artifact-writing and artifact-retrieval tools.
generate_ldrA
Compile complete Ladder IR the caller already provides into a new binary .ldr file.
Use generate_control_ldr/sequence/system for ControlSpec/SequenceSpec/SystemSpec.
Check get_instruction_capabilities before arithmetic chains; prefer matching native FUN
via generate_common_fun_ldr and explain fallbacks. No recipe design or resource allocation.
generate_component_comments creates only a separate .txt. Returns hash, link and warnings;
validation failure writes nothing; never overwrites.
Inputs: ladder (required), io_contract (required), output_name (required), acceptance, +2 more. Returns: Structured result for artifact-writing and artifact-retrieval tools.
generate_pdwA
Create a new PDW binary by replacing one or two X-to-Y template rungs.
Same rung count required. Only X0/X1, Y0/Y1/Y2 and NO/NC contacts supported.
No branches, functions, comments or PLC operations. Templates are workspace-scoped.
This generates a PDW binary; generate_component_comments produces only a separate .txt.
Keep private templates outside Git; configure --root to their private directory.
Return the actual binary artifact and warnings. Never overwrite.
Inputs: rungs (required), io_contract (required), output_name (required), template_path (required), +2 more. Returns: Structured result for artifact-writing and artifact-retrieval tools.
generate_project_pdwA
Compile Ladder IR into a new PDW using a matching local CPU template.
Sampled FBs-10MC/14MC/20MC/24MC/32MC/40MC/60MC/44MN layouts only. Retains opaque settings,
replaces program annotations. Network.comment supports CR/LF; sections use source network
indexes. Labelled subprograms support table_call/RETURN/END with relocated label slots.
General control flow/FUNC199 remain unsupported. No overwrite, PLC or GUI guarantee.
generate_component_comments produces a separate text import and cannot create a PDW.
module_order=null preserves modules; [] removes. Other orders copy exact records from local
catalogs, retaining duplicates; missing/conflicting records fail. No automatic I/O,
parameter editing or hardware compatibility claim. See docs/pdw-format.md for format limits.
Inputs: ladder (required), io_contract (required), output_name (required), template_path (required), +9 more. Returns: Structured result for artifact-writing and artifact-retrieval tools.
generate_sequence_ldrA
Generate a new .ldr for dependent ordered steps defined by a SequenceSpec.
Never use this for one control, independent controls or caller-authored IR: use
generate_control_ldr, generate_system_ldr or generate_ldr respectively. validate_ladder
checks existing IR and cannot derive steps. Uses native T timers or FUN87 register state for
pause/resume, never adds X/Y, and requires an explicit clock for pulse counting. Validation
failure writes nothing; no GUI or PLC verification is implied.
Inputs: spec (required), io_contract (required), output_name (required), acceptance, +3 more. Returns: Structured result for artifact-writing and artifact-retrieval tools.
generate_system_ldrA
Generate a new .ldr for two or more independent ControlSpec recipes in one SystemSpec.
Never use this for one recipe, dependent ordered steps or caller-authored IR: use
generate_control_ldr, generate_sequence_ldr or generate_ldr respectively. This tool
allocates internal M/T/C, permits shared inputs, rejects explicit overlaps, checks
acceptance and writes only a new artifact. Validation failure writes nothing. It does not
execute existing IR or return a trace; use simulate_ladder for that.
Inputs: spec (required), io_contract (required), output_name (required), acceptance, +3 more. Returns: Structured result for artifact-writing and artifact-retrieval tools.
get_capabilitiesARead-only
Return server-wide support, policies and limits as metadata only.
Includes build/version, generation and simulation scope, architecture policy, workspace,
output directory and artifact delivery. detail=true expands instruction-specific limits.
This never reads or modifies program content; use modify_network to edit one network.
PLC access and artifact rename/delete are intentionally outside this offline server.
Inputs: detail. Returns: object
get_design_guideARead-only
Return offline workflow guidance for designing supported WinProLadder programs.
Use this before generation to choose a control, sequence, system or custom-Ladder tool and
to obtain acceptance-test patterns. With detail=false it returns compact control recipes,
architecture policy and workflow; detail=true adds instruction notes, complete examples
and the Ladder IR schema. This is not runtime capability metadata (get_capabilities),
instruction operand evidence (get_instruction_capabilities), or manual/RTC reference data
(get_manual_reference), and it does not validate IR or create a file.
Inputs: detail. Returns: object
get_instruction_capabilitiesARead-only
Find native FUN by task; omit family for the selection guide (linear scaling: LCNV).
Pass family for limits/evidence. get_manual_reference covers PLC legality;
get_capabilities covers server support. Unknown families are rejected.
Inputs: family. Returns: object
get_ldr_artifactARead-only
Retrieve a generated .ldr as an embedded MCP binary resource and download link.
Use the original output_name, including .ldr. Returns exact file bytes as base64
with SHA-256; only reads the configured output directory. Useful when the client
cannot access local server paths or cannot invoke resources/read directly.
Inputs: output_name (required). Returns: Structured result for artifact-writing and artifact-retrieval tools.
get_manual_referenceARead-only
Return bundled PLC-manual semantics, operand maxima and cited source pages.
Use this to decide documented PLC legality, manual-edition differences or RTC register and
control procedures. Use get_instruction_capabilities instead for implemented encoder and
simulation coverage, or get_design_guide for generation workflow. This reads no project or
PLC state and returns static reference data only.
Inputs: no named parameters. Returns: object
get_pdw_artifactARead-only
Return the exact bytes and download link for one previously generated PDW artifact.
Use this after PDW generation when the client needs an embedded binary resource; use
inspect_pdw to interpret project structure, or get_ldr_artifact for an .ldr. output_name
must be the exact plain .pdw filename in the artifact directory. Missing, oversized or
wrong-extension files return an error. This reads only and returns URI, size and SHA-256.
Inputs: output_name (required). Returns: Structured result for artifact-writing and artifact-retrieval tools.
inspect_ldrARead-only
Inspect the binary container of one existing .ldr file without decoding its logic.
Use this for framing, record offsets, raw payload bytes and stored/calculated CRC evidence.
It reads one workspace-scoped file and returns metadata only; it never writes or connects to
a PLC. Use read_ldr for decoded networks or analyze_ldr for device reads, writes and
meaning.
Invalid framing or file constraints return an error rather than partial interpretation.
Inputs: path (required). Returns: object
inspect_pdwARead-only
Inspect the structure and metadata of one existing workspace PDW project.
Reports CPU, modules, sections, Chinese comments and known checksums. Tail records include
file offsets, sizes, checksum status and payload SHA-256. Use get_pdw_artifact for generated
bytes. FUNC199 stays opaque; invalid layouts return errors. No writes or PLC connection.
Inputs: path (required). Returns: object
inspect_rtc_snapshotARead-only
Validate a caller-supplied FATEK RTC register snapshot offline.
Use this after obtaining R4128..R4134 externally; optionally include packed R4135 to check
hour/minute consistency. It checks field ranges and month/day, then returns decoded fields,
expected_R4135 and consistency when supplied. Invalid or unknown fields return an error and
nothing is written. This server has no PLC-access tool; use get_manual_reference for RTC
register meanings and setting procedure.
Inputs: registers (required). Returns: object
modify_networkA
Edit one network in an existing .ldr and write the result to a new .ldr file.
Use operation replace, insert or delete; index 0 is N000 and untouched raw records are
preserved. Unlike get_capabilities, this changes program content; get_capabilities returns
server metadata only. The source file is never overwritten.
Inputs: path (required), index (required), operation (required), io_contract (required), +4 more. Returns: Structured result for artifact-writing and artifact-retrieval tools.
read_ldrARead-only
Decode one existing .ldr into display-order network records and optional Ladder IR.
Use this for decoded logic and raw payloads; use inspect_ldr for container offsets or
bad-CRC forensics, and analyze_ldr for device reads/writes and semantic summaries.
Unsupported payloads remain opaque, complete Ladder IR is returned only when every network
decodes, and
bad CRC or unknown framing returns an error. The workspace file is never modified.
Inputs: path (required). Returns: object
rewrite_pdw_metadataA
Copy PDW metadata while retaining populated program and memory bytes exactly.
Title defaults to output stem. Pages: null preserves, [] removes, list replaces.
Tables: null preserves, [] removes; creating tables is unsupported.
Retains unrelated/unknown records. Workspace files only, never overwrites. Validates byte
preservation, not original instruction semantics, GUI compatibility or PLC behavior.
Inputs: output_name (required), source_path (required), tables, project_name, +2 more. Returns: Structured result for artifact-writing and artifact-retrieval tools.
simulate_ladderARead-only
Simulate caller-supplied Ladder IR and return a bounded per-scan behavior trace.
This neither generates a system .ldr nor compares existing files; use generate_system_ldr
for multi-control generation and compare_ldr for file differences. This is a
Boolean/direct R/D model, not PLC emulation. scan_ms is required for T/C and FUN87/88/89.
Supports the explicitly listed
numeric/native subset; unsupported actions fail without a partial trace.
Words use unsigned 16-bit storage. Missing X inputs reset false each scan.
See get_capabilities simulation_model for assumptions and supported actions.
Inputs: inputs (required), ladder (required), initial, scan_ms. Returns: object
validate_ladderARead-only
Validate one caller-supplied Ladder IR object without reading or writing .ldr files.
Returns simplified connected IR, layout and resource/policy errors; it is not PLC syntax
validation. To report differences between two existing .ldr files, use compare_ldr instead.
Inputs: ladder (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 25 tools
The large generation family (generate_ldr, generate_control_ldr, generate_sequence_ldr, generate_system_ldr, generate_common_fun_ldr, generate_pdw, generate_project_pdw) risks confusion, but descriptions aggressively cross-reference each other and state exactly when to use which alternative. Read-side tools (read_ldr, inspect_ldr, analyze_ldr) are similarly well delineated by stated purpose. A few get_* metadata tools (get_capabilities, get_design_guide, get_instruction_capabilities, get_manual_reference) are distinguishable but only after careful reading.
All names follow a consistent snake_case verb_noun pattern, which is predictable and readable. Minor inconsistency comes from using different verbs for the same resource (read_ldr vs inspect_ldr vs analyze_ldr), but these reflect genuinely different operations rather than arbitrary convention drift.
At 25 tools the surface is heavy, sitting at the borderline for a single domain. Seven near-parallel generate_* variants plus four get_* reference tools make the set feel larger than strictly needed, though the underlying ladder/PDW domain is genuinely complex.
Lifecycle coverage is strong: read/inspect/analyze, validate, simulate, compare, modify one network, multiple generation paths, and artifact retrieval all exist. The notable gap is that PDW support is generate/inspect-only (no decode of PDW logic, opaque FUNC199) and artifact rename/delete is explicitly excluded, but these are documented limitations an agent can work around.
Maintenance
Related MCP Connectors
Cloud PLC simulator: validate and step-run LAD/SCL programs, run scenarios, return PASS/FAIL.
Artifact store for AI agents. Hosted OAuth at mcp.artifacta.io/mcp; local stdio via npm/PyPI.
Generate TIA Portal importable SimaticML (V19) from LadDoc IR, with strict validation, over MCP.
20 engineering MCP tools: 3D STL/G-code, ELF/WASM, Verilog/VCD, systemd/seccomp, PDF repair.
Related MCP Servers
- FlicenseAqualityBmaintenanceProvides read-only analysis of Mitsubishi GX Works3 PLC projects via MCP, enabling device tracing, cross-referencing, ladder inspection, linting, and report generation without modifying source projects.16223 PyPI10-
- AlicenseAqualityCmaintenanceEnables offline-first industrial manufacturing workflows by parsing, linting, and drafting FANUC .LS robot programs and analyzing STEP/STP CAD files through MCP tools.4Apache 2.0
- AlicenseAqualityBmaintenanceEnables reading, patching, diffing, packaging, and native compilation of H3U PLC projects offline via MCP, without starting the AutoShop GUI.19MIT
- AlicenseNot gradedqualityBmaintenanceEnables local stdio-based MCP integration with InoProShop/CODESYS for project structure reading, POU editing with verified writes, compilation, task configuration, and persistent session recovery.6MIT