twincat-mcp
Provides TwinCAT 3 documentation lookup against Beckhoff's Infosys site: lists books and pages from the site's own sitemap, offers per-library local full-text indexing (FTS5) with symbol search, returns FB/struct/enum declarations as structured data alongside the page's descriptions, supports code-example search, and can render any page as Markdown, with a web fallback verified against the sitemap so an existing page is never reported as not found.
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., "@twincat-mcp read the live value of MAIN.fbConveyor.bRunning and tell me if it's true"
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.
twincat-mcp
One MCP server, one Python process, full reach into a Beckhoff TwinCAT 3 setup:
Layer | What the agent can do | Backend |
Runtime (target IPC) | PLC/system state, symbol browse, typed read/write (structs, arrays, TIME/DATE decoded), raw index-group access, polling trace, wait-until, run/stop/reset, RUN↔CONFIG mode, EtherCAT master state, routes | pyads (ADS) |
IPC file system / OS | read/write/list/delete files on the target over ADS (TcUnit results, logs, boot dir), start a process, reboot | ADS System Service (port 10000) |
Engineering (XAE) | attach to the running XAE shell, open/build with file:line errors, PLC login/start/stop, set target, activate configuration, restart TwinCAT, one-shot deploy, System Manager tree read/write (XML), create/edit POUs in place, PLCopen import/export, boot project | TE1000 Automation Interface over COM (pywin32) |
Real-time recorder | continuous capture of online variables while the program runs — PLC-timestamped ADS notifications (cycle or on-change) or polling, hours long, file-backed; live snapshot/stats while recording; scope-style start/stop triggers with pre-trigger; CSV export; pulse/dwell and edge-to-edge latency analysis | pyads notifications |
Test bench | scripted scenarios (writes + expectations + parallel recording), assertions with wait, settle checks, stimulus→response latency, RPC method calls, task timing/load, snapshots for regression | ADS |
Project files (offline) | index .TcPOU/.TcDUT/.TcGVL/.TcIO, code with line numbers, ADS symbol → file:line resolution, regex search, references, call graph, FB interface summary, lint, write-back with LineIds hygiene, TcUnit suite scaffold | XML + regex, no XAE needed |
TcUnit | build → boot → activate → restart → fetch xUnit XML from the target → pass/fail summary | all three |
Experiments | spec (factors × levels, runs, preconditions, stimulus, done condition, measures, metrics, criteria, allowed writes) → background runner with snapshot + capture profile per run, factor restore, abort → metrics with 95 % CIs (t / χ²), Cpk → pass / fail / inconclusive with the n that would settle it → Markdown + HTML report with identity, charts, audit trail and a separately-labelled interpretation; compare two experiments with error bars | recorder + bench + SQLite-free JSONL |
Reference (Infosys) | TwinCAT 3 documentation lookup that cannot be incomplete: books and pages from infosys.beckhoff.com's own sitemap, per-library local index (FTS5), symbol search, FB/struct/enum declarations as data with the page's descriptions, code-example search, any page as Markdown; web fallback verified against the sitemap | urllib + SQLite, no index to ship |
Runs on the engineering PC (Windows, TwinCAT XAE installed) and talks to the IPC through the TwinCAT router. No C# helper, no daemon, no PowerShell, no vector DB.
Why another one
Existing servers each cover a slice; this one was built after reading all of them:
Server | Gap this project closes |
malcolm-mill/beckhoff_mcp (pyads, read-only) | writes, structs/arrays, TIME/DATE decoding, watch/trace, XAE, files on target |
Edge-JB/TwinCAT-XAE-MCP (Node + .NET daemon, XAE only) | needs an MSBuild step and the 64-bit shell; no runtime reads, no TcUnit. Confirmation-token and safety-project ideas kept. |
idomp/twincat-mcp-public (Python + C# | needs MSBuild + Windows PowerShell 5.1 to build the helper. Arm/confirm + persistent-shell + TcUnit flow kept, in pure Python. |
Auda29/twincat-mcp-mono (TypeScript ADS) | three-gate write model kept (mode + runtime + allowlist); XAE/files added. |
evaluated 2026-10 and not adopted: its LineIds model (one entry per block, Ids from 1), an invented OVERRIDE marker, "base FB must be nearby" and "undeclared target" for FB members inside methods all fire as errors on real XAE files, and its default autofix re-indents every tab-indented line. The ideas that hold (interface contract, | |
semantic search needs Qdrant + embeddings. Here: deterministic symbol-to-source resolution instead. | |
Infosys documentation servers ( | the shipped index is whatever the author crawled: tested one has no Tc2_System at all ( |
Extra: human-in-the-loop via MCP elicitation — when the client supports it (Claude Code does) the destructive tools ask you in the client UI; the token flow is only the fallback.
Related MCP server: te1000-mcp
Requirements
Windows 10/11 engineering PC with TwinCAT XAE 3.1.4024+ (XAE Shell, 32-bit
TcXaeShell.DTE.15.0, or 64-bit 4026TcXaeShell.DTE.17.0, or VS 2019/2022/2026 with TwinCAT).Python 3.12 64-bit (the one version the project targets and tests; 3.12 or newer is accepted, older ones are refused with a message). pywin32 and pyads are installed by
pip.An ADS route from this PC to the target (XAE → Choose Target → Add Route).
ads_routeslists what exists.Open the solution in XAE before using
xae_*tools; the server attaches to the running instance (it can launch one, but attaching is faster and visible).
Linux/macOS: only proj_*, tcunit_results(local_path/xml_text) and the safety tools work. Everything else needs the router/COM.
Install
Three ways. All need a 64-bit Python 3.12 on the engineering PC; nothing else is installed by hand — the
launcher (scripts/launch.py) creates a private venv on first start and reinstalls only when the shipped
sources change.
A. Claude Code plugin (recommended)
The repo is its own plugin marketplace (.claude-plugin/). Inside Claude Code:
/plugin marketplace add Disectron/twincat-mcp-server :: GitHub; or a local clone: /plugin marketplace add C:\tools\twincat-mcp
/plugin install twincat-mcp@twincat-mcpOne step on Claude Code ≥ 2.1.275: /plugin install twincat-mcp --marketplace Disectron/twincat-mcp-server. The plugin brings
the MCP server (named twincat, tools appear as mcp__plugin_twincat-mcp_twincat__<tool>), two skills —
twincat-mcp (tool chains) and twincat-docs (offline Beckhoff documentation, below) — and the 5 prompts. /plugin configure twincat-mcp@twincat-mcp sets the Python executable (default
python), default AmsNetId, start/ceiling safety mode and an optional config TOML; everything project-specific
(solution path, allow/deny lists, HMI root) comes from twincat_mcp.toml in the folder you start claude in.
First start takes about a minute (venv + pip); if that first session reports the server as failed, the venv is
already there — start a new session. The venv lives in ~/.claude/plugins/data/twincat-mcp-twincat-mcp/venv
and survives plugin updates.
B. Claude Desktop bundle
scripts\build-mcpb.cmd produces dist\twincat-mcp-<version>.mcpb (or take the one from a release). Claude
Desktop → Settings → Extensions → drag the file in. The install dialog asks for the solution, AmsNetId and
safety modes. Windows only (the bundle runs cmd /d /c server\launch.cmd, which finds py -3, python or
%LOCALAPPDATA%\Programs\Python). Logs: %APPDATA%\Claude\logs\mcp-server-twincat-mcp.log.
C. By hand (any MCP client, development)
git clone <this repo> C:\tools\twincat-mcp
cd C:\tools\twincat-mcp
scripts\install.cmd :: venv + pip install -e .[dev] + prints effective config
.venv\Scripts\python -m pytest :: 159 tests, all mocked, run anywhere
cd C:\Projects\DrumFilling
claude mcp add twincat -e TCMCP_SOLUTION=%CD%\DrumFilling.sln -e TCMCP_AMS_NET_ID=5.12.34.56.1.1 -e TCMCP_MODE=guarded -e TCMCP_MAX_MODE=full -- C:\tools\twincat-mcp\.venv\Scripts\python.exe -m twincat_mcpor copy .mcp.json.example → .mcp.json in the solution folder. Cursor / Windsurf / Claude Desktop's
claude_desktop_config.json use the same JSON shape.
First prompt in any client: "run tc_doctor". It reports router, local NetId, target state, registered ProgIDs, running shells, project root and the safety mode. Fix what it flags before anything else.
Configuration
Env vars override twincat_mcp.toml (./, ~/.twincat_mcp/config.toml, or TCMCP_CONFIG). See twincat_mcp.toml.example.
Env | Meaning | Default |
| start mode |
|
| ceiling for | = mode |
|
|
|
|
| empty |
| target | local, |
|
| — |
| folder for | solution folder |
|
| 17.0, 15.0, VS 18/17/16 |
|
|
|
| result path on the target |
|
| JSONL audit file; also log reads |
|
| Infosys lookup on/off; |
|
Safety model
op class | examples | readonly | guarded | full |
read | any | ok | ok | ok |
edit |
| — | ok | ok |
write |
| — | allowlist ∧ ¬denylist | ¬denylist |
control |
| — | confirm | ok |
destructive |
| — | confirm | confirm* |
* unless TCMCP_CONFIRM=0.
"Confirm" = elicitation prompt in the client when supported (on MCP 2026-07-28 the question is returned to the client as an input_required result and the client calls the tool again with the answer; on earlier revisions it is an elicitation request during the call; tc_doctor → elicitation says which applies and whether the client declared the capability), otherwise tc_request_confirmation(action, target) → single-use token, 180 s TTL, bound to that action, target and the machine the server was connected to when it was issued (re-targeting with ads_connect invalidates it). xae_deploy / tcunit_run refuse when the XAE target and the ADS target differ. The agent can escalate its own mode only up to TCMCP_MAX_MODE, which it cannot change. Every mutating call lands in the audit log (tc_audit_tail).
"Absolute control" setting: TCMCP_MODE=full TCMCP_MAX_MODE=full TCMCP_CONFIRM=0. In that configuration a single mis-aimed tool call can stop the PLC, activate a half-built configuration or reboot the IPC. The server will do exactly what it is told; the only remaining gate is the MCP client's own tool-permission prompt. Keep a denylist for E-stop/safety symbols regardless.
Tools (151) + 5 prompts
Workflows (one call = a whole chain) wf_debug_symbol · wf_fb_profile · wf_release_check · wf_project_overview
Prompts (recipes the agent follows) debug_symbol · fb_validation · deploy_safely · performance_audit · onboard_project
Meta tc_doctor · tc_safety_status · tc_set_mode · tc_request_confirmation · tc_audit_tail
Runtime (ADS) ads_discover · ads_connect · ads_status[port] · ads_list_symbols[flag] · ads_symbol_info · ads_read · ads_read_many · ads_leaves · ads_dump · ads_types · ads_io_read · ads_write · ads_write_many · ads_read_raw · ads_write_raw · ads_watch · ads_wait_until · ads_plc_state · ads_system_mode · ads_ethercat · ads_routes · ads_add_route_to_plc · ads_app_info · ads_task_stats · ads_ping · ads_call_method · ads_export (C#/TS/JSON from the datatype table)
Recorder rec_start · rec_capture · rec_list · rec_status · rec_snapshot · rec_stats · rec_read · rec_stop · rec_verify · rec_export · rec_delete · rec_pulses · rec_latency · rec_compare
Test bench test_expect · test_stable · test_response · test_scenario · snap_save · snap_compare · snap_apply · snap_list
Target OS (System Service) ipc_read_file · ipc_list_dir · ipc_write_file · ipc_delete_file · ipc_start_process · ipc_reboot · ipc_eventlog (Windows targets)
XAE xae_attach · xae_status · xae_open_solution · xae_build · xae_diagnostics · xae_list_commands · xae_command · xae_plc · xae_target · xae_activate_configuration · xae_restart_twincat · xae_deploy · xae_tree_get · xae_tree_consume_xml · xae_tree_set_values · xae_tree_create_child · xae_tree_delete · xae_plc_projects · xae_pou_get · xae_pou_set · xae_pou_create · xae_plcopen_import · xae_plcopen_export · xae_boot_project · xae_dialogs · xae_dialog_resolve · xae_io_disable · xae_links
Project files proj_scan · proj_list · proj_get_code · proj_resolve_symbol · proj_search · proj_references · proj_read_file · proj_set_code · proj_interface · proj_lint · proj_call_graph · proj_variables · proj_vs_runtime · proj_changed · proj_validate_xml
HMI (TE2000 / TcVIS) hmi_scan · hmi_bindings · hmi_vs_runtime
TcUnit tcunit_results · tcunit_run[disable_io] · tcunit_scaffold
Experiments exp_template · exp_validate · exp_save · exp_list · exp_get · exp_runs · exp_run[dry_run] · exp_status · exp_abort · exp_evaluate · exp_report · exp_compare
Knowledge base kb_set_location · kb_status · kb_rebuild · kb_add_project · kb_remove_project · kb_reindex · kb_search · hw_lookup · hw_search · hw_object · hw_diag · hw_module · proj_libraries — the database lives in a folder you name; only project folders you add are indexed; the hw_* tools read the ESI index (every ESI file in the knowledge folder's manuals\ and TwinCAT's ESI folders)
Offline documentation — skill twincat-docs (no MCP tools; a read-only script the skill runs). The knowledge
folder has one fixed layout (0.8.11; the rules are docs/KNOWLEDGE_BASE.md):
in the knowledge folder | content | built by |
| the TwinCAT 3 books of the Help Viewer package — the one Infosys index, read by the | the plugin, the first time by itself; later |
| the PDF manuals in | the plugin, the first time by itself; later |
| every EtherCAT device description on the PC: the ESI files you put in | the plugin, the first time by itself; later |
| projects for | the |
| your PDFs and SOPs (Markdown) | you — the plugin never writes there |
| builder stubs that run the plugin's builders | the plugin (only files it shipped are replaced) |
skills/twincat-docs/kb_docs.py answers docs_search, docs_declaration, docs_page, docs_books,
manual_search, manual_product, manual_toc, manual_page, manual_docs, hw_lookup, hw_search, hw_object,
hw_diag, hw_module, status as one JSON object each (standard library, opens the indexes read-only). A name that exists in several libraries (MC_MoveAbsolute in
Tc2_MC2 and Tc3_DriveMotionControl) is never resolved silently: the answer is ambiguous with the candidates.
kb_status → docs shows both indexes, the PDFs not indexed yet and the exact command for this folder; hw_lookup
lists the manuals that mention a product code. Every index is complete, rebuild_needed (another format) or
outdated (the source changed) — the last two are used as they are until you approve the rebuild — or missing,
plus a build running, interrupted or waiting to replace it; the server reports it at every connection, in
tc_doctor (offline_docs), in kb_status and in each answer's source. Links are stored as page addresses:
docs_page and docs_declaration return them as links, which docs_page opens.
Capture profiles rec_scan · rec_profile_save · rec_profile_list · rec_profile_get · rec_profile_delete · rec_profile_start · rec_profile_stop
Infosys reference (TwinCAT 3) infosys_books · infosys_index · infosys_search_symbols · infosys_declaration · infosys_search · infosys_search_code · infosys_get_page
Meta also tc_session_report (markdown handover of everything this session changed/produced)
Resources: twincat://config, twincat://safety, twincat://audit/recent. Full one-line-per-tool reference with safety classes: TOOLS.md (generated from the server).
Claude Code loads MCP tool schemas lazily when a server exposes many tools, so the count costs little context until a tool is used. Performance: quick reads and long operations (watch, scenarios, dumps) run on separate ADS workers, so a 60 s watch never stalls an ads_read; recorder queries touch memory/files only; the datatype table and symbol table are cached (TTL 300 s, refresh=true to force).
Connecting Claude Code
Claude Code starts the server itself over stdio — no port, nothing on the network, runs as your Windows user next to the TwinCAT router and the open XAE shell. Plugin install (section A above) is the short path; the manual claude mcp add route, scopes, permissions and troubleshooting are in integrations/claude-code/README.md.
Tool results reach Claude Code as the SDK's indented JSON text plus structured content; Claude Code shows them as collapsible tool-result blocks and the model summarises. For a human-readable handover use tc_session_report (markdown).
Also in the repo: skills/twincat-mcp/SKILL.md and skills/twincat-docs/ (loaded by the plugin; or drop into .claude/skills/), integrations/claude-code/CLAUDE.md.snippet (conventions for every session), integrations/claude-code/.mcp.json template, scripts\register-claude-code.cmd.
What 0.5.0 closes from the gap list
gap | tool | status |
modal dialogs stall COM |
| window enumeration verified on Windows CI (it found a real system dialog); button clicks untested on hardware |
TwinSAFE guard | every XAE edit refuses | done |
XML structure + LineIds |
| done |
HMI files |
| done |
TcUnit without hardware |
| ITcSmTreeItem.Disabled, untested |
PLC discovery |
| protocol per XAE broadcast search, untested |
variable links |
| instance XML (DataAreas) + ProduceMappingInfo; checked against a 3.1.4026 project's XML and mapping table |
event log |
| partial |
MES glue |
| done |
recipes |
| done |
handover |
| done |
Still deliberately absent: Scope/TE13xx, NC, non-EtherCAT fieldbuses, library binary introspection, semantic search, ESI-based box creation.
Reading every variable
The symbol upload alone does not enumerate elements of ARRAY OF STRUCT, nested arrays or deep FB internals. The server also uploads the datatype table (ADSIGRP_SYM_DT_UPLOAD) and uses it everywhere:
> ads_read MAIN.fbFill → the whole FB instance as one nested tree (one ADS read): structs,
arrays of structs, enums by name, TIME/DATE decoded
> ads_leaves MAIN → every scalar under the program with type and byte offset
> ads_leaves MAIN.arrSteps with_values=true
> ads_dump → every variable on the PLC → dump-<ts>.json (tree) + .csv (path,type,value)
> ads_dump pattern=GVL_* → only the GVLs
> ads_types ST_Recipe → members, offsets, sizes; ads_types pattern=E_* → enums
> proj_variables → what the source declares, flattened to the same instance paths
> proj_vs_runtime → declared-but-not-online / online-but-not-declared: proves the target
runs this source after a deploy
> rec_start prefix=MAIN → records every leaf under MAIN, array elements includedIf the datatype upload fails on a target, every tool falls back to the member symbols the runtime publishes (what the other servers rely on) and says so in decoder / datatype_table.
Real-time recording while the program runs
> rec_start prefix=MAIN.fbFill mode=change cycle_ms=1 name=fill-cycle
→ every scalar under MAIN.fbFill, PLC-timestamped on every change
> …run the machine, deploy, whatever…
> rec_status <id> → samples, missing_samples, completeness, drops, backlog, last values
> rec_snapshot <id> → the live tail
> rec_stats <id> → per symbol: count, min/max/mean, change count, BOOL edges,
state runs with dwell times
> rec_stop <id>
> rec_pulses <id> MAIN.fbFill.fbFine.bOpen → pulse count, width, period, duty
> rec_latency <id> MAIN.fbFill.fbValve.bOpen == TRUE MAIN.fbFill.rFlow > 0.5
> rec_read <id> t_from_ms=800 t_to_ms=1200 wide=true → what else was true around the event
> rec_export <id> csv_wide → spreadsheet (with the PLC's FILETIME per row)
> rec_verify <id> counter=MAIN.nCycleCount → PASS/FAIL: unmodified, no gaps, every cycle presentModes: cycle = one sample per cycle_ms (set it to the task cycle for a complete trace), change = only when the value changes (cheap, exact edge times), poll = sum-read from the PC (any port, no notifications; timestamps are this PC's, labelled time_source: pc). Triggers: start_when='MAIN.bStart == TRUE' pre_trigger_ms=500 keeps the half second before the trigger; stop_when, duration_s (PLC time), post_trigger_s, max_events end it. Recordings from earlier sessions stay readable (rec_list, rec_read, rec_pulses, rec_export).
Accuracy (0.7). Neighbouring variables share one ADS notification per contiguous memory block (an FB, a struct, an array): the runtime sends the whole block per sample and the leaves are decoded on the PC. On a 1 ms task, 300 counters as one block were lossless; as 300 separate notifications ~5 % complete — so select whole FBs/structs/arrays rather than hundreds of scattered globals. Every loss is counted: missing_samples / completeness per block from the PLC timestamps (cycle mode), dropped (backlog full), dropped_on_stop. A notification that cannot be registered fails the start (allow_partial=true records the rest and lists unsubscribed_symbols).
Provenance. The file (~/.twincat_mcp/recordings/<id>.jsonl) stores the raw bytes the runtime sent and the runtime's own sample timestamps: _t0.filetime is the PLC FILETIME of the first sample and t_ms has 0.1 µs resolution, so filetime + t_ms·10⁴ is each sample's exact PLC time (rec_export adds it as plc_filetime). The footer carries a SHA-256 over every line, signed with a per-install key. rec_verify <id> counter=MAIN.nCycleCount proves (1) the file is unmodified, (2) no holes in the PLC timeline, (3) the per-cycle counter steps by exactly 1 — the ground truth for "no sample lost". The acceptance run does this with TwinCAT_SystemInfoVarList._TaskInfo[1].CycleCount at the task cycle.
Native capture engine (0.8). Cycle-mode recordings run in tcmcp-capture.exe (twincat_mcp/bin/), a C++ service built on Beckhoff's AdsLib (AdsDevice / AdsNotification) over Beckhoff's TcAdsDll — the TwinCAT router. The ADS callback copies each sample into a lock-free ring and returns; a writer thread merges the blocks by PLC timestamp and writes the same format-2 file, signed the same way. Python is no longer on the data path, so the 300-leaf/1 ms loss of the Python recorder does not apply (the simulator test writes 60 s of a 1200-byte block + counter at 40× real time without a loss). The footer adds missing_head (pre-trigger buffer not full), missing_gaps, missing_tail (PLC stopped before the window end), overflow_samples (ring full on this PC — reported, never silent), requested_s, plc_span_s, window_start_ms/window_end_ms and verdict_hint. One process per recording; nothing is subscribed unless every block is. engine='python' (or [recorder] engine = "python") keeps the in-process recorder; without a matching exe, auto falls back to Python and says why (engine_note). change/poll modes and allow_partial stay on the Python recorder. tc_doctor → recorder shows which engine cycle recordings use. Build and protocol: native/capture/README.md.
Choosing what to record: capture profiles
rec_start decides the symbol set per call. For batch-after-batch work the set should be decided
once, from a scan of what exists, and replayed. Three ways to choose, all ending in a named profile:
Checklist.
rec_scan prefix=MAIN.fbDispense checklist=batch(orsource=projectoffline) lists every scalar leaf with type, size, a suggested mode (BOOL/INT/enum →change, REAL/TIME →cycle, strings/arrays →poll) and the bytes/s it would cost, grouped byprogram.instance, and writes~/.twincat_mcp/profiles/batch.checklist.csv. Put anxinselect, optionally overridemode/cycle_msper row, thenrec_profile_save name=batch from_checklist=batch.preselect=["*.bDone"]pre-marks patterns.In the source.
{attribute 'tcmcp.record' := 'cycle'}above a declaration selects it; on an FB/STRUCT instance it selects the whole subtree, an inner'off'carves holes,{attribute 'tcmcp.cycle_ms' := '1'}pins the rate.rec_profile_save name=batch from_attributes=truecollects them through the project index — the selection is versioned with the code and survives renames the way nothing in a chat does. TwinCAT ignores unknown attributes.Explicit.
rec_profile_save name=x symbols=[...] mode=auto—autoreads the runtime type.
rec_profile_start batch starts one recording per (mode, cycle) group, named batch/cycle@1,
batch/change@10…, with the profile's start_when / stop_when / pre_trigger_ms (trigger symbols
are added to every group automatically); rec_profile_stop batch ends them together; rec_stats,
rec_export, rec_compare work per recording as before. Sources combine and later ones override
earlier ones, so a checklist can narrow what the attributes selected.
"By standard" there is no default selection: nothing is recorded that was not chosen, and the suggested modes are heuristics shown next to the choice, not applied behind it.
Testing an FB on the live machine
> test_scenario {
"name": "bulk-then-fine",
"record": {"prefix": "MAIN.fbFill", "mode": "change", "cycle_ms": 1},
"steps": [
{"at_ms": 0, "write": {"MAIN.stRecipe.rTargetKg": 25.0, "MAIN.bStart": true}},
{"wait_until": {"symbol": "MAIN.fbFill.eState", "op": "==", "value": 2, "timeout_ms": 3000}},
{"expect": [{"symbol": "MAIN.fbFill.fbValve.bOpen", "op": "==", "value": true}]},
{"wait_until": {"symbol": "MAIN.fbFill.bDone", "op": "==", "value": true, "timeout_ms": 60000}},
{"stable": {"symbol": "MAIN.rNetWeight", "duration_ms": 2000, "tolerance": 0.02}}
],
"final_expect": [{"symbol": "MAIN.rNetWeight", "op": "~=", "value": 25.0, "tolerance": 0.05},
{"symbol": "MAIN.fbFill.bError", "op": "==", "value": false}]
}
→ per-step pass/fail with times, written values restored, recording id for rec_* analysis
> test_response {"MAIN.fbFill.fbValve.bOpenCmd": true} "MAIN.fbFill.rFlow > 0.5"
→ PLC-timestamped latency from the write to the response
> ads_task_stats samples=100 → exec time min/max/mean, load %, cycle overruns while the FB runs
> snap_save before prefix=GVL_Params … change code … snap_compare before live tolerance=0.001
> proj_interface FB_Fill · proj_lint FB_Fill · proj_call_graph MAIN
> tcunit_scaffold FB_Fill → FB_Fill_Tests.TcPOU registered in the .plcproj; then tcunit_runWrites in scenarios go through the same allow/deny lists as ads_write; nothing is written until every symbol in the script has been permitted. Writing to an AT %I* input does nothing useful (the I/O task overwrites it each cycle) — stimulate through unmapped inputs or a simulation GVL.
Experiments: from runs to a report someone can sign
rec_* captures and test_* stimulates; exp_* turns repeated runs into conclusions. The spec is
YAML (or JSON) in <project>/experiments/<name>/spec.yaml — versioned with the code:
name: preact-fill-validation
hypothesis: With lambda=0.95 the preact controller holds |bias| <= 2 g and sigma <= 3 g at 1000 g.
profile: preact-fill # capture profile started for every run
preconditions: [{symbol: MAIN.fbScale.bStable, op: "==", value: true, timeout_ms: 30000}]
factors:
- {name: target_g, symbol: GVL_Recipe.rTarget_g, levels: [500, 1000]}
- {name: lambda, symbol: MAIN.fbDispense.fbPreact.rLambda, levels: [0.95]}
runs_per_level: 5
run:
start: {symbol: MAIN.bStartFill, value: true, reset_value: false, reset_after_ms: 200}
done_when: {symbol: MAIN.fbDispense.ePhase, op: "==", value: IDLE, timeout_ms: 180000}
settle_ms: 2000
measures:
final_weight_g: {kind: last, symbol: MAIN.fbScale.rNet_g}
final_error_g: {kind: expr, expr: final_weight_g - target_g}
cut_latency_ms: {kind: latency, from: {symbol: MAIN.fbDispense.bCut, op: "==", value: true},
to: {symbol: MAIN.fbFlow.rFlow_gps, op: "<", value: 5.0}}
fine_pulses: {kind: pulses, symbol: MAIN.fbFine.bPulse}
metrics:
bias_g: {measure: final_error_g, stat: mean}
sigma_g: {measure: final_error_g, stat: std}
cpk: {measure: final_error_g, stat: cpk, tolerance: 5.0}
criteria:
- {metric: bias_g, op: abs_le, value: 2.0}
- {metric: sigma_g, op: le, value: 3.0}
- {metric: cpk, op: ge, value: 1.33}
writes_allowed: [GVL_Recipe.rTarget_g, MAIN.fbDispense.fbPreact.rLambda, MAIN.bStartFill]exp_template returns a complete one for a dosing machine; exp_validate checks structure, resolves
every symbol on the connected PLC, and asks the server guard whether each write would be allowed;
exp_run dry_run=true prints the plan and writes nothing. exp_run then executes in the background —
per run: preconditions (wait_until) → factor values written → snap_save → capture profile started
→ stimulus → done_when → settle → stop → measures from the PLC-timestamped recording → append to
runs.jsonl. Factor symbols are read first and restored at the end or on exp_abort; two consecutive
failed runs stop the experiment. Resume continues where runs.jsonl stopped.
exp_evaluate is deterministic from runs.jsonl: per level the metrics with 95 % CIs (t for the
mean, χ² for σ, propagated for Cpk) and each criterion as pass / fail / inconclusive — inconclusive
when the limit lies inside the CI, with the run count that would (roughly) settle it. Five fills give
σ a ±40 % standard error; the report says so instead of rounding it away. exp_report writes
report.md + report.html: machine serial, device/TwinCAT version, project + git state, safety mode,
criteria table, metrics per level, charts (primary measure per run with limit lines; per-level mean/CI),
run table with recording ids, the spec as run, the audit log of every write during the experiment,
and an Interpretation section stored separately and labelled "not computed". exp_compare a b
puts two experiments side by side with "separated" where the CIs do not overlap.
Safety: every written symbol must be in writes_allowed and pass the guard — checked before anything
moves and again before every single write, so tc_set_mode readonly is a working kill switch; each
write is pinned to the machine the experiment started on (an ads_connect elsewhere makes the next
write fatal) and audited with symbol, value and run. Writes are scalars only (a struct write would bypass
the member deny-list). A run counts as started only when the machine leaves the done state within
start_timeout_ms; a rejected start is a failed run, not an instant pass. Factor originals are read and
checked for writability before the first run, restored and read back afterwards (or on abort, after any
run.on_abort safe-state writes); an abort interrupts a wait within a second; a timed-out write ends the
experiment because the PLC state is unknown. One experiment per target at a time; starting is
control-class (confirmation in guarded mode). The physical safeguards stay yours.
Looking up Beckhoff documentation
The infosys_* tools exist because the documentation MCP servers available for TwinCAT ship a
pre-built index, and an index is only as complete as the crawl that made it. Against the one tested
here, infosys_search_symbols("ADSREAD") returned nothing, infosys_get_page reported a live
Tc2_System page as not found, and TON ranked BA2 helper functions first. This server does not ship
an index:
Source (0.8.3+): the Help Viewer package on this PC, by default. TwinCAT XAE installs the complete Information System as
BKINFOSYS3_VS_100_EN-US.<n>.mshcunder%ProgramData%\Microsoft\HelpLibrary2\Catalogs\<catalog>\ContentStore\EN-US\(≈ 1 GB, ≈ 50k pages, ≈ 280 books). It is a zip of<book>/1033/<pageid>.htmlwith the same page ids as the website, so every page is stored under its realhttps://infosys.beckhoff.com/content/1033/<book>/<id>.htmlURL.docs.source = "local"(default): no network call at all, no web fallback; the newest package is found automatically ([docs] mshcto pin one). One index (0.8.11, rules indocs/KNOWLEDGE_BASE.md): every TwinCAT 3 book of the package, built as a whole in its own process into<knowledge folder>\index\infosys-1033.db(without a knowledge folder:<cache_dir>\helpviewer-1033\index.sqlite) — the same file theinfosys_*tools and the twincat-docs skill read. The first build starts by itself; after that a new package or a plugin update that changes the stored format is reported (tc_doctor,kb_status, every answer) and the index is used as it is until you approvekb_rebuild(index='infosys')or runtools\infosys_local.py index; the rebuild replaces the index only when it is complete. Results carry the page's doc version (Microsoft.Help.DisplayVersion) andsource.modified— the package is as old as the last Help Viewer update on this PC; check that date before trusting a page about a new build or library version.infosys_get_pagereads any page in the package, indexed or not, with its breadcrumb.docs.source = "web"brings back the behaviour below.What exists (web) comes from
infosys.beckhoff.com/sitemap.xml(every English page URL with itslastmod), cached a week.infosys_booksgroups it by book (tcplclib_tc2_system,tf6100_tc3_opcua,el3xxx…) with page counts; TwinCAT 2 books are dropped (tcplclib<name>without underscore,twincat2/).Tc2_System,Tc2_Standard,Tc2_Utilitiesare TwinCAT 3 libraries and stay.What is indexed is per book, on demand:
infosys_index tcplclib_tc2_systemfetches its pages (≈300, parallel, ~30–60 s), converts each to Markdown with our own HTML walker, classifies the page (FunctionBlock / Function / Struct / Enum / Alias / Interface / GVL / Library / Page), extracts the declaration from theVAR_INPUT/VAR_OUTPUTcode blocks and attaches the description tables, and stores it in SQLite with FTS5. A later run refetches only pages whoselastmodchanged. The firstinfosys_search_symbols/infosys_declarationindexes the default libraries (docs.books) if nothing is indexed yet.infosys_declaration ADSREAD→{kind, inputs:[{name,type,default,description}], outputs, in_out, members, enum_values, return_type, extends, implements, declaration, url}— call it before writing code against a library FB you have not used.infosys_search_code "IDXGRP:=16#F005"finds the example that uses a constant;infosys_search "rising edge"is bm25-ranked full text with excerpts.infosys_get_pagetakes a URL,book/pageid, a bare page id, or a symbol name, fetches live (cached bylastmod) and returns Markdown — for any page the site has, indexed or not. Host-locked to infosys.beckhoff.com; the server is not a general web fetcher.Web fallback: when the local index has no hit,
infosys_searchasks DuckDuckGo forsite:infosys.beckhoff.com <query>, keeps only URLs that are in the sitemap and in TwinCAT 3 books, fetches them for title/excerpt and caches them.backendin the result says which path answered.docs.web_fallback=falseturns it off.
Config ([docs] in the TOML / TCMCP_DOCS*): source (local | web), mshc, enabled, cache_dir; for the web
source books (indexed first), exclude_books (regexes), tc3_only, max_workers (≤16; be polite),
max_index_pages, sitemap_ttl_days, web_fallback — the local index holds every TwinCAT 3 book whatever they
say. The infosys_* tools are read-only class; kb_rebuild is control class and always asks for approval.
A debugging session
> ads_status → PLC RUN, system RUN, TwinCAT 3.1.4024.x
> ads_read MAIN.fbFill → whole FB instance expanded: eState=3, tSettle=T#500ms, …
> ads_watch [MAIN.fbFill.eState, MAIN.fbFill.fbValve.bOpen] 5000ms 20ms
→ eState 3→4 at 812 ms, bOpen never true
> proj_resolve_symbol MAIN.fbFill.fbValve.bOpen
→ FB_Fill.TcPOU:14 (fbValve : FB_Valve), FB_Valve.TcPOU:5 (bOpen AT %Q*)
> proj_get_code FB_Fill → CASE eState OF … E_FillState.Bulk: fbValve.Open();
> proj_search "fbValve\.Open" → only one call site; the state that reaches Bulk is never entered
> xae_pou_set … / proj_set_code … → fix
> xae_build → 0 errors, 1 warning (file:line)
> xae_deploy → asks for confirmation, then save/build/activate/restart
> ads_wait_until MAIN.fbFill.bDone == TRUE 30000Verify-on-hardware list
Install, configuration and a 14-step zero-write smoke test: docs/INSTALL.md. Ordered first-day script that then exercises every layer, with expected outputs and what to paste back per failure: docs/HARDWARE_DAY.md.
The XAE and System-Service paths are written against Beckhoff's Infosys documentation and tested against fake COM/ADS objects; this repo was built on Linux, so the following have not been executed against a real XAE shell or IPC yet. Check them in this order on the engineering PC, with a non-production target:
tc_doctor→ router ok, ProgIDs registered, running shell listed.xae_attach→ correct instance/solution;xae_statusshowstarget_net_id.xae_build→error_sourceshould beWindows.ErrorListorDTE2.ToolWindows; if it saysOutputPanethe late-binding fallback is in use (still works, less precise).xae_pou_geton a POU →declaration/implementationpopulated (late-boundDeclarationText; Beckhoff's own PowerShell examples use it this way).xae_plc login→ if "no working DTE command", runxae_list_commands PLCand put the right name intoPLC_LOGIN_COMMANDSinxae_backend.py. On the 64-bit 4026 shell thePLC.*commands are reported missing by other projects;ads_plc_statecovers run/stop/reset without the shell.ipc_read_file C:\TwinCAT\3.1\TwinCAT.xml→ file access (FOPEN/FREAD/FCLOSE).ipc_list_dir C:\TwinCAT\3.1\Boot\*→ FFILEFIND struct layout (4-byte handle + WIN32_FIND_DATAA) is the least certain piece here.ads_ethercat→ index groups 0x3/0x100 (master state) and 0x6 (slave count) on the master's ADS port.ipc_start_processwithnotepad.exe, thenipc_rebooton a test box.tcunit_runend-to-end.rec_start mode=changeon a few booleans, toggle them,rec_stats→ edge timestamps plausible against the task cycle.ads_task_stats,ads_app_info→TwinCAT_SystemInfoVarListmembers resolve by name (they are not in the uploaded symbol table).ads_call_methodon a method marked{attribute 'TcRpcEnable'}→ check theinstance#methodhandle name and the packed parameter layout against the result.ads_types ST_<something>thenads_readof anARRAY OF STRUCTvariable → datatype-table parsing (AdsDatatypeEntryincl. the optional GUID/attribute/enum tails) against a real table; compare offsets with the TMC. On failure the server falls back to published members and reportsdecoder: nonefor arrays of structs.exp_run <name> max_runs=1on a harmless spec → the stimulus write, the start acknowledgement, the done condition and the restore appear intc_audit_tailasexp_writerows; thenexp_abortduring a run → factor restored, no recording left inrec_list.infosys_get_page ADSREADandinfosys_index tcplclib_tc2_system→ the HTML walker was written against the page shape reported through a Markdown converter, not the raw HTML (this repo was built on a host that cannot reach infosys.beckhoff.com). Check: title = symbol name,kindsin the index result mostly FunctionBlock/Function/Struct,infosys_declaration ADSREADlists NETID…TMOUT with descriptions. If titles come back as "Beckhoff Information System" or kinds are allPage, the H1/<pre>selectors ininfosys.py::_MdWalkerneed the real markup — one page's HTML pasted back is enough.scripts\launch.cmd(used by the.mcpb) → Python discovery orderTCMCP_PYTHON→py -3→python→%LOCALAPPDATA%\Programs\Python\Python3*; the Microsoft-Storepython.exestub fails the version probe and is skipped. Run it once by hand with--no-runand watch stderr.
Anything that fails: the tool error text contains the ADS/HRESULT code; paste it back and the fix is usually one constant.
Changelog
0.8.19 — PLC libraries through XAE, and the 0.8.18 retest (N194 – N196, N180) fixed at their cause. Libraries (+8 tools, TE1000 ITcPlcLibraryManager): xae_library_list gives the references as XAE holds them — libraries (name, version, distributor) and placeholders (default and effective resolution) — and flags a library referenced twice, a version that is not installed (ScanLibraries) and the references or requested versions that differ from the saved .plcproj of the open solution (an unsaved resolve or freeze cannot be seen there, and it says so); xae_library_installed lists every installed version; xae_library_repositories the repositories (or that this XAE does not give them). xae_library_add, xae_library_remove, xae_placeholder_add, xae_placeholder_resolve and xae_placeholder_freeze run once, carry XAE's messages and the references before / after, and never build; guarded mode asks, the confirmation names the PLC project and the reference (remove: its kind and version too); a name referenced twice (a placeholder and a library) is refused until kind says which, and if XAE removes the other one the result says so. A TwinCAT restart during a python recording (N194): a change-mode recording across RUN → CONFIG → RUN received nothing after the restart and verified PASS. The python engine now reads the runtime when no sample came for a second; a task cycle count that started again (or an outage of 3 s or more) is a restart: the same program gets its notifications registered again and the span is marked in the file (_restart, resubscriptions, runtime_restarts, label INCOMPLETE); another program ends the recording; one failed read is no restart. PLCopen replace (N195): a library reference missing from the listing right after the import no longer stops a replace; what seems removed — or a renamed copy that should be there — is listed again before anything is said, and a refusal names the copies it leaves. Unknown arguments (N196): every tool refuses an argument it does not have, before it runs (tcunit_results(path=…) read the boot result file instead). Scope and a TwinCAT restart (N180): after a recording with Scope, the Scope View log's state lines since StartRecord are walked — a restart that cut the capture, Scope recording again after it, or a router stop while Scope was not recording — and said in the result and the signed link (restart_seen / restart). Two review rounds per part (independent reviewers): every HIGH / MEDIUM fixed with a test red before; the LOW left are in docs/TRACKER.md.
0.8.18 — the 0.8.17 retest (N189 – N193) and an in-depth review of the 0.8.16 – 0.8.17 Scope and recorder code, fixed at their cause; no addition. One Scope, one owner (N189): two recordings with Scope at once each got a part of the one Scope — the second stopped Scope at its end and saved the first one's capture, which was then saved and signed again for the first. Now a recording's Scope part owns Scope until it is finished, a call starting it from its check on (two starts sent together cannot both pass), a Scope recording of its own (scope_record start / new) until scope_record stop. Under another owner rec_start(also_scope=true) is refused before anything starts ("Scope belongs to recording …"; the 'ask' policy does not offer Scope, scope_note says why) and scope_record start / stop / save / disconnect / new are refused before they act; after scope_record stop the next recording with Scope asks to disconnect first, as after a recording. Scope's span (N191): a capture that begins later, ends earlier or runs past its recording by more than 1 s is said in the result and in the signed link (scope_span: covers x s of y s). Audit (N190): the disconnect question and the choice after a recording. xae_links (N192, N193): on TwinCAT 3.1.4026 the PLC instance has no tree children — it said "0 unlinked"; it now reads the variables from the instance's XML and the links from the mapping table (ProduceMappingInfo): link targets per variable, array element and member, the unlinked variables and elements (arrays of structs too), links whose variable is gone, and not_checked where gaps cannot be checked (a multi-dimensional array, a struct linked member by member); what cannot be read is said (unlinked_count null), never counted as 0; the instance path is accepted (every tool taking a PLC project path does). Review fixes: a rec_start cancelled during the start check no longer leaves rec_stop / rec_delete waiting forever with Scope recording; a StartRecord whose outcome is unknown (shell gone, E_POINTER after acting) stays with the recording and is stopped (it was "NOT started"); the start check reads only lines written after this StartRecord (another start's line confirmed a refused one); an answer to a Scope question is applied once, to the state it was asked about; 'new' says what ran when its StartRecord did not, and holds Scope between its Disconnect and its StartRecord; a dialog the shell shows after StartRecord is said again (open_dialogs); a delete between a finish's check and its link no longer leaves a signed link to a deleted recording; XAE messages read after a failed before-read are marked as possibly earlier calls'; the stale-data check compares one clock at a time (a start the Scope View log confirmed is this run's; without PLC time and confirmation it says it cannot tell). No index changes format. Not in this release: the offline documentation work (held); libraries are planned for 0.8.19 (docs/PLAN-0.8.19.md).
0.8.17 — the Scope part of a recording has one owner (N182 at its root): each rec_start(also_scope=true) recording's Scope part is run by one task that takes, in order, the recording's end (it watches the recording), rec_stop / rec_delete asking to finish it and a stop asked again — in 0.8.16 four actors shared five tables and every review found another interleaving. The fourteenth review's findings are fixed with it: rec_stop / rec_delete with Scope carry solution_mismatch / reattached again; SaveSVD refused right after StopRecord ran says that StopRecord ran and that scope_record(action='save') saves what Scope holds (no "repeat it"); no "retry in a few seconds" after a busy text that withholds "repeat it"; a StopRecord refused before it ran (XAE busy, a dialog another call opened holding XAE, the XAE worker busy) is asked again by the next rec_stop(id) — also after the recording was deleted: rec_status shows the part (by its id or a unique prefix; a recording the recorder still holds is never said deleted), rec_list lists it under scope_without_recording; a StopRecord a dialog holds or that timed out is stop_unknown — never sent again, and Scope is not said to be stopped or not; a StartRecord a dialog holds is start_unknown and stays with the recording (0.8.16 said "NOT started" and Scope recorded with no owner) — the link then has started: null and start_unknown; the part exists before StartRecord runs (state: starting), so a rec_stop meanwhile finishes it; a rec_start cancelled before its StartRecord ran (still queued behind another XAE call) is not started — nothing of Scope is stopped or saved for it; the link's started is when StartRecord ran; finished_by comes from the recorder's own stop reason — a rec_stop just after the recording ended by itself says that end, a call still stopping the recording is never labelled as one that ended; a rec_delete cancelled during its stop or its file removal waits for the delete's outcome — nothing saved for the deleted recording, finished_by names rec_delete; rec_delete while the part is being saved (the recording had ended) lets that save complete, then deletes the ADS recording and lists the Scope files that stay (scope_files_kept — rec_delete removes the ADS recording and its exports, never Scope's files); a recording deleted while Scope was saved gets no signed link; scope_record(save) with the export tool and an existing CSV names its own way out (another path). Scope after a recording (Ryan's decisions, 2026-10-21): every Scope file the plugin saves goes to <recordings>\Scope Recordings\ (0.8.16 and before: <recordings>\scope\ — those files stay where they are; [scope] export_dir still overrides); rec_delete never deletes them. After a recording Scope holds its data (state Reply) until it is disconnected, so the user chooses what Scope does next: close (Disconnect — XAE's Scope view is cleared, Scope is ready for the next recording), new (Disconnect and start a new Scope recording at once — on its own, stopped and saved with scope_record) or pause (Scope keeps the data to look at in XAE). rec_stop asks with a prompt (scope_next); after a recording that ended by itself rec_status carries the question for the agent to ask (a read-only tool does not act); a client without prompts gets the question in the result. The next recording with Scope while Scope still holds data asks to disconnect it first — rec_start(scope_disconnect=true / false) is the answer. scope_record(action='disconnect' | 'new'): without the plugin's own saved recording in Scope, discarding what Scope holds needs the user's confirmation. The 0.8.16 retest (S1 – S4): N186 — Scope in Reply (still holding the previous recording) refuses StartRecord, and StartRecord's return value does not tell (1 when it records, 1 when it refused): the Scope View log does — a start it refuses is NOT started with Scope's state and how to bring it back to Config (Disconnect in XAE's Scope View), scope_record(action='start') too; a start the log confirms says so (start_check); and Scope data whose CSV says it ends before the recording began (Starttime / Endtime of export) is never linked to the recording nor sealed (not_this_recording) — the previous capture was saved and signed as the next recording's. N185 — TcScopeView.log begins with a binary header whose length field changes with every write: the log is fingerprinted from its first text line, so only the lines written since the call began are reported; truncated when more errors were found than shown. N187 — Python engine: the connection is closed after the drain's last program check (it read the symbol version on a closed connection: the tail was dropped, verdict FAIL with a lossless counter). N188 — a result without xae_messages says whether XAE's message buffer was read and empty or could not be read (xae_messages_note; an error: "XAE messages (…): none …" / "not read: …"). N181b — a call a dialog refused at its first COM call says nothing of it ran. No index changes format. Not in this release: the offline documentation work (held).
0.8.16 — XAE messages and the 0.8.15 retests outside the documentation (S2 – S4), fixed at their cause, with independent reviews. XAE messages: what TwinCAT's System Manager logs during an action (ITcSysManager2::GetLastErrorMessages: activate, restart, build, ConsumeXml, CreateChild / DeleteChild, PLCopen import, boot project, online commands) comes with its result as xae_messages — TwinCAT's own text, also warnings on success; a failed action's error ends with "XAE messages (…)", and with what the call's earlier steps logged — also the steps of xae_deploy, xae_activate_configuration, xae_restart_twincat, tcunit_run before the one that failed; a call XAE rejects after an action of the same tool ran says which ran instead of "repeat it"; the messages are taken in the worker that ran the call, so a call queued behind never gets another's; a buffer that held something before the action is earlier_messages, not the action's. Scope: every numbered Scope View log (TcScopeView_1.log …, a second XAE shell) is read, scope_view_log.logs_checked / logs_written (N179); a recording that ends by itself (duration, stop_when, max_events …) finishes its Scope run — once, whichever of it and rec_stop comes first, finished_by says which, also when rec_stop is cancelled or times out before its Scope part (who ended the recording is the recorder's own stop reason); rec_delete stops Scope and saves nothing; a StopRecord XAE refuses is asked again by rec_stop; a StartRecord XAE refuses says the ADS recording runs and not to repeat rec_start; rec_status / rec_list show the Scope part (N182); SaveSVD refused after a TwinCAT restart is said as that, with the time from the Scope View log (without a reset line in the log: the state Scope is in; a log missing or unreadable is said so, no restart invented), and XAE's ExportCSV of what Scope still holds is recovered or the run's Scope data lost (N180). XAE: the interface replace reads TwinCAT 3.1.4026's export — InterfaceAsPlainText of the interface, its methods and properties (N175); a call a modal dialog refused did not run — a read-only tool says nothing was changed, any other that its earlier steps may have run (N181); the shell's own main frame is never a dialog (N176). Confirmations: the question says it expires after 10 minutes; a late answer is logged in server.log and audited confirmation expired (N178). Multi-PLC: wf_debug_symbol names the PLC project a name is in, as proj_resolve_symbol does (N141b). Recorder: rec_status / rec_list no longer fail while another recording is started or deleted during the reap of one that ended (and the Scope watch no longer takes such a failure for the recording's end); the Python engine's footer has overflow_samples, requested_s, missing_head / missing_gaps / missing_tail and verdict_hint as the native engine's. No index changes format. Not in this release (held): the error index and err_lookup (N125) and the documentation items of the 0.8.15 retest (N177, N183, N184).
0.8.15 — the 0.8.14 retests (§34 – §34j: N140 – N175, N44) and kb_verify I13 fixed at their cause, with three independent reviews of the work and of their fixes. After the update, once: three indexes change format and are reported as rebuild_needed — each answers as it is until you approve its rebuild: Infosys 7 (kb_rebuild(index='infosys')), ESI 2 (index='esi'), manuals 6 (index='manuals'). Infosys (format 7): a page's kind comes from its own evidence, never from its samples — an FB whose sample declares a STRUCT stays an FB, operator pages are Operator, method pages Method, "returns TRUE/FALSE" is a BOOL return; the header in a page's Syntax section counts, also FUNCTION BLOCK X written with a space (N150, N151, N157, N172). Symbols documented inside a page (N170): ## Method X sections with parameter tables are methods with a declaration reconstructed from the tables (RecipeManCommands' methods), the FB the text names gets its method list, IEC constant tables are Constants with value, type and GVL (ERR_RECIPE_NOT_FOUND → 16#4003), the build log counts them; a name only a title has as a word answers that page (match: title, outline). A page whose Syntax section declares another name than its title: the header is its declaration (declared_as) only when nothing contradicts it — no other page of its library documents that name, its tables document nothing the header lacks, it does not derive from the page's own symbol (tf8560's ActualsActuator declares FB_ActuatorActuals EXTENDS FB_MotionActuals, and FB_ActuatorActuals finds it); otherwise it is another symbol's header, Beckhoff's copy of a neighbour's (F_TimeToSeconds() shows FUNCTION F_SecondsToTime), and syntax_header_note says why. 'Definition:' under a Syntax heading no longer hides the declaration below it; SEL's syntax keeps the lines its 'means:' introduces. FB.Member follows the FB's definition location, EXTENDS and IMPLEMENTS (FB_TcMessage.Send → I_TcMessage's, defined_in), in the owner's library first (N158); the near list offers the owner and where the member comes from (N159); an owner documented differently by several pages is not guessed — the note names the library= that finds the member; FB_X.Member finds member pages titled LookUp(), SendAlarm(), GetHMI (4.1); member pages below two different symbols are never one document (FB_JsonSaxWriter.AddKey / FB_JsonSaxPrettyWriter.AddKey). Search: IEC keywords in capitals (THIS, FOR, BY) and operators as written (REF=, THIS^) are searched and put their page first — an acronym (PLC, LED) is a word like any other (N148, N149); words_ignored lists only words not used (N166); infosys_search_symbols takes globs (N161). Paging (N167): infosys_search, docs_search, hw_search, manual_search / manual_page page with offset / next_offset in one order; a limit above the maximum is used as the maximum and said (clamped); CLI search / show --offset (N168); ranges in -h and the MCP schemas (N169). infosys_get_page reads like docs_page — section, offset, outline, one max_chars range 200 – 60000; the skill takes library=; an MCP not-found names what is near and how to search (N160). kb_search (N143 – N147, N171): results and notes by kind, members mapped to their owner, the project's own units first, punctuation-joined tokens searched as a sequence, changed_files / added_files / removed_files when the project index is stale, one-letter message names ignored, a unit whose name holds none of the words no longer ranks by its name. ESI (format 2): sub-index in hex (8000:11 = 17, N152), revisions_available (N153), decimal product codes (N154), one answer envelope for MCP and skill (N155), modules found by their devices (N156); a CoE object defined twice in one dictionary is one object — EL6653 and EL6653-0010 listed 17 objects and counted 19 (Beckhoff's EL66xx.xml repeats #x1C32 / #x1C33); a repeat that differs keeps the first and says so (defined_again_note, also in hw_lookup's object list); hw_search pages by title in SQL and reads a page in two full-text queries (limit 100: 3.7 s → 0.1 s). Manuals (format 6): product codes of every Beckhoff family (ED2008, AL, AA, PS, ERI …) — manual_product and hw_lookup answer from the page text meanwhile, never "copy its PDF" for an indexed manual (N163); hex / CoE index forms in any notation (N164); unit symbols as written (°C, mV/V, µs, N165); manuals_db.py search / product / toc / docs print the skill's commands. XAE: a modal window of any class is detected — main window disabled, the window it owns read through UI Automation (N173: About, Options), also with a hidden main window (xae.visible=false); "Call was rejected by callee" is "XAE is busy … did not run this call"; every COM access goes through the retry; crash tracebacks in ~\.twincat_mcp\logs\server.log (N174); an interface replace is checked against the XML's methods (N175); a listing that fails before a replace import imports nothing (N44). Server: the connection instructions say when they were read and that kb_status is current, and are read again at each initialisation (N162). Scope View log (N140): its NUL padding is no text, the mark of a call is where the log's text ends, a rotated log is told by its beginning, new_bytes counts text. Multi-PLC: a symbol of another PLC project names the PLC project looked in and where the name is (N141); a <PLC project>@Name pin names that PLC project, and a file several PLC projects compile is analysed in each and answered once when the results agree (N142); proj_variables names the PLC project it walked and resolves types in it; proj_list / proj_search / proj_references items carry plc_project; proj_validate_xml(fix=true) keeps one .bak per file per call. kb_rebuild gives the build's own pid (launcher_pid for a venv launcher), kb_status names it process_pid. Web cache: a lookup reads the index again when the background indexer changed it during the call (infosys_declaration answered a title page while the default books were being indexed). Not in this release: the error index (N125, 0.8.16).
0.8.14 — the 0.8.13 retests (§33, §33b, §33c, §33d) fixed at their cause: N127 (S1), N116–N124, N126, N128–N138, N99b, N103b, the Scope and multi-PLC audits, the knowledge-base agent findings, and what kb_verify found (search by a title that is the query; page ids that are not numbers). After the update, once: the Infosys index changes format (5 → 6) and is reported as rebuild_needed — it answers as it is until you approve kb_rebuild(index='infosys') (or tools\infosys_local.py index); format 6 stores each page's place in the Help Viewer contents (N126) and reads pages in their own charset (N138). Folders indexed by kb_add_project before need nothing (their stamp is compared the old way until the next kb_reindex). Knowledge base (N127, S1): kb_set_location (with a path), kb_add_project, kb_remove_project, kb_reindex are refused in readonly mode and audited (ok / error / refused) like every EDIT tool; kb_rebuild is refused in readonly and still asks in every other mode. kb_add_project refuses the plugin's folders, the knowledge folder and a folder inside or around one already indexed (N128); a new folder is registered in the transaction that stores its units; one change of knowledge.db at a time (index\knowledge.db.lock, a second is refused with what runs; kb_set_location waits for it); kb_status / kb_search never create index\ or knowledge.db. kb_set_location: a file is "a file, not a folder", \\?\ paths are local paths, cloud folders are recognised by folder name (D:\Toolbox Drive is no Box Drive), choosing a drive root is refused, path + use_fallback that differ are refused (N136). Project sources (N132): .Tc* files are read as XML is — BOM, UTF-16, the declared encoding; a file that is not valid UTF-8 and has no UTF-8 in it is read as Windows-1252 and said so; files that could not be read, read notes and files no PLC project compiles are named in proj_scan, kb_add_project, kb_reindex and kb_status; code and comments are indexed whole; proj_set_code and proj_validate_xml(fix) write a file back in its own encoding and do not edit one read with a note. kb_status gives each folder's state and kb_search lists stale folders (changed, renamed, deleted since indexing; .tsproj/.xti/.sln count) (N133). kb_search: the unit that declares the name first (declares, N131); kinds=['POU'] (N134); OR / AND / NOT / NEAR and operator characters are said not to be operators, single characters are not searched among other words, _ alone is refused, a phrase in a string literal is not "comments" (N135); an error message is decided by its code — ADSError 1808, pyads' ADSError: … (1808)., error 1861, error no. 1861, nErrId := 1861 / 16#745, 0x98110745, ADSERR_…, a compiler message — not by the word 'error', a number or a hex number anywhere, and the names of the code in it are searched (ADS error 1808 fbCounter, N129); ADS notes need a message about ADS ('not permitted', 'timeout elapsed', nCycleCount 0x705 of any program no longer get one), name the code and symbol (checked against the local ADS return-code table), and an error the plugin has no note on is known_error: null with what is covered — never searched as words (N130); 'not logged in' is not the logged-in note, and errors the plugin composed itself are not annotated. XAE (N116, N120, N123, N124, N42): every retried COM call takes the System Manager / tree item / Scope object of the live shell (a solution reopened in the same shell failed the first call); an action that must not run twice (activate, restart, PLC online commands, create / delete / import, shell commands, Scope actions) is never repeated — not after a busy read-back (an online command went on to PLC.Download), not on a re-attached shell after the shell went away during it, not after a stale-object error ("may have acted, not repeated"); before an action a stale System Manager is refreshed by a read; solution_mismatch and reattached are on the result of every tool that used the shell; xae_build(save_first) finds a property accessor's file and drops edits of objects deleted since; an XAE token's scope is the machine. Project: a pin (Plc2@MAIN) names the PLC project, not a substring of the path; with several PLC projects, a port means its PLC project in every reader — also when no name is declared twice (proj_variables port, CONSTANT check in full mode, PRG_B of Plc2 on 851), a pin still names another, and a file linked into several PLC projects belongs to each; the PLC projects and files are read in one order on every file system; ENUM / STRUCT return types (N137). Scope (N117, N119): scope_view_log reads the padded [ ERROR ] tags; rec_stop(also_scope) / scope_record save compare the CSV of the saved .svdx with XAE's in-memory export (cross_check); exports go to a work file and replace the CSV only when complete, a sealed CSV is never written over; a .svdx still being written is not sealed into the link. Docs: methods and properties link to their FB (parent / children, FB.Member, N126); the skill's docs_declaration gives the members like infosys_declaration (N103b); one source page placed twice in a book is one hit and the defining table comes first (N99b); a number that is the query is a code, and a code next to its word is found among other numbers (N121, N122). Two independent reviews of the release, and a review of their fixes, found the points above beyond the retest list (among them: the stand-in database of a first read left the first kb_add_project without a search table; ERR_… identifiers, numbers and model numbers were taken for error messages; decoding by a single valid-looking byte pair). N125 (error descriptions from three places) is the error index of the spec — not in this release.
0.8.13 — the 0.8.12 retests (§31, §32) fixed at their cause: N116 (S1), N113, N114, N103b, N105, N117, N118, the Scope View log, and the polish items. Nothing to rebuild after the update (no index format changed). XAE (N116, S1): the XAE tools are bound to one solution — the configured xae.solution_path, the one passed to xae_attach, or the only one open — and every call checks that the shell still has it open; when it was closed they re-attach only to a shell that has that solution, and otherwise refuse ("the solution … is not open in any XAE shell"), never acting on another shell's project or target; xae_attach never falls back to another solution and never picks one of several when none is configured; xae_status reports solution_bound, reattached, solution_mismatch. Project (N113, N114): the PLC projects of the project are those its .tsproj names (inline or in _Config\PLC\*.xti, with tree name and ADS port) — a .plcproj it does not name (the folder of a PLC project removed from the tree) is not part of the project (plcproj_not_in_project, its files in not_in_project, its tasks dropped); when the .tsproj cannot tell, every .plcproj counts and proj_scan says why; a .tsproj / .xti change rescans. Every file's units are kept, so MAIN of Plc2 no longer replaces MAIN of Plc1: xae_build(save_first) checks an edit in the PLC project its tree path names (it refused every build with two MAINs), and rec_start's task check takes the PLC project on the ADS port it records (it said "task configuration not available" with two MAINs, and with one after Plc2 was removed). With names declared in several PLC projects nothing is picked by chance: lists, searches and references show both (proj_list, proj_search); a name in two (MAIN, MAIN.Act, a method name alone) is refused unless pinned (Plc2@MAIN), for writes too; symbol resolution, proj_variables/proj_vs_runtime, pointer aliases, interface and CONSTANT checks use the PLC project on the connected ADS port (the CONSTANT check refuses in guarded mode when that cannot be told); proj_lint, proj_call_graph, proj_interface, proj_validate_xml, tcunit_scaffold and the wf_* workflows run inside one PLC project — a whole-project lint is each PLC project's, merged, every finding tagged plc_project; a .tsproj reference that cannot be followed keeps every .plcproj (said in plc_projects_note). Docs: the skill's docs_declaration gives kind, return_type and the parsed declaration with its header — the same answer as infosys_declaration (N103b: a reader of the skill never saw FUNCTION MEMCPY : UDINT); a symbol's library names query words too (N105: "EtherCAT slave state" lists the Tc2_EtherCAT slave-state symbols first, FB_EcGetSlaveState 5th — no word of the query tells Get from Set, Req or the ST_ type). Scope (N117, N118): rec_stop(also_scope) and scope_record save export the CSV from the saved .svdx with Beckhoff's export tool — XAE's ExportCSV right after SaveSVD lacked the end of the file — and use ExportCSV only without the tool, flagged; whether the saved file still grows after SaveSVD returns is watched and reported; a read-only .svdx (rec_stop seals it) is exported from a byte-identical writable copy (the tool exited 0 without a CSV on it; that read-only is the cause is not proven), and a run without a CSV says exit code, output, size, read-only state; the ERROR entries TcScopeView.log gets during these calls are in the result (scope_view_log, [scope] view_log). Scope robustness: file errors and undecodable tool output are messages, a failed Scope part of rec_stop keeps the stopped recording's result, a non-zero exit with a CSV is flagged, a log without [ERROR]-style tags gives its 'error' lines and says the format was not recognised. Two independent reviews of the work and of their fixes found the points above beyond the retest list. Polish: xae_plc with several PLC projects and none named says that first (it began with "needs a confirm_token … target ''"); xae_plc start/stop/reset while logged out is refused with "log in first" (it returned and did nothing); kb_status → builder_upkeep is labelled as what the server start did; label_reason names every cause of INCOMPLETE in both engines (a RUN→CONFIG→RUN gap was only in errors).
0.8.12 — the EtherCAT device descriptions get an index of their own, and the 0.8.11 retests (N37, N50, N93–N111, D19) fixed at their cause. After the update, once: the Infosys index (format 4 → 5) and the manuals index (page text format 4 → 5) are reported as rebuild_needed and used as they are until you approve the rebuild — kb_rebuild(index='infosys') / kb_rebuild(index='manuals'), or tools\infosys_local.py index / tools\manuals_db.py update; the ESI index index\esi.db does not exist yet, so its first build starts by itself (server start or the first hw_* call); knowledge.db's search table is rebuilt from its stored units at your next kb_reindex / kb_add_project (seconds, no file read again) — until then kb_search uses it as it is and says so. ESI index (index\esi.db, twincat_mcp/esi_index.py, builder esi_db.py): every ESI file of this PC — the .xml files under manuals\ (e.g. Beckhoff's ESI folder in manuals\Beckhoff_EtherCAT_XML) and TwinCAT's Config\Io\EtherCAT — read once: devices with PDOs (per-channel templates, gaps kept), PDO assignments with DC mode and init commands, slots resolved to their modules by rule, CoE dictionaries (sub-indices, array elements, decoded defaults, enum texts), diagnosis catalogues, modules; duplicates across folders by the vendor's FileVersion (also_in / differs_in); streamed device by device. hw_lookup reads it; new hw_search, hw_object, hw_diag, hw_module, and the skill's hw_* commands; knowledge.db no longer holds ESI rows (its old table is listed by kb_status, never dropped). Infosys format 5: a page's kind and return type come from its own evidence (N103 S2: FUNCTION MEMCPY : UDINT written as a heading, or only a return-value table, was a function block with no return type), a title that is a sentence documents no symbol (N101: "Attribute 'linkalways'" was a GlobalVariable), and every title's identifier words are indexed (FB_SocketConnect: socket, connect). One rule for which page documents a name (N100), shared by infosys_declaration, infosys_get_page and the skill's docs_declaration / docs_page: one page in several books is one answer (same_page_in), a C++/.NET page is no IEC symbol, library names compare without case, and different pages of one name — two libraries, or two methods of one library — are refused as ambiguous. One search for both readers (N105, N99): infosys_search and docs_search are the same code — identifiers as words, titles that name the query first, an error code's defining table (hex and decimal in one row) first (code_note), copies listed once. Measured on a copy of the real index with the format-5 words column: of the retest's four misses, FB_FileGets (2nd), FB_SocketConnect and F_GetSystemTime (1st) are now found, "EtherCAT slave state" still lists ST_EcSlaveState / FB_EcSetSlaveState before FB_EcGetSlaveState, and 0x745 lists the ADS return-code table first; on the format-4 index as it is, until the rebuild, the ordering helps less (identifier words are not indexed there). kb_search (N102): names and identifiers count as their words (FB_AlarmList: alarm, list), a unit whose code holds the words comes before a comment-only match (match_in), exact and prefix matches are both listed; one stop-word list for every search. The build lock is probed with a shared lock (N104: two readers probing at once saw a phantom "build RUNNING (0 of ? pages)"). Project (N106): the project is what its .plcproj compiles — a .Tc* file no .plcproj lists (a backup copy, an export) is no unit and is named in not_in_project; a .plcproj change rescans. Recorder: rec_compare works on native-engine recordings (N107 S2); rec_verify explains a counter that went back from the task's cycle counter recorded with the data, never "TwinCAT restart" for a program reset (N111). ipc_eventlog resolves the boot folder (N110 S2: boot: and boot are one prefix). wf_debug_symbol follows the symbol's scope (N111). exp_run(dry_run) archives nothing and says why its plan is short (N108). tcunit_scaffold outside the PLC project is not gated by config mode (N109). An output folder that does not exist yet is created inside the allowed roots (N98). proj_lint: an instance whose creation runs FB_init (a TcUnit suite) is not "never used". Manuals (N37, format 5): text below 1 pt is not page text. N50: an alias of a pointer is decoded from the project source. N93: a restart compares the application it read. N94: an unticked confirmation says so. N95: UTF-8 comments. N96: kb_rebuild checks before it asks. N97 (S2): PLCopen replace keeps foldered objects in their folder. D19: ESI templates. An independent review of the release found, and this release fixes: an ESI description replaced by a newer file left its objects behind (searchable, counted); every Profile of a device is read (their dictionaries joined, differences named); --no-twincat is recorded (no false OUTDATED); a work file left next to a current index is discarded; hw_lookup counts every match (not the first 200) and hw_search counts every variant; % / _ in a device query are literal; an out-of-range number is refused with a message; hw_object / hw_diag / hw_module start the first build too, and an .xml that is no ESI starts none; two pages of one book are never "one page in several books" (two FBs' methods of one name stay ambiguous); truncated says whether hits were cut, not whether copies were merged; a decimal number is an error code only next to a word that says so (error 1861, not port 851); wf_debug_symbol keeps bare uses of a global variable (a GVL without qualified_only) and reads aFill[i + 1].x as a qualifier; kb_search with quoted phrases only lists units with every phrase, and units whose code holds the words are read first; rec_verify counts resets it could not decide and those not assessed separately, and no longer slows down on long recordings with many repeats. Builders: manuals_db.py 6, esi_db.py 1 (new), stub 2.
0.8.11 — the 0.8.10 bug list fixed at its cause (N5, N37, N75–N79), the long-standing ADS stale-address defect, and permanent ground rules for the knowledge base (docs/KNOWLEDGE_BASE.md). After the update, once: the knowledge folder's indexes are moved into index\ (a rename, nothing copied or deleted); the Infosys index (format 4) and the manuals index (page text format 4) are reported as rebuild_needed and used as they are until you approve the rebuild — kb_rebuild(index='infosys') / kb_rebuild(index='manuals'), or tools\infosys_local.py index / tools\manuals_db.py update; helpviewer\infosys_en.db (the builder's old second index) is no longer read — kb_status lists it with its size, delete it yourself. ADS (root): pyads keeps each name's address for the life of a connection, so after a download, an online change or a restart with another build ads_read_many, ads_watch, polled recordings and the restart witness read the old offsets — another variable's bytes with no error. Every read and write by name now goes through a symbol handle made in the same request as the symbol version (0xF008): a handle names the variable, so the runtime answers for that variable or refuses the handle; a value of another symbol version is never decoded (renewed and read again). One sum request per call, per-item error codes, the same value conversion as a single read. ads_dump (N76): max_total_mb is the size of CSV + JSON on disk, known exactly before each row is written (the row, the tree after it, and the largest ending still possible) — nothing estimated; a limit below the files' own frame is refused; the result names written_mib and limit_counts. Restart proof (N75): the after-witness is taken in RUN from the runtime that came back, a counter that ran on outweighs one poll without an answer, the compile timestamp is compared by its number, an unreadable value says why; steps.restart.duration_s lasts until RUN was seen again (N5, command_s the shell part). Confirmation tokens (N78): tc_request_confirmation(action='xae_plc', args=…) gives no token for a PLC project the open solution does not have. Recorder (Python): rows are written in PLC-time order, the root of rows past a later end. Knowledge base: one layout (index\infosys-<lcid>.db, index\manuals.db, index\knowledge.db; manuals\ and sop\ are yours and never written), one Infosys index — the builder runs the plugin's own extractor, and the infosys_* tools and the twincat-docs skill read the same file; text normalised once when indexing (links as page addresses, table cells as plain text with the type's page as type_ref — N77, no invisible marks, no image placeholders); every index records its format and source, and a test fingerprints the code behind each format; the first build of a missing index starts by itself, every later one only after your approval (kb_rebuild, new, control class); builds write <index>.building and swap when complete, the ESI part of knowledge.db changes in one transaction; the plugin deletes nothing. Manuals (N37, format 4): text of font size 0 or fully transparent is not page text — the invisible copy of the running header under every heading no longer doubles headings and toc titles; an update of a complete index changes nothing. Docs search (N79): a query of stop words only is refused, as in kb_search. Builders: infosys_local.py version 3, manuals_db.py version 5. ADS: one STRING codec, Windows-1252, for every read and write (N91: ü failed or was written as two bytes; a character a STRING cannot hold, or a text too long, is refused before anything is written). D5: BOOL members read as 1/0 — the 4026 datatype table aliases BOOL to BYTE and the decoder followed the alias; a scalar alias now decodes by the first elementary name of its chain (BOOL stays BOOL, TYPE T_Level : UINT is a UINT), else by the runtime's data type id — an enum with an unsigned base reads unsigned. Values as a read returns them (an enum {value, name}, a TIME {raw_ms, text}, arrays of them) are accepted back by writes, snapshot restores and comparisons, and ads_wait_until sees an enum condition that already holds. N50: an unknown type name was sized by guess; the datatype table decides now, so a TYPE PT_X : POINTER TO … alias is an address with the pointer note in ads_read, ads_read_many, ads_dump and recordings. Recordings (R43): a recording is of one program — a block sample is written only once a symbol version read taken after it returned the version the recording started with; a download or online change ends the recording at the last verified sample (program_changed), a restart of the same program continues (program_watch.notes), samples never verified are counted (unverified_rows), not written; the start refuses addresses resolved against another version. A sample that reaches the recorder after its last drain is counted in after_limit, none twice. Native engine (N84): rows before a trigger window are counted (rows_before_window) and skipped by the readers and rec_verify. Confirmations (N89, N90, MCP SDK 2.3): on MCP 2026-07-28 a server cannot call the client, so the in-chat confirmation never reached you on 0.8.10; the question is now returned as an input-required result (sealed by the SDK, bound to the tool, its arguments and 600 s) and elicitation/create is kept for earlier revisions; a refusal says what blocks the prompt (the client declared no elicitation, or the transport has no channel); tc_doctor → elicitation (works, route, why). Every error reaches the model with its text; a defect says its type and is logged under a crash id. XAE (TE1000 Automation Interface): xae_plc uses ITcPlcOnline on the PLC project first (Login with its flags, Logoff, Start, Stop, Reset cold/origin, the state read back — method), then ConsumeXml (a refusal carries GetLastXmlError), then the shell's commands; xae.silent_mode (opt-in) sets TcAutomationSettings.SilentMode for one confirmed activate / restart; xae_check_all_objects (N82) clears the Error List and reads only the Build pane lines of this run, a failed check returns its findings; a graphical body (CFC, FBD, LD, SFC) is recognised by ITcPlcImplementation.Language before any text is compared (N81); PLCopen import options come from the live type library (the two TE1000 pages disagree on REPLACE / RENAME) and the value used is in the result; xae_pou_create(kind='property') creates the Get/Set accessors (N80); activate / restart compare the application's compile timestamp before and after (plc_application); xae_tree_get names TIRT for tasks (#28). Dialogs (N85–N87): a call held by a modal dialog it opened is reported after about 2 s with the dialog's title, text and push buttons, every XAE call is refused until it is answered, and the call's late result is in xae_dialogs; check boxes and radio buttons are listed as options and never clicked (N86); a dialog already open when a call starts is reported (N87); xae_deploy stops before its next step (with what was done) when a step left a dialog waiting; a progress window (Cancel only) stops nothing. An ITcPlcOnline command whose state does not follow within 5 s is reported as possibly done and never sent again through another route. Project (N88, N92): the project index is built aside and published whole — parallel ads_dump calls no longer report "no project configured", and no tool sees a half-built index; a PROGRAM or GVL of the source with variables but no symbol on the target is named by ads_dump (not_on_target) and proj_vs_runtime (roots_not_on_target) with its cause, and xae_build names GVLs nothing in the source references (link_warning: TwinCAT does not link them; {attribute 'linkalways'} does); with several PLC projects only the one whose symbols the target has is judged, and a name declared twice is never called missing; a // or (* inside a string literal no longer hides code from this search or from proj_lint. ads_dump (N47): a cut dump fills its limit (the 0.8.10 estimate left files at 64–67 % of max_total_mb). Infosys: a page is answered from the Help Viewer package while the first index is still being built (it failed with "no Infosys index yet" once converted). R30: the infosys_* descriptions describe the configured source. kb_status → builder_upkeep.pointer: written / unchanged / why not. D19 still needs the ESI file.
0.8.10 — 0.8.9 retest fixes at their cause (N38–N69, R40, R24; D19 still needs the ESI file) and an independent review of every fix. After the update, once: the Infosys index is read again in the background (R24 parser and code-space change, INDEXER_VERSION 3), and the manuals are read again (TEXT_FORMAT 3) — the first docs lookups say "rebuilding" until it is done. XAE: plcopen_import(option='replace') checks the copy against the imported XML (TwinCAT's plain-text declarations and ST bodies — methods, actions, property Get/Set — are the oracle, not the copy TwinCAT made), renames the declaration header back (PROGRAM PRG_X_1 → PRG_X; an unrecognised header, or the copy's name anywhere the XML does not hold it, writes nothing), checks the declared name after writing independently of the written text, and keeps every copy whose original is not verified (N38, N43–N45); a body that is not ST (CFC, FBD, LD, SFC, IL) is refused with the copy kept; a 'replace' whose project tree cannot be listed is refused before anything happens. xae_plc resolves the PLC project once and every route (ConsumeXml, named DTE command, generic command) acts on exactly that project; with several projects and none named, or a project list that cannot be read, nothing is guessed (N41). Confirmation tokens: the server computes the target every guarded tool checks (xae_plc → <action>:<project>@<NetId>, xae_command → <command>@<NetId>, xae_boot_project, xae_tree_delete), and tc_request_confirmation(action, args=…) uses the same rule — a token can no longer be issued for one project and used on another (N40, N42, N69). Restart proof (R40): a witness (mode, task 1's CycleCount, the application's compile timestamp) is taken before activate / restart; proven by a poll seeing another state, a start from CONFIG, a counter that went back, or a changed timestamp; "in RUN, restart not proven" is reported as that, never as "not in RUN"; a frozen counter is "cannot tell", not a restart. Infosys (R24): Help Viewer code keeps non-breaking spaces; they are normalised where the page is read, so infosys_declaration gives FUNCTION F_GetTaskTime : ULINT without a VAR_OUTPUT. Manuals (N37, N66, TEXT_FORMAT 3): running headers, footers and margin labels are found by their place on the page, not by repeated text — the section-title header and a footer with the page number first are removed, table header rows repeated at the top of continuation pages stay; a space set in its own font is kept ('Note that', not 'Notethat'). Knowledge folder (N64, N68): the builder stubs replace only files this plugin shipped (sha256 list, any line ends); your own scripts (*OLD.py …) are left alone; the pointer to the plugin is written before the stubs; a finished Infosys rebuild that is being swapped in reads as running, not as 'waiting — run index again'. Knowledge base (N70–N74, from your retest SOP): kb_search knows ADS errors in any notation (ADSError 1861, ADS error 1861, ADS-Error: 0x00000745, 0x745) and the compiler messages identifier not defined (C0046), cannot convert type (C0032) and unknown type, with the quoted names in cause and fix; an error message (a quoted name, an ADS code, a hex number, a C-number) is searched in the code only for the names it quotes; stop words are not searched (a query of nothing else is refused) and in the some-words tier words on no unit or on most units are not used (each hit names its matched words); a copy name no unit has (PRG_TcUnitRunner_9) falls back to the name it was copied from and says so; hw_lookup takes detail = newest (default: PDOs and CoE objects of the newest revision of each type, each type's newest listed first) / summary / full, and revision as shown (#x…) or as a number; infosys_declaration gives an FB's or interface's methods and properties as their own lists (by the page's headings), no longer inside description. Docs search (N65, N67): tiers "all words found in the index" → "some words" (which words each hit holds; stop words, words on no page and words on most pages are named and not used), a page titled like a query word first; a product code without its revision falls back to the base code (matched_as). Launcher (N46): a new venv is built beside the live one and swapped in on a later start when another window still runs the server; an older pending build never replaces a newer install; a health-check timeout is "unknown", not "broken". ads_dump (N39, N47–N55): every root read in bounded pieces (no 1802 for a big variable), a root that cannot be read named in the result, the CSV (NOT READ) and the JSON footer (complete: false); CSV and JSON come from the same decoded leaves; CSV header path,type,value,note (why a cell is empty: not expanded, no storage, outside the symbol); a NULL pointer is the address 0x0000000000000000; sizes in MiB; both files moved into place or neither, a partial commit reported as such; file names unique per dump (-2, -3 in the same second), an existing file is never overwritten (not even one that appears during the commit); a leaf the datatype table places past the symbol is never read from the neighbour's bytes — it is listed in unreadable_leaves, marked in both files, and the dump is not complete. ads_leaves(with_values) reads only the head of a value that is not expanded and says why a value is missing (value_note). Writes: a POINTER TO alias (TYPE PT_X : POINTER TO FB_X) or an alias of an interface is refused like the type itself. Recorder (N56–N63): rec_stop ends at the newest PLC time received and waits (at most max_delay_ms + 1 s) until every block has been seen at or past it — footer stop_on_request; in the Python recorder every other end at a PLC time (duration, post_trigger_s, stop_when, max_events) waits the same way (footer stop_at), so another block's samples still in transit are not lost (rows a block that ran ahead wrote past an end set later are counted as rows_after_window and skipped by rec_read, rec_stats, rec_export and rec_verify); rec_verify checks the file independently (its own window, one period of allowance, block_ends), reads a ≤ 0.8.9 stop as INCONCLUSIVE instead of lending it a tolerance, says INCONCLUSIVE for a change / poll recording without a counter= check that ran (intact, but nothing shows it complete), and fails on a block that never delivered or on symbols that could not be subscribed (a block that could not be registered with allow_partial is not counted as a block that never delivered); a block with one sample or none is counted with the other blocks' period (it read COMPLETE); counts in integer 100 ns ticks in both engines; a trigger with pre_trigger_ms 0 checks the head; a level start_when that was true only during the warm-up is reported (and a later fire is not reported as delayed); exports are written to a temporary file and moved into place, never over the recording; the recording's cycle_ms is compared with the task that runs each recorded program (per PLC project). TestBench.expect compares addresses as addresses (null matches a NULL pointer).
0.8.9 — 0.8.8 retest fixes (R42, #10, R7, R41, R15, R23, R11, R24, R32, N31, N32, N34–N37), the knowledge-folder builders in the plugin, and Python 3.12 as the one version (minimum and the only one tested). Python: requires-python >= 3.12, tomli dropped; the server, launch.py, launch.cmd, install.cmd, kb_docs.py (was 3.9) and the builders refuse an older Python with one line naming the version found; a venv an earlier plugin built on 3.10 / 3.11 is rebuilt with the configured Python on the next start; CI runs Windows and Linux on 3.12 only. ads_dump (R42, S1): a POINTER TO / REFERENCE TO / interface is dumped as its address and never expanded as the target (TcUnit's 1,000 POINTER TO FB_TestSuite had produced 4.7 GB of fabricated members); the pointer width comes from the declared size (4 bytes on a CX9020); one leaf budget (max_leaves) for CSV and JSON, max_total_mb measured on the bytes written, the root being written included; the JSON is written root by root (a cut root is {"_truncated": true, "_leaves": …}, NaN/Infinity as strings); the project's own programs and GVLs first, library globals (GVL_TcUnit, Global_Variables …) last; cancellation is checked inside a root, and a dump whose call already ended (timeout) deletes its .partial files instead of renaming them; the timeout names the phase, root, leaves and MB instead of router/firewall; the result names truncated_reason, skipped_roots, largest_roots. XAE: the outer PLC node and its nested <Name> Project are one PLC project (#10 — no more 'ambiguous' and the slow DTE fallback); plcopen_import(option='replace') that TwinCAT turned into a renamed copy at the project root (PRG_X_1) is finished by the tool: both objects read and compared at every level, the copy's texts written into the original, read back and compared, the original restored if anything fails, the copy deleted only once its original is verified (R15); a 'replace' is refused when the project tree cannot be listed; StartRecord returning 1 is a note, not a warning (R11). Recorder: native level triggers fire only after every notification block delivered (or 2 s), so every block starts at the trigger cycle (R41); rec_verify uses the engine's tail rule after a stop on request (R7); cycle_ms below the fastest task is flagged with fastest_task_ms (N31); an earlier export at the default path is only replaced with overwrite=true unless the re-export is identical — replaced says what was replaced (N32). Infosys / docs: a name documented in several libraries is refused with every library and page instead of picking one (R23); a function's return value is no longer listed as VAR_OUTPUT, also with a reconstructed header (R24); type names wrapped in narrow table columns are joined when a page is read — on the page's own declaration or in a Type column — and zero-width characters dropped, without rebuilding the stored index (R32, checked on synthetic pages only); hw_lookup takes the order code out of the ESI type (CX9020 EtherCAT slave, N34); near answers from titles (N35); docs_search / manual_search fall back from all words to prefixes to some words, match says which (N36). manuals_db.py version 3 (N37): running headers, footers and margin labels are removed from the page text (also where glued to a heading), a heading wrapped over two lines is one toc entry; an index of the older page text format is reported outdated and the next update reads every manual again. Builders: the knowledge-folder builders ship with the plugin (skills/twincat-docs/builders/infosys_local.py version 2, manuals_db.py version 3). They need Python 3.12 and say so on an older one instead of a SyntaxError (version 1 claimed 3.9 but did not compile below 3.12); they find the knowledge folder like the other tools (--kb, TCMCP_KNOWLEDGE_DIR, kb_set_location, the folder above the script). Infosys index: a rebuild writes <db>.building and replaces the index only when complete, one build at a time (<db>.lock, heartbeat) — an interrupted index --force can no longer leave a half index that the next run calls up to date; a version-1 index is upgraded by the next index. The real state (complete / outdated / old format / incomplete / missing, a rebuild running / interrupted / waiting) comes from stats --json, from every kb_docs.py answer (source.state), from kb_status → docs, from tc_doctor → offline_docs, and from the instructions the server sends at every connection and reconnection. search --book / --doc filter before the row limit; show / decl refuse a name several pages share and list them; links are kept (table link, ms-xhelp ids resolved) and docs_page / docs_declaration return them as refs. Manuals: one update at a time, state and progress in a meta table, PDFs not indexed reported. CI checks kb_docs.py on Python 3.9 and the builders on 3.12 (and their refusal below). Docs: skills/twincat-docs/builders/README.md.
0.8.8 — offline documentation as a skill, kb_* tools aligned with the knowledge folder, R33–R39. New skill twincat-docs (skills/twincat-docs/: SKILL.md + kb_docs.py, standard library, read-only) over the databases the knowledge folder's own tools build — helpviewer\infosys_en.db (tools\infosys_local.py, every Infosys page of the Help Viewer package) and manualsdb\manuals.db (tools\manuals_db.py, PDF manuals): docs_search, docs_declaration, docs_page, docs_books, manual_search, manual_product, manual_toc, manual_page, manual_docs, status, one JSON object each, with the builders' ranking, snippets and page references; a name in several libraries is refused as ambiguous with the candidates, filters run before the row limit (total exact), ranges are refused rather than clamped, invalid FTS5 is retried once as a phrase, ms-xhelp links open via the help id; the twincat-mcp skill and the server instructions send documentation questions there, never to ads_*. kb_status → docs: both databases with counts and package stamp, the PDFs not indexed / changed / gone, the folder's tools and SOPs, the exact command for this folder; kb_set_location names the documentation it finds and without arguments returns the current folder (R38); hw_lookup lists the manuals that mention the product code. Fixes: the whole ~/.claude/plugins tree is refused as a location (R33); reads never write-probe, a choice probes under a name of its own (R34); one project per folder in any spelling, the label works for project=, kb_reindex and kb_remove_project, earlier double entries merge (R35); kb_search finds units with every word first, then every word as a prefix (CounterMod → FB_CounterModule), only then some words (match says which), "quoted" phrases (R36); punctuation-only queries refused with a message (R37); kinds, project, limit checked (R39); relative paths refused; a label shared by two folders is not removed blindly.
0.8.7 — 0.8.6 retest and robustness pass (R1–R32, D46, D29, N29, #10/#45, D19). Safety of side effects: tools write files only inside known folders (recordings, project, solution, scope export, experiments, audit log, plus [server] output_dirs) and never replace an existing file without overwrite=true — rec_export, ads_dump, ads_export, tc_session_report, scope_record, scope_export, tcunit_scaffold (R4); tc_request_confirmation issues tokens only for real tool names (R2); tc_session_report returns a 25-line preview unless inline=true (R12). Workers: ads_dump runs on its own worker and writes *.partial files renamed on success; a queued call whose timeout ran out is withdrawn and says what the worker is busy with instead of cancelling the running job (R6). Recorder: every numeric rec_start argument validated before anything starts (R9); conditions refuse operator-led values, unknown types and bad literals and resolve enum names (R10); rec_snapshot reads the file for recordings of an earlier session (R13); counter checks per segment across PLC resets (D46); armed is false once the trigger fired or the recording ended, native engine included (N29); native tail slack after a manual stop (R7); rec_profile_start starts all groups on one PLC cycle via a shared CycleCount trigger, align=false for the old behaviour (D29). XAE: PLC paths split into the outer ITcPlcProject and nested ITcPlcIECProject item (R14); xae_plc login/logout/start/stop and Check all objects go through the Automation Interface (ConsumeXml online commands, CheckAllObjects) before the DTE commands (#10, #45); plcopen_import reports added objects and refuses a 'replace' that created duplicates (R15); COM methods invoked as methods (R11). TcUnit: results counted from the test cases, suite attribute mismatches reported (R3). Infosys: small lookup tables of what is indexed (catalog, code blocks, help ids) built once in the background — no page is re-parsed and no warm-up query runs (R18); code search normalises non-breaking spaces, ignore_spacing, validated languages (R17–R22); ms-xhelp links become page URLs, images and empty links removed, declarations tidied, quoted phrases kept, ambiguous declarations name also_in (R23–R32). Also: readable spec errors with line/column (R1), the 'datatype table unavailable' answers carry the config hint (R5), RPC 1797 explained with the parameter sizes (R16), unparsable ESI PDO rows carry the raw element (D19, parser v3).
0.8.6 — 0.8.3 deep test, last part (D20, D25–D29, D32, D38–D43, #10, N19b). XAE: xae_build / xae_diagnostics parse the 4026 compiler format File.TcPOU@Method(9) : error: C0185 … (file, object, line, column, code; they were empty, D41); xae_diagnostics reads the Error List late-bound (the cached 7.0 DTE wrapper has no ToolWindows), copies the Error List view when the automation interface reports nothing (TwinCAT's own Scope / Measurement warnings), merges the Build pane and names each source (D20); xae_plc login/logout finds Solution Explorer the same way and selects the PLC project node, then uses 'Set as Active PLC Project' where the shell offers it (#10); xae_status with no solution says so instead of a raw COM error. TcUnit: proj_libraries scans the 4026 repository ProgramData\Beckhoff\TwinCAT\PlcEngineering\Managed Libraries (D38) and gives effective for profile-managed placeholders (the only installed version, else "profile", N19b); tcunit_scaffold arranges enum inputs with a real member (E_Command.None, not E_Command.0) and lists the stub tests that fail until written (D39); tcunit_run refuses before activating anything when the project leaves GVL_Param_TcUnit.xUnitEnablePublish FALSE, stops waiting when the PLC reports FALSE, and names the resolved boot: folder (D40); its token target is the NetId (D43); xae_tree_delete tokens name the item (D42). Recorder: rec_pulses duty_percent over complete periods (the idle lead-in counted, D26) and the open first run is no pulse; rec_profile_stop after the profile ended gives the final status (D27); rec_profile_list updated always ISO (D28); rec_profile_start reports each group's start_offsets_ms from the PLC timestamps (D29); rec_snapshot counts a finished native recording's events (D32). Infosys: the background index reports pages inside the current book and seconds_since_progress (D25).
0.8.5 — 0.8.3 deep test, second part (D33–D37, D44, D45). xae_build(save_first), xae_deploy and tcunit_run (which did not save at all; new save_first) run File.SaveAll, save each document/project the shell still reports unsaved, and check every xae_pou_set / xae_pou_create edit of the session in the source files — they refuse to build while one is missing (an external reload had discarded edits that were only in the shell, D44); save in the result lists what was dirty before and after. Experiments: a condition that already holds at a recording's first sample is its initial state, not an edge — no latency is measured from it (the first-sample "1 ms" values that passed a criterion, D34); a latency between symbols in separate change-mode notifications is not reported (timestamps up to cycle_ms off, order not kept — use cycle mode or one notification; rec_latency returns timing.trust exact / quantised / unreliable, D35); measures use the samples up to the start of the after steps (last read the reset value, D33); exp_abort still runs the current run's after steps, marks that run aborted and ends the experiment aborted also when it was the last run (abort_received shows when it arrived, D37); the 95 % CI of a count or duration is clipped at 0 and never narrower than the timestamp resolution (ci95_note, D36). tc_doctor: TwinCAT in CONFIG is reported as info, not as a problem (D45).
0.8.4 — 0.8.3 deep test (D1–D31, N5, N27–N30, #17, #20, #28, #56, #78, A5). Recordings: a PLC STOP (cycle counter frozen while 1 ms notifications keep coming) is a {"_stall":…} line, counts as missing and labels the file INCOMPLETE with label_reason (D11); the native engine re-subscribes when every block went silent, e.g. after RUN → CONFIG → RUN (D13, resubscriptions in the footer); live status counts silent time as missing (D14) and stops on the PC clock when PLC time no longer advances (D15); a recording that ends by itself is sealed at once and a start-up sweep seals any left unsealed (N27); rec_read(wide=true) gives one row per PLC timestamp with null where nothing was sampled, fill=true marks filled cells (D9); counter completeness capped at 1 with duplicates reported (D12); armed false once triggered (N29), values_per_s counts array elements (N30); rec_list pages the session list too (D21). rec_start(pattern=…) selects exactly the leaves rec_scan lists: */? wildcards, [ ] literal (GVL_Sim.aCh[1].*), a leaf matches when it or a parent matches (A5); prefix may name one element of an array of structs (D31). ads_wait_until / ads_watch use scratch recordings that are always removed, interval_ms honoured (D7, D6); top-level enums read as {value, name} (D4). exp_run writes the stimulus only after every recording delivers (D22). xae_restart_twincat / xae_deploy count a restart only after the target was seen leaving RUN and coming back (modes_seen, transition_seen; the first poll read the old runtime's RUN, N5/#4). ADSError 6 is explained for the port that was asked (D24). proj_vs_runtime gives no missing/extra verdict from a list cut at max_items (complete, not_judged, D23), keeps the PLC's and the source's spelling (#20). xae_tree_get walks the nested <Name> Project (#17). ipc_eventlog never guesses the boot folder and reports whether its temp file is really gone (#56). Infosys: one transaction per book, FTS optimised once, external-content FTS (10,000 synthetic pages in 11 s here, DB −30 %; not yet timed on the real package), CRC-based page identity so an unchanged package (or the same package on another PC) is never re-read, re-index only when the indexer version changes (an existing 0.8.3 index rebuilds once), progress names the book being indexed (D1, D25); version only from Microsoft.Help.DisplayVersion (D2); answers carry doc_date + indexed_books_count instead of the book list (D3). proj_lint real_eq ignores := (D17); proj_interface inherited members have file (D16); proj_variables keeps the CONSTANT qualifier (D18); hw_lookup reads namespaced ESI files (PDOs, entries, CoE; ESI files are re-read once, D19). Scope found through IMeasurementScope (N28, not yet run on hardware). D8: the server already published engine / also_scope / scope (a regression test now pins them) — a client that does not show them is using a cached schema.
0.8.3 — Infosys offline from the Help Viewer package. docs.source = "local" (default) reads the BKINFOSYS3_*.mshc TwinCAT XAE installs (found under %ProgramData%\Microsoft\HelpLibrary2, or [docs] mshc): every TwinCAT 3 book indexed in the background (default books first), pages keyed by their real infosys.beckhoff.com URL, no network call and no web fallback; results carry the doc version and the package date; a new package re-indexes, an unchanged one is never re-read; index next to the knowledge base. Missing package → the infosys tools say where they looked and how to fix it (docs.source = "web" keeps the website path). Infosys tools no longer crash when the index is disabled.
0.8.2 — TwinCAT Scope next to the ADS recorder. scope_export runs Beckhoff's TC3ScopeExportTool.exe ("svd=<file>" target=<csv> silent, TE130x / TF3300 folders, [scope] export_tool) on a saved .svdx, never edits its CSV, and writes a signed <csv>.provenance.json (source and tool SHA-256, command line). Through the XAE Automation Interface (IMeasurementScope of a Measurement project): scope_list, scope_record start / stop / save (SaveSVD + ExportCSV into <recordings>/scope). rec_start(also_scope=true, scope=…) starts the Scope configuration with the recording; rec_stop stops it, saves <id>.svdx, exports <id>.scope.csv (falls back to the export tool) and writes a signed <id>.scope.json with both SHA-256s; the files are read-only. [recorder] also_scope = "ask" (default) asks the user whenever XAE has a Scope configuration open — by prompt, or with allow_elicitation = false by an error telling the agent to ask and call again; always / never. New tool group scope; 155 tools. The XAE Scope calls are late-bound against the documented interface and not yet run against a real Scope View.
0.8.1 — recording authenticity (field report R1–R12) and the 0.8.0 retest. Both engines write {"_gap":…} lines where samples are missing (inside the run, before the first and after the last sample), a footer label COMPLETE / INCOMPLETE / NOT_PROVABLE, and a signed {"_chain":…} checkpoint (running SHA-256 + HMAC) every second, so a file whose footer never got written is still proven intact up to its last checkpoint. After a recording ends it is sealed: <id>.manifest.json (whole-file SHA-256, footer checksum and signature, summary, HMAC-signed) and both files read-only; rec_verify checks every checkpoint, names the first bad line, checks the manifest and reports read_only; rec_delete clears read-only and removes the manifest. Every export writes a signed <export>.provenance.json (source file and SHA-256, footer checksum, label, seal state, parameters incl. fill, exporter version, export SHA-256); CSV gets an exact time_utc column (7 decimals, integer maths). The header records each symbol's datatype GUID, base type and (structs recorded whole) member layout. Retest: N13 duration stop waits ≤ 1 s for in-flight samples up to the cut (lossless runs no longer FAIL by 3–10), N17 ADSError 6 explained from port and RUN/CONFIG, N18 PROGRAM calls in proj_call_graph, N19 (System) placeholders are info, N21 infosys names the books being indexed and the real backend, N22 BOOL writes accept only true/false/0/1, N23 rec_capture explains missing stats, N24 edge_triggers in the header, N26 project index scans serialised, #66 tcunit ProductVersion from the project. N25: tcmcp-capture.exe now ships in the plugin, built and tested by the release workflow (release/v* branch → exe + SHA-256 committed, tag, release with zip, .mcpb, SHA256SUMS, build provenance); the server refuses an exe whose SHA-256 differs from the pinned one; /Brepro makes the build deterministic.
0.8.0 — native capture service (C++ capture spec). tcmcp-capture on Beckhoff's AdsLib (vendored, MIT) in TwinCAT mode over TcAdsDll.dll, bound at start so CI builds the exe without the TwinCAT SDK (-DTCMCP_TCADSDLL_SDK builds against Beckhoff's headers and lib, same layout asserts); AdsLib standalone elsewhere. Lock-free per-block rings, PLC-time merge, format-2 file byte-compatible with the Python recorder (spec test 10: identical rows and exports), SHA-256 + HMAC footer, head/gap/tail/overflow accounting, triggers and stop conditions evaluated on raw bytes, all-or-nothing subscription, clean stop when the server goes away. rec_start / rec_capture engine parameter, [recorder] config section, engine and reason in every response, tc_doctor → recorder. Python recorder: pre-trigger samples that are discarded no longer count in the block timeline; window_start_ms (trigger − pre_trigger_ms) and missing_head; rec_verify fails on overflow and on a FAIL verdict hint. Simulator backend + 15 tests for spec items 1, 5–10. 151 tools.
0.7.2 — knowledge base and the 0.7.1 retest. Knowledge base (decisions of 2026-10-17): the database lives in a folder the user names (kb_set_location; checked: local fixed drive, not cloud-synced, not the plugin folder, writable, ≥ 1 GB; D:\TwinCAT-MCP\knowledge only when the user agrees); kb_add_project / kb_search over folders the user adds (nothing by default); hw_lookup (PDOs, CoE objects from TwinCAT's ESI files); proj_libraries (what each library reference resolves to on this PC); known causes/fixes attached to tool errors. Recorder: above 20,000 values/s nothing is decoded on the ingest thread (300 leaves × 1 ms lost samples because decoding starved the ADS callback); the GIL switch interval is 0.5 ms while recording; the missing tail up to the window end is counted (N11); responses trim long arrays; triggers on elements of recorded arrays and edge_triggers. rec_delete needs a confirmation and the audit keeps the file's SHA-256 (R11). Interfaces are recognised from the project source when the datatype table does not mark them: reads as 0x…, writes refused (#52/#64). tc_allow_write tokens for the pattern as typed (N1); session allow-list kept over tc_reload_config (N6); writers scoped to the declaring unit (N3); System Manager refreshed after a solution reopen (N9); env overrides of TOML values reported (N10); external tcunit_scaffold not gated (N12); restart duration_s until RUN (N5); Check all objects selects the PLC project node and reports the real refusal (#45). 151 tools.
0.7.1 — decisions of 2026-10-17. The CONSTANT check runs on every write path (snap_apply, test_*, exp_* too); with no project source loaded, guarded mode refuses writes and full mode allows them. Recordings carry a manifest (AppTimestamp, OnlineChangeCnt, tasks and cycle times, TwinCAT build, symbol version) and, in cycle mode, the task's per-cycle counter as ground truth that rec_verify uses automatically. csv_wide is one row per PLC sample time with array elements as columns; empty cell = not sampled then (fill=true for charts). The example config carries the agreed machine-PC settings (allow_elicitation = false, edit_requires_config_mode = true, tool groups, narrow allow-list). 143 tools.
0.7.0 — recording accuracy and field report round 3 (A1–A7, #75–79, P2–P19, K1). Recorder: one ADS notification per contiguous memory block instead of per symbol (the field test: 300 values as one block lossless, as 300 notifications ~5 %); the callback only copies the raw sample; file format 2 keeps the runtime's raw bytes and exact PLC FILETIME per sample, a symbol table and block layout in the header, and a signed SHA-256 footer; missing_samples/completeness per block from the PLC timestamps, dropped, dropped_on_stop; a stop drains the backlog to the file; duration is PLC time; a notification that cannot be registered fails the start (allow_partial); patterns expand to leaves like rec_scan; live statistics step aside under load and rec_stats recomputes them from the file; new rec_verify (integrity, timeline, per-cycle counter) and rec_capture (record → stats → verdict in one call); the acceptance run proves a lossless recording of _TaskInfo[1].CycleCount at the task cycle. ads_watch / ads_wait_until on ADS notifications, off the ADS workers; ads_write_many as one sum-write (all values in the same PLC cycle); writes report written vs read_back; symbol/datatype caches follow the runtime's symbol version instead of a 300 s timer; ads_system_mode waits for the requested mode; COM calls blocked by a modal dialog fail within a second naming it; xae_deploy fails unless the target runs afterwards; tc_doctor one-line summary (verbose for the config); server.tool_groups; launcher skips hashing unchanged sources; Infosys indexes the books of the libraries the project references. Older recording files stay readable. 143 tools.
0.6.3 — field report round 2 (items 51–74, framework project with inheritance, interfaces, enums, strings, arrays). Writes: an array write must supply every element (a short list zeroed the rest); POINTER/REFERENCE and INTERFACE variables are refused (an interface is a pointer the PLC calls through) and read as 0x… hex or null; writes to anything declared in a VAR … CONSTANT block are refused from the project source (the runtime does not flag them READONLY); STRING(n) length is checked before ADS; enum names are accepted (Idle, E_State.Idle) in ads_write and test_expect; ads_write_many pre-checks every item before the first write and reports applied/failed/not_attempted if the PLC rejects one. Recorder: duration_s no longer compares the PLC's task clock with Windows time (cycle mode ran on for 30 s), rec_stop keeps its own stop reason, the file is flushed every second, post_trigger_s ends a triggered recording after the trigger. Project: the index refreshes incrementally (mtime) before every index-based tool; proj_vs_runtime matches x[*] source arrays to their elements, collapses arrays and caps output; proj_call_graph follows interface calls to every implementing FB, inherited methods and THIS^ overrides; proj_interface merges the EXTENDS chain (inherited_from) and inherited IMPLEMENTS; wf_debug_symbol no longer calls fb(x := y) a write of y and lists .TcVIS input-action writes; tcunit_scaffold takes the project's ProductVersion, keeps declared input defaults, includes inherited methods; empty_method skips interface/abstract methods; C# enums use the declared base type. Safety: confirmation prompts read DESTRUCTIVE: <tool> / Target / Machine / Mode / Effect, the audit records how long the prompt was open and flags sub-1.5 s answers, safety.allow_elicitation = false forces the token path, safety.edit_requires_config_mode = true refuses code edits unless TwinCAT is in CONFIG; destructive XAE tools refuse via the guard even with no shell attached. IPC: ipc_eventlog is confirmed as itself, lists the registered TwinCAT/Beckhoff providers, deletes its temp file; boot: resolves to the live 4026 folder (ProgramData), not the stale C:\TwinCAT\3.1\Boot. ADS errors 6/7/1797/1808/1861 carry a plain-language hint; TOML config loads on Python 3.10 (tomli). 141 tools.
0.6.2 — second and third field reports (50 items, same engineering PC). Integer writes are range-checked against the ADS type and BOOL accepts only true/false/0/1 — 70000 into a WORD is refused, not wrapped to 4464; tc_set_mode escalation needs a confirmation (lowering stays free); confirmation tokens for XAE destructive actions are bound to the shell's real target at issue time; ipc_list_dir boot:* resolves the real boot folder by probing (FFIND ignores path ids) and drops ./..; proj_read_file is confined to the project roots; 4026 PLC command names (PLC.Loginto<Project>) are discovered from the shell and the project node is selected when none is active; the nested PLC project node (ItemType 56) is recognised and walked; experiments gain run.ack: falls|edge|none, ack_timeout_ms, wait_ms/wait_until steps, after as cleanup on failure, resume=false archiving earlier runs, spec_version on every run; BOOL leaves keep their declared name on 4026 tables; library FB members are expected in proj_vs_runtime, counted as instances by proj_references, shown as leaf calls in proj_call_graph, resolved via the runtime in proj_resolve_symbol; => x counts as a write; unqualified type names resolve when unique; confirmed actions audit their final outcome (ok/error); rec_latency reports absorbed edges; Infosys DB in WAL mode with serialised indexing; clearer EtherCAT/IO/HMI/AppTimestamp/raw-write messages. Third report: xae_build check_all_objects=true discovers the shell's actual command name (PLC.CheckAllObjects, localized or 4026-prefixed variants) instead of assuming one; a shell closed and reopened behind the server (RPC_S_SERVER_UNAVAILABLE 0x800706BA) is re-attached automatically on the next call; proj_lint reports root/files_indexed/parse_errors and says plainly when proj_scan has not run instead of units: 0; eof_newline removed (XAE never writes one) and lineids_missing only fires when a POU is inconsistent (some blocks have LineIds, others not); hmi_scan parses TF1800 .TcVIS files — VisualElemMember paths are read bindings (kind tcvis, tagged with the member id name where known), ST input-action assignments are write bindings (kind tcvis_write), so hmi_vs_runtime covers classic visualizations; xae_status attaches to the shell itself. Not done: TwinCAT Scope/Measurement control (IMeasurementScope is not IDispatch — needs a .NET host) and visualization creation (.TcVIS is an opaque XmlArchive; editing it blind would corrupt the file). 141 tools.
0.6.1 — field fixes from the first real session (Windows 11, TwinCAT 3.1.4026, engineering PC): the launcher no longer blocks the MCP handshake on first start — it builds the venv in a detached background process (exit code 5, reconnect once; a SessionStart hook pre-builds it; --sync-install keeps the old behaviour); template placeholders (<CX_NETID>, C:\path\to\…) and malformed AmsNetIds are dropped with a config_FIX_THESE list in tc_doctor instead of being loaded; tc_allow_write (session allow-list entry, confirmed, audited) and tc_reload_config (apply list-type settings without a restart); xae_restart_twincat / xae_activate_configuration verify the target's mode over ADS and the shell's dialogs and fail with the dialog text instead of reporting success; TwinCAT license errors (0x98110724) mapped to the 7-day-trial remedy; rejected COM calls name the open dialog; a cancelled confirmation prompt is distinguished from a decline; recordings end at their limit immediately and release their notifications from the ingest thread (rec_status no longer lags, rec_export rows == events, footer reported); Infosys default books index in the background on first use; python -m twincat_mcp.acceptance exercises every tool against the live PC/target with a PASS/FAIL/WARN/SKIP/MANUAL report and guard-refusal proofs. 141 tools.
0.6.0 — experiments (12 tools): YAML spec, background runner with snapshot/profile per run and factor restore, measures from recordings (last/latency/pulses/settle/dwell/edges/expr…), metrics with t/χ² CIs and Cpk, pass/fail/inconclusive verdicts with n-to-settle, Markdown+HTML report with identity/charts/audit/interpretation, compare. Capture profiles (7 tools): rec_scan of runtime or source with cost estimates and a markable checklist, {attribute 'tcmcp.record'} pragmas collected through proj_variables (pragmas now parsed and inherited down instance trees), named profiles replayed as one recording per mode group. infosys_* reference lookup (7 tools): sitemap-driven book list, per-library local index with FTS5, symbol search, declarations as data, code-example search, live page → Markdown, sitemap-verified web fallback, TwinCAT 2 filtered out; scripts/gen_tools_md.py. Packaging: Claude Code plugin + marketplace in .claude-plugin/ (/plugin install twincat-mcp@twincat-mcp, userConfig for Python/AmsNetId/modes), Claude Desktop .mcpb bundle (packaging/mcpb/build.py, manifest 0.3, tool list generated from the server, passes mcpb validate), self-bootstrapping launcher scripts/launch.py (+ launch.cmd) that creates the venv on first start and reinstalls only when the shipped sources change; skill moved to skills/twincat-mcp/; HTTP mode bearer-token gate for claude.ai remote connectors. Plugin path verified end-to-end on Linux (install → venv → tc_doctor via mcp__plugin_twincat-mcp_twincat__tc_doctor); launch.cmd Python discovery is untested on Windows. Windows CI (.github/workflows/ci.yml, ubuntu + windows × py3.10/3.12 with a stand-in TcAdsDll.dll) found and fixed: tc_doctor crashed instead of reporting a dead router; the dialog scan looked at every program's dialogs when no XAE pid was known; a PC without TwinCAT got a ctypes traceback at start instead of the cause. proj_lint gains six OOP/safety rules (interface_contract, extends_cycle, abstract_instantiation, shadowed_member, unsigned_loop, new_delete), default-on, zero findings on the sample project. System Service file paths accept OS-independent prefixes (boot:, bootprj:, config:, user1:… = ADS path ids); tcunit_remote_result defaults to boot:TcUnit_xUnit_testresults.xml so the same config serves Windows, CE7 and TC/BSD targets. Refused and declined actions are now audited (outcome: refused / declined-elicitation:*), not only the ones that ran. docs/INSTALL.md: install → config → 14-step zero-write smoke test.
0.5.0 — dialog watchdog, TwinSAFE guard, XML validation/fixes + LineIds regeneration, TE2000/TcVIS HMI binding index with runtime/source cross-check, I/O disable, variable links, UDP discovery, Windows event log, C#/TypeScript/JSON exporters, snapshot apply, session report, naming_prefixes config.
0.4.0 — composite workflows (wf_debug_symbol, wf_fb_profile, wf_release_check, wf_project_overview), MCP prompts as workflow recipes, rec_compare, proj_changed (git), proj_scan incremental, ads_io_read (process image), compact symbol listing, size-guarded ads_read, separate ADS workers for quick vs long calls, Claude Code integration kit (integrations/claude-code/).
0.3.0 — datatype-table upload and parsing: full nested decode of any variable in one read (ads_read), ads_leaves, ads_dump (every variable on the PLC → JSON + CSV), ads_types; recorder prefixes expand through the table (arrays of structs included); proj_variables (source-declared variables flattened to instance paths) and proj_vs_runtime (source vs online cross-check).
0.2.0 — real-time recorder (rec_*), test bench (test_*, snap_*), runtime diagnostics (ads_app_info, ads_task_stats, ads_ping), ADS RPC (ads_call_method), static checks (proj_interface, proj_lint, proj_call_graph), tcunit_scaffold. Review fixes: ROT enumeration (EnumRunning), vsBuildState constant, raw writes limited to PLC ports with symbol-overlap deny checks, tokens bound to the connected machine, ads_connect re-targeting gated, destructive DTE commands classified, project write-back byte-exact (BOM/EOL preserved) and duplicate-name aware, cooperative cancellation of long ADS loops, blocking calls moved off the event loop.
0.1.0 — initial release.
Not covered (deliberately)
Scope/TE13xx recording, TE1200 static analysis, NC axis commissioning, Safety (TISC) editing, library repository management, semantic code search, OPC UA. The tree XML tools (xae_tree_get / xae_tree_consume_xml) reach most of the rest of the System Manager generically.
Development
python -m pytest # 159 tests (safety matrix, type codec, project parser, fake ADS incl. notifications/RPC, fake COM, recorder, bench, lint, MCP e2e incl. elicitation, packaging)
python packaging/mcpb/build.py # dist/twincat-mcp-<version>.mcpb; npx @anthropic-ai/mcpb validate runs if Node is present
claude plugin validate . # plugin + marketplace manifests
python -m twincat_mcp --print-config
python -m twincat_mcp --http 8765 # streamable-http on loopback; --token / TCMCP_HTTP_TOKEN adds a bearer gate for tunnelsMIT.
Available Tools
171 toolsads_add_route_to_plcCDestructive
Create the PLC-side route back to this PC (UDP discovery protocol, needs the target's Windows/TC-BSD credentials). Control-class.
Inputs: plc_ip (required), hostname, route_name, local_net_id, +3 more. Returns: object
ads_app_infoBRead-only
PLC application info (TwinCAT_SystemInfoVarList._AppInfo): project/app name, online change count, boot data loaded, task count, logged-in flag, app timestamp.
Inputs: no named parameters. Returns: object
ads_call_methodADestructive
Invoke an FB method on the running PLC via ADS RPC. The method must carry {attribute 'TcRpcEnable'}. inputs: [{type:'LREAL', value: 12.5}, …] in VAR_INPUT order (use base types: INT not E_Enum); outputs: ['BOOL', …] in VAR_OUTPUT order. Write-class.
Inputs: method (required), instance (required), inputs, outputs, +1 more. Returns: object
ads_connectADestructive
(Re)connect to a target. ams_net_id like '5.12.34.56.1.1', 'local' for this PC, None = keep current; port 851 = PLC runtime 1. Re-targeting to a NetId other than the configured one is control-class (it changes which machine every later write hits).
Inputs: ams_port, ams_net_id, ip_address, confirm_token. Returns: object
ads_discoverARead-only
Broadcast search for TwinCAT targets on the local network (UDP 48899): NetId, host name, TwinCAT version, IP — the same thing XAE's 'Broadcast Search' does.
Inputs: broadcast, timeout_s. Returns: object
ads_dumpARead-only
Read EVERY variable on the PLC (all top-level symbols, fully expanded through the datatype table — structs, FB instances, arrays of structs) in one pass and write a flat CSV (path,type,value,note) and a nested JSON tree built from the same values, so the two files never disagree. pattern limits the roots ('MAIN.', 'GVL_'); system symbols excluded unless include_system. With a project configured its own programs and GVLs come first; without one the order is alphabetical (origin unknown). POINTER TO / REFERENCE TO / INTERFACE values are addresses (NULL = 0x0000…0000) — the target is never expanded. An array beyond 4096 elements or a value beyond 64 KiB is not expanded: both files show the same {not_expanded, bytes, elements, head_hex}. Big symbols are read in 256 KiB pieces. max_leaves bounds CSV and JSON together; max_total_mb (MiB) bounds the CSV + JSON on disk (written_mib; the bytes read from the PLC are not counted): a row is written only when it, the root's JSON with it and the ending still to be written (the footer naming what is left out) fit — nothing is estimated. complete=false names every root that is missing or cut (skipped_roots) and every root that could not be read (failed_roots, also in the CSV note column and the JSON footer). not_on_target names the programs/GVLs of the source that have no symbol on the target, with the cause (not linked, or another program on the target). Returns counts, largest_roots, file paths and a 50-leaf preview.
Inputs: out_dir, pattern, max_leaves, max_total_mb, +1 more. Returns: object
ads_ethercatARead-only
EtherCAT master state (INIT/PREOP/SAFEOP/OP) and slave count via the master's ADS port (default 65535 for the first master; see Device → ADS tab in XAE).
Inputs: master_port. Returns: object
ads_exportBRead-only
Generate code from the runtime: fmt=csharp (explicit-offset structs + enums for Beckhoff.TwinCAT.Ads ReadAny/WriteAny), typescript (interfaces), json (type descriptions), or csharp_symbols (const symbol paths under prefix). types = struct/enum names; prefix = take the types of every symbol under it.
Inputs: fmt, types, prefix, out_path, +2 more. Returns: object
ads_io_readARead-only
Raw process image of the PLC: area 'I' (%IB inputs) or 'Q' (%QB outputs) at a byte offset — what the task actually sees/wrote, independent of symbol names (link checks).
Inputs: area (required), offset (required), port, size. Returns: object
ads_leavesBRead-only
Enumerate every scalar leaf under a symbol with byte offsets (datatype table): 'MAIN' → all program variables, 'MAIN.arrSteps' → arrSteps[1].nId … With values=true each leaf is decoded from the symbol's bytes, read in bounded pieces (a value that is not expanded: its head only); value_note says why a value is missing or partial.
Inputs: name (required), max_leaves, with_values. Returns: object
ads_list_symbolsBRead-only
Browse the runtime symbol table. pattern is fnmatch ('MAIN.', 'valve'; bare text is wrapped in ''). type_filter substring-matches the type ('ST_', 'BOOL', 'FB_'). flag filters by symbol flag: PERSISTENT, READONLY, STATIC, ATTRIBUTES … compact=true returns 'name : type' strings only (one fifth of the tokens).
Inputs: flag, limit, offset, compact, +3 more. Returns: object
ads_pingCRead-only
ADS round-trip time statistics to the target (router/route/network health).
Inputs: port, count. Returns: object
ads_plc_stateADestructive
PLC runtime control via ADS: run | stop | reset. 'reset' is a cold reset (all non-persistent data lost). Control-class: confirmation in guarded mode.
Inputs: action (required), confirm_token. Returns: object
ads_readARead-only
Read one symbol with type-aware decoding. Structs/FB instances/arrays of structs decode into a nested tree (datatype table); TIME/DATE/DT/TOD get readable text; enums get names. Trees larger than max_chars are summarised (member names + sizes) — use ads_leaves or ads_dump for the full content.
Inputs: name (required), max_chars, max_members, expand_struct. Returns: object
ads_read_manyBRead-only
Read several symbols in one ADS sum-command. Returns {name: value | {error}}.
Inputs: names (required). Returns: object
ads_read_rawCRead-only
Raw ADS read by index group/offset on any port (hex + little-endian uint).
Inputs: size (required), index_group (required), index_offset (required), port, +1 more. Returns: object
ads_routesBRead-only
Local static ADS routes (parsed from StaticRoutes.xml on this PC).
Inputs: no named parameters. Returns: object
ads_statusARead-only
Composite status: connection, PLC runtime state, TwinCAT system mode (RUN/CONFIG), device name/version. With port=N returns only the ADS state of that port (852 PLC2, 500 NC, 10000 system service, 65535 EtherCAT master 1).
Inputs: port. Returns: object
ads_symbol_infoBRead-only
Type, size, index group/offset, flags (READONLY, PERSISTENT …) and comment of one symbol.
Inputs: name (required). Returns: object
ads_system_modeADestructive
Switch TwinCAT on the target between 'run' and 'config' mode (restarts the runtime, I/O goes down). Destructive-class. Waits (≤20 s) until the target reports the requested mode and returns before/after; reached=false when it did not get there (license / configuration error).
Inputs: action (required), confirm_token. Returns: object
ads_task_statsBRead-only
PLC task timing (TwinCAT_SystemInfoVarList._TaskInfo[n]): cycle time, last/min/max/mean
execution time over samples, load %, cycle-time-exceeded counter delta — the FB's cost
on the real-time task.
Inputs: samples, task_index, interval_ms. Returns: object
ads_typesBRead-only
Runtime datatype table: describe one type (members with offsets/sizes, array bounds, enum literals, attributes) or list types matching a pattern.
Inputs: limit, pattern, type_name. Returns: object
ads_wait_untilARead-only
Block until symbol value (==, !=, >, >=, <, <=) or timeout. Uses an ADS change notification, so it returns as soon as the runtime sees the condition (met_at_plc_ms = PLC-relative timestamp of that sample); falls back to polling every interval_ms when notifications are unavailable. Returns met/value/elapsed.
Inputs: op (required), name (required), value (required), timeout_ms, +1 more. Returns: object
ads_watchARead-only
Trace symbols for duration_ms. Uses ADS notifications (PLC-timestamped, every change the runtime sees at its task cycle — not 50 ms polling from this PC): change_only=true records changes, false one sample per interval_ms. Falls back to polling when notifications are unavailable (method field says which). Caps: 60 s, 5000 rows. The wait happens off the ADS workers, so writes issued concurrently land during the watch — a client that sends calls one after another still sees them after it; for stimulus→response use test_response, or rec_start + the write + rec_stop.
Inputs: names (required), change_only, duration_ms, interval_ms. Returns: object
ads_writeBDestructive
Write a symbol on the running PLC. Accepts JSON scalars, lists for arrays, and literals like 'T#1s500ms', 'D#2026-10-15', '16#FF'. Returns before/after. Gated: readonly=never; guarded=write_allowlist; full=denylist only.
Inputs: name (required), value (required). Returns: object
ads_write_manyADestructive
Write several symbols ({name: value}) together. Every symbol is gated (allow/deny list) and pre-checked (type, range, enum name, array/string length, CONSTANT, pointer/interface) BEFORE anything is written — one refusal → nothing is written and every problem is listed. Then ONE ADS sum-write: the runtime applies all values between the same two task cycles (method says if it had to fall back to one-by-one). Per-item before/written/read_back; applied/failed/not_attempted if the PLC rejects one.
Inputs: values (required). Returns: object
ads_write_rawADestructive
Raw ADS write by index group/offset — PLC runtime ports (851-859) only. Every symbol whose memory overlaps the written range is checked against the write allow/deny lists; the raw target itself is 'raw://'.
Inputs: hex_data (required), index_group (required), index_offset (required), port, +1 more. Returns: object
exp_abortAIdempotent
Stop a running experiment after the current step; recordings are closed, factor values restored.
Inputs: name (required), reason. Returns: object
exp_compareBRead-only
Two experiments with the same levels side by side: metric deltas and whether their 95 % CIs separate (the before/after question with error bars).
Inputs: a (required), b (required). Returns: object
exp_evaluateBRead-only
Metrics per level with 95 % CIs and the criteria verdicts (pass / fail / inconclusive with the run count that would settle it). Deterministic from runs.jsonl; rerunnable by anyone.
Inputs: name (required). Returns: object
exp_getBRead-only
Spec, status and run summary of one experiment.
Inputs: name (required). Returns: object
exp_listCRead-only
Experiments on disk with run counts, state and whether a report exists.
Inputs: no named parameters. Returns: object
exp_reportAIdempotent
Write <experiments_dir>//report.md and report.html: identity (machine, TwinCAT version, project, git state, safety mode), criteria table, metrics per level, charts (primary measure per run; per-level mean/CI), run table, the spec, the audit log of writes during the run, and the interpretation — stored separately and labelled as not computed. interpretation= saves a new one (author=agent|operator|). firmware_check=true runs proj_vs_runtime first.
Inputs: name (required), fmt, author, firmware_check, +1 more. Returns: object
exp_runADestructive
Run an experiment in the background: per level × repetition → preconditions → factor values written → snapshot → capture profile started → stimulus → start acknowledged (done_when must go false) → done_when → settle → stop → measures → runs.jsonl. Factor values are read first and restored at the end or on abort (read back and checked). Every write is re-checked against the server guard, pinned to the machine the experiment started on, and audited with symbol and value; a refusal, a target change or a timed-out write stops the experiment. dry_run resolves every symbol, coerces condition values (enum names → ints) and prints the plan without writing. Starting is control-class: in guarded mode it asks once (elicitation / confirm_token); in full mode it does not. Only one experiment may run at a time.
Inputs: name (required), resume, dry_run, max_runs, +1 more. Returns: object
exp_runsDRead-only
Run records: level, status, measures, recording ids, duration, error.
Inputs: name (required), last_n. Returns: object
exp_saveBIdempotent
Save an experiment spec (YAML or JSON) under <experiments_dir>//spec.yaml. Runs already recorded for that name are kept; resume picks up where they stopped.
Inputs: spec (required), replace. Returns: object
exp_statusARead-only
Live state of a running experiment: planned/done/failed, current level, ETA, last error, live recording ids. For an experiment from an earlier session, the persisted status.
Inputs: name (required). Returns: object
exp_templateBRead-only
A complete example experiment spec to edit (YAML text + the same as JSON): factors × levels, runs per level, preconditions, start/done conditions, measures (last/latency/pulses/settle/ dwell/edges/expr…), metrics (mean/std/cpk/p95), criteria, writes_allowed. kind: dosing_fill.
Inputs: kind. Returns: object
exp_validateARead-only
Validate a spec (YAML/JSON text, a dict, or a saved experiment by name): structure, measures, metrics, criteria, writes_allowed vs what the spec writes, the server guard's view of each write, symbol resolution on the connected PLC, planned run count and a duration estimate.
Inputs: name, spec, resolve_symbols. Returns: object
hmi_bindingsBRead-only
Which HMI files/controls bind a PLC symbol (fnmatch on the symbol path).
Inputs: kind, limit, pattern. Returns: object
hmi_scanARead-only
Index HMI symbol bindings: TE2000 .view/.content/.usercontrol/.json (%s%PLC1.X%/s%) and TF1800 .TcVIS (VisualElemMember paths -> kind 'tcvis'; ST input-action assignments -> kind 'tcvis_write'). root defaults to project.hmi_root, else the project root (which is where .TcVIS files live).
Inputs: root. Returns: object
hmi_vs_runtimeBRead-only
Broken HMI bindings: symbols bound in the HMI that do not exist on the running PLC (and, with check_source, whether the source declares them), plus declared variables with no HMI.
Inputs: check_source. Returns: object
hw_diagARead-only
A diagnosis message by its text id as the diagnosis history shows it (object 0x10F3; '#x4101', '0x4101'):
message text, description, causes and remedies, class, reaction, reset — from the device's own catalogue when
device is given, else every distinct message with that id and the device types / modules that use it.
Inputs: code (required), device, revision. Returns: object
hw_lookupARead-only
EtherCAT device data from the ESI index (index\esi.db: the ESI files in the knowledge folder's manuals
and TwinCAT's ESI folders): name, product code, revisions, E-bus current, mailbox, DC modes, sync managers,
PDOs with every entry (index, subindex, bit length, type; gaps marked), the predefined PDO assignments, slots
of modular devices with their modules, the CoE object list, the diagnosis catalogue size, the ESI file(s).
query = type / order code ('EL3356-0010'), part of a name, or a product code ('#x07D83052', '0x07D83052'; a
number is read as a decimal product code and as digits of a type or name — read_as). revision: '#x…' as
shown, '0x…' or decimal. detail: 'newest' (default) = all of that for the newest revision of each type (or of
revision), other revisions as one line each; 'summary' = counts only; 'full' = everything for every
revision. Nothing found: note says what is not there — a revision of an indexed device
(revisions_available), or the device (then: add its ESI file). One CoE object with sub-indices, defaults
and enum texts: hw_object; full-text: hw_search; a diagnosis text id: hw_diag. The index's first build starts
by itself (minutes); until it is there the answer says so. source: the index the answer came from (state,
built; state_note when it is not current). manuals names the indexed PDF manuals that mention the
product, with pages (the twincat-docs skill reads them).
Inputs: query (required), limit, detail, revision. Returns: object
hw_moduleBRead-only
A module of a modular device (AX8000, EP/EL with slots, TSC …) by its ModuleIdent as hw_lookup's slots give
it: PDOs, CoE objects, diagnosis messages. With device, the module that device's slot means (hw_lookup's
rule: the device's own file, then the module file paired with it by name, then the only one), else every
module with that ident.
Inputs: ident (required), device, revision. Returns: object
hw_objectARead-only
One CoE object of a device from its ESI (newest revision unless revision): every sub-index with type, bit
size and offset, access, PDO mapping, backup/setting flags, the default (decoded from DefaultData, enum text
when there is one), min/max, unit code, enumeration texts; array elements one by one. index: '#x8000' or
'0x8000' (4 hex digits alone are read as hex); one sub-index in CoE notation '8000:11' (the sub-index in hex,
as Beckhoff's manuals write it: 8000:11 = sub-index 17) → sub and subitems with just that one. device:
the exact type ('EL3356-0010').
Inputs: index (required), device (required), revision. Returns: object
hw_searchARead-only
Full-text search of the ESI index: devices (names, PDOs and their entries, PDO assignments), CoE objects
(names, descriptions, sub-index names), diagnosis messages (text, description, causes, remedies) and modules.
kinds: any of 'device', 'object', 'diag', 'module' (default all; a module is found by its own name and PDOs
and by the devices whose slots take it — type, name, group). FTS5 syntax (words ANDed, "phrase", prefix*);
other text is searched as one phrase. Hits with the same title (revisions of one type, one text in several
catalogues) are one item with variants; objects and messages name the device types that have them. Pages:
total items, offset / next_offset; a limit above 100 is used as 100 (clamped).
Inputs: query (required), kinds, limit, offset. Returns: object
infosys_booksARead-only
List the Infosys books (documentation sets) of the Help Viewer package installed with TwinCAT, with page counts — offline, one index of every book. pattern is a glob on the slug ('tcplclib_*', 'json'); category: plc-library | function-tf | engineering-te | twincat-system | hardware | other. TwinCAT 2 books are excluded.
Inputs: limit, pattern, category. Returns: object
infosys_declarationARead-only
Declaration of a library symbol as data: kind, inputs/outputs/in_out (name, type, default, description from the page's table), struct members, enum values, return type, EXTENDS / IMPLEMENTS, methods (name, definition location, description) and properties (type, access, initial value) of an FB, plus the ST declaration text and the page URL. The thing to call before writing code against an FB you have not used before. A name documented by different pages (two libraries, two methods of one name) is refused as ambiguous with the candidates — pass library=; one page in several books is one answer (same_page_in); also_in names the other libraries. A member as '.' (FB_WG_ComboFilter.Call): the page below that FB in the Help Viewer contents (Beckhoff titles a method page with its bare name); parent names the FB of a member. The twincat-docs skill's docs_declaration resolves names by the same rule.
Inputs: symbol (required), library. Returns: object
infosys_get_pageARead-only
A documentation page as Markdown (headings, tables, fenced code), read from the local Help Viewer package — any page in it, indexed or not; doc version + breadcrumb included. ref: full Infosys URL, 'book/pageid', a bare page id, or a symbol name ('ADSREAD'). Offline. Use max_chars to keep it short.
Inputs: ref (required), offset, refresh, section, +1 more. Returns: object
infosys_indexDRead-only
The local Help Viewer index holds every book and is built as a whole (the first time by itself, later only with kb_rebuild(index='infosys') once the user approves) — this tool changes nothing here and says so; kb_status / tc_doctor show the index state.
Inputs: book (required), force, max_pages. Returns: object
infosys_searchARead-only
Full-text search over the local Help Viewer index (FTS5, bm25-ranked, excerpt with [hits]); "quoted phrases" stay together, limit 1..50. Offline — no web search (web_fallback is ignored and said so); results carry the page's doc version and the package date.
Inputs: query (required), limit, offset, library, +1 more. Returns: object
infosys_search_codeARead-only
Search the code examples of the indexed pages for a fragment — a call pattern, an attribute, a constant (case-insensitive substring of the code as written; non-breaking spaces count as spaces). language: one that occurs in the index (an unknown one is refused with the list), '' / 'none' = samples without a label. limit 1..50; total_matches says how many there are. ignore_spacing=true also matches when only the spacing around punctuation differs. Returns the matching lines with context and the page URL.
Inputs: query (required), limit, language, ignore_spacing. Returns: object
infosys_search_symbolsARead-only
Find library symbols (function blocks, functions, structs, enums, aliases, interfaces, GVLs) by name fragment in the local Help Viewer index; exact > prefix > contains. kind: FunctionBlock | Function | Program | Method | Property | Action | Enum | Struct | Union | Alias | Interface | GlobalVariable | Library. library: 'Tc2_System' or the book slug. Offline; while the index is still being built the answer says so.
Inputs: query (required), kind, limit, library. Returns: object
ipc_delete_fileCDestructive
Delete a file on the target IPC. Destructive-class.
Inputs: path (required), confirm_token. Returns: object
ipc_eventlogADestructive
Windows event log of the target (Windows 7/10/11 IPCs): runs wevtutil on the IPC via the System Service, reads the result back and deletes the temp file. Also lists the event providers registered on the target whose name contains 'TwinCAT' or 'Beckhoff', so a provider that does not exist there (the default name differs between TwinCAT builds) is reported as such instead of an empty result. Not available on Windows CE / TC-BSD targets. Destructive-class because it starts a process on the IPC: confirm with tc_request_confirmation(action='ipc_eventlog', target=).
Inputs: log, count, provider, confirm_token. Returns: object
ipc_list_dirARead-only
List files on the target matching a Win32 pattern. Prefer 'boot:*' (the live boot folder on any target OS; the result names the absolute folder in resolved_pattern) over a hard-coded 'C:\TwinCAT\3.1\Boot*', which is the stale legacy folder on 3.1.4026. Other prefixes: see ipc_read_file.
Inputs: pattern (required), max_entries. Returns: object
ipc_read_fileARead-only
Read a file from the target IPC's file system over ADS (no share needed). Binary → base64. Prefer the OS-independent prefixes, which the target resolves itself: 'boot:' (the live TwinCAT boot folder — C:\ProgramData\Beckhoff\TwinCAT\3.1\Boot on 3.1.4026, \Hard Disk\TwinCAT\3.1\Boot on CE7), 'bootprj:', 'bootdata:', 'target:', 'config:', 'install:', 'user1:'..'user9:'. On 4026 the old absolute C:\TwinCAT\3.1\Boot still exists but is a stale legacy copy (e.g. a CurrentConfig.xml from years ago) — do not draw conclusions from it.
Inputs: path (required), as_text, encoding, max_bytes. Returns: object
ipc_rebootCDestructive
Reboot (or shut down) the target IPC via the System Service. Destructive-class.
Inputs: delay_s, confirm_token, shutdown_only. Returns: object
ipc_start_processCDestructive
Start a process on the target IPC (NT_StartProcess equivalent). Destructive-class.
Inputs: path (required), directory, command_line, confirm_token. Returns: object
ipc_write_fileCDestructive
Write a file on the target IPC (text or base64). Control-class.
Inputs: path (required), text, append, base64_data, +1 more. Returns: object
kb_add_projectAIdempotent
Index a project folder for kb_search (cross-project pattern search) — ONLY a folder the user named. Reads
.TcPOU/.TcDUT/.TcGVL/.TcIO beneath it into the knowledge database; nothing is indexed by default. Refused: the
plugin's folders, the knowledge folder, a folder inside or around one already indexed (its units would be
there twice). The answer names the files that could not be read (parse_errors) and the files no PLC project
compiles (not_in_project). Refused in readonly mode; audited (N127).
Inputs: path (required), label. Returns: object
kb_rebuildAIdempotent
Rebuild one index of the knowledge folder from its source on this PC — ONLY with the user's approval (docs/KNOWLEDGE_BASE.md rule 6: the user is asked, or pass the confirm_token of tc_request_confirmation(action='kb_rebuild', args={'index': …})). index: 'infosys' (the Help Viewer package, the plugin's extractor, in its own process — minutes; the current index stays in use until the new one is complete and then replaces it), 'manuals' (the PDFs in manuals, in its own process), 'esi' (the ESI files in manuals\ and TwinCAT's ESI folders → index\esi.db, in its own process — minutes; the current index stays in use until the new one is complete). Without force an index that is complete and current is left as it is. Nothing is deleted. kb_status / tc_doctor show the progress.
Inputs: index (required), force, confirm_token. Returns: object
kb_reindexAIdempotent
Re-index one project folder (or every changed one) after edits. Refused in readonly mode; audited (N127).
Inputs: path. Returns: object
kb_remove_projectAIdempotent
Remove a project folder from the knowledge base (index entries only; the files are untouched). Refused in readonly mode; audited (N127).
Inputs: path (required). Returns: object
kb_searchARead-only
Search the code of the project folders the user added ("alarm handler", "FB_Valve", "CONCAT"): unit, kind,
file and the matching declaration/code excerpts, best first. Names and identifiers count as their words
(FB_AlarmList: alarm, list). Units with EVERY word first, then every word as a prefix ('CounterMod' finds
FB_CounterModule); a unit whose code holds the words before one that has them only in comments
(match_in='comments'); only when none has them all, units with some words
(match='some words', with the words each unit holds; words on no unit or on most units are not used and
are listed). A unit that declares the name (variable, constant, member, enum value, its own name) comes first
(declares). Stop words ('how', 'to', 'the') and, in a query of several words, single characters are not
searched; a query of stop words only is refused. There are no query operators: OR / AND / NOT / NEAR, '-',
'^', '*' are not read as such (operators_note). A copy name (PRG_X_9) that no unit has falls back to the
name it was copied from. "quoted text" is a phrase; tokens joined by punctuation ('STRING(40)', 'fbTimer(IN:=')
are searched as one sequence (searched_as_sequence), a qualified name ('GVL_X.nY') as its names. A unit whose
own name holds the words comes before its members. kinds (checked): PROGRAM, FUNCTION_BLOCK/FB, FUNCTION,
POU (= those three), METHOD, PROPERTY, ACTION, INTERFACE, STRUCT, ENUM, GVL, DUT (= every data type) …; with
kinds, a member is answered as its owner of those kinds (via_member: 'Execute' kinds=[INTERFACE] → I_Module);
no hit names the units of other kinds that have the words. words_not_in_code: the words a hit has only in
comments / string literals. project = the folder (any spelling) or its label; limit 1–200. stale: folders
changed, renamed or deleted since they were indexed — their hits are those of the last indexing (kb_reindex);
changed_files / added_files / removed_files name them. An error message — a code in
a notation that says so (ADSError 1861, pyads' 'ADSError: … (1861)', ADS error 1861, error 1861, nErrId :=
1861, 0x98110745, ADSERR_CLIENT_SYNCTIMEOUT), a compiler message (C0046: …), or a 0x number alone; not the
word 'error', a decimal / 16# literal alone, a hex number anywhere or an ERR_… identifier of the code — gets the plugin's note
in known_error (ADS return codes 6, 7, 1793, 1796, 1797, 1799, 1808, 1861 with code and symbol, license, XAE
busy / dialog / disconnected, logged in, compiler: identifier not defined, cannot convert type, unknown type;
null + known_errors_covered when it has none) and is searched only for the names of the code it holds
(quoted, or identifiers such as fbCounter, FB_Valve, MAIN.fbX).
Beckhoff documentation is not here: the twincat-docs skill.
Inputs: query (required), kinds, limit, project. Returns: object
kb_set_locationAIdempotent
Choose the folder for the knowledge database — ONLY with a path the user gave you (or use_fallback=true once the user agreed to D:\TwinCAT-MCP\knowledge; not both). The folder is checked: a folder (not a file, not a drive root) on a local fixed drive (no network share / mapped drive / USB), not inside OneDrive/Dropbox/Google Drive/iCloud/Box, not inside the plugin folder, writable, >= 1 GB free — a failing condition is named and nothing is changed. An existing database is never moved or deleted. Without arguments it returns the current location (and changes nothing). A change is refused in readonly mode and audited, as every EDIT tool (N127).
Inputs: path, use_fallback. Returns: object
kb_statusARead-only
Knowledge base (layout and rules: docs/KNOWLEDGE_BASE.md): where it is (or the question to ask the user if
no folder was chosen yet), the project folders indexed for kb_search, the ESI index for hw_lookup — and under
docs the documentation indexes the infosys_* tools and the twincat-docs skill read: index\infosys-.db
(the one Infosys index) and index\manuals.db (PDF manuals, with the PDFs not in it yet), the SOPs, and the
command that runs the skill's script on this folder. Each index: complete, or rebuild_needed / outdated (in use
as it is until the user approves kb_rebuild), or a build running / interrupted. layout lists files the
plugin no longer reads (never deleted by it) with their size.
Inputs: no named parameters. Returns: object
proj_call_graphARead-only
Call graph from a program/FB: FB instances it invokes, functions and methods it calls,
recursively to depth (what runs when this POU runs).
Inputs: root (required), depth. Returns: object
proj_changedARead-only
Units whose source differs from a git revision (default: uncommitted work) plus untracked files — 'what did I change?'; pair with proj_vs_runtime for 'is it deployed?'.
Inputs: since. Returns: object
proj_get_codeBRead-only
Source of an object ('FB_Valve', 'FB_Valve.Open', 'MAIN'): declaration/implementation with file line numbers, parsed VAR declarations, sub-items.
Inputs: name (required), part, with_line_numbers. Returns: object
proj_interfaceBRead-only
Public interface of an FB/program: inputs/outputs/in-out with types and comments, methods (access, signature), properties (get/set), actions, extends/implements.
Inputs: name (required). Returns: object
proj_librariesARead-only
Library versions (K3): every library reference of each PLC project — the version it asks for, the version it effectively resolves to on this PC ('*' = newest installed) and what is installed in TwinCAT's library repository. Flags a pinned version that is not installed. Reads the .plcproj and folder names only.
Inputs: no named parameters. Returns: object
proj_lintARead-only
Static checks over one object or the whole project: unused locals, naming prefixes
(override map via prefixes), undocumented VAR_INPUT/OUTPUT, TODO markers, REAL
compared with =, VAR_INPUT assigned inside an FB, empty methods, GVL/ENUM without
qualified_only, magic numbers, FB_init/FB_exit without SUPER^; OOP/safety: interface_contract
(every member of each IMPLEMENTS interface present with matching signature — info, not error,
when the interface or a base lives in a library), extends_cycle, abstract_instantiation,
shadowed_member (method input/local hides an FB member), unsigned_loop (BY -1 or TO n-1 on an
unsigned counter), new_delete (__NEW without __DELETE, target lacking enable_dynamic_creation).
Deterministic and offline; the compiler (xae_build + xae_diagnostics) stays the authority.
rules= subset to run.
Inputs: name, rules, prefixes. Returns: object
proj_listCRead-only
List indexed objects. kind: PROGRAM | FUNCTION_BLOCK | FUNCTION | STRUCT | ENUM | UNION | ALIAS | GVL | INTERFACE | METHOD | PROPERTY | ACTION (case-insensitive).
Inputs: kind, limit, pattern. Returns: object
proj_read_fileCRead-only
Raw text of a project file (relative to project root or absolute).
Inputs: path (required), max_chars. Returns: object
proj_referencesCRead-only
Where a type/object is instantiated (variables of that type) and mentioned.
Inputs: name (required), max_hits. Returns: object
proj_resolve_symbolARead-only
Map an ADS symbol path (MAIN.fbFill.fbValve.bOpen) to the file:line where each hop is declared, following variable types through FB/STRUCT definitions. Hops inside a library type (Tc2_Standard.CTU.CV) are completed from the runtime's datatype table when the target is reachable. A first name declared in several PLC projects (MAIN in Plc1 and Plc2) is the one of the PLC project on the connected ADS port (AmsPort in the .tsproj).
Inputs: symbol (required). Returns: object
proj_scanBRead-only
Index the project tree (.sln/.tsproj/.plcproj/.TcPOU/.TcDUT/.TcGVL/.TcIO). incremental=true re-indexes only files whose mtime changed (fast after XAE saves).
Inputs: root, incremental. Returns: object
proj_searchCRead-only
Regex search over all declarations/implementations → unit, file, line, text.
Inputs: regex (required), kinds, max_hits, ignore_case. Returns: object
proj_set_codeAIdempotent
Write declaration/implementation back into the .TcPOU/.TcDUT/.TcGVL file (keeps the rest of the XML byte-identical, writes a .bak, drops the object's stale ). Use when XAE is closed or for batch edits; otherwise prefer xae_pou_set. Written also while the attached XAE has the project open — the result then says what that means (xae_open).
Inputs: name (required), declaration, strip_lineids, implementation, +1 more. Returns: object
proj_validate_xmlAIdempotent
Structural validation of .TcPOU/.TcDUT/.TcGVL files: XML well-formedness, Name/Id, GUID format + project-wide uniqueness, Declaration/Implementation presence, property accessor VAR blocks, LineIds vs implementation line counts, EOF newline. fix=true applies safe fixes (.bak written); regenerate_lineids rebuilds LineIds blocks.
Inputs: fix, name, regenerate_lineids. Returns: object
proj_variablesARead-only
Every variable the project source declares, flattened to runtime instance paths by walking programs and GVLs through FB/STRUCT definitions (MAIN.fbFill.fbValve.bOpen …). scope = one program/GVL/FB to walk instead of all. Library-typed variables stay as one item with their type. A name declared in several PLC projects is walked in the PLC project on the connected ADS port (the .tsproj's AmsPort); pin another with '@'.
Inputs: scope, max_array, max_items, include_temp. Returns: object
proj_vs_runtimeARead-only
Cross-check the source against the running PLC: variables declared in the project but not present online (not compiled / not activated / optimised away) and online variables under the same programs/GVLs that the source does not declare (stale boot project, library internals); roots_not_on_target names a program/GVL of which the target has no symbol at all, with the cause (a GVL nothing references is not linked). Use after a deploy to prove the target runs this source.
Inputs: scope, max_items. Returns: object
rec_captureAIdempotent
One call for "record X for N s and give me the stats": starts a recording, waits (≤ 60 s), stops, and
returns per-symbol statistics, completeness and the rec_verify verdict (integrity + PLC timeline, plus the
optional per-cycle counter) with the file path. For longer or triggered captures use rec_start.
Inputs: mode, engine, prefix, counter, +3 more. Returns: object
rec_compareARead-only
Before/after comparison of two recordings: per-symbol stat deltas (count, min, max, mean, changes, edges) and pulse width/period deltas for BOOLs — timing regression after a code change.
Inputs: id_a (required), id_b (required), symbols. Returns: object
rec_deleteADestructive
Stop (if running) and delete a recording and its exports from disk. Destructive-class (field report R11): a recording is evidence — guarded mode needs tc_request_confirmation(action='rec_delete', target=); the audit keeps the deleted file's size and SHA-256 so its content stays identifiable.
Inputs: id (required), confirm_token. Returns: object
rec_exportARead-only
Export a recording to CSV. csv_wide: one row per PLC sample time, one column per variable and per array element (name[i]); an empty cell means no sample of that variable at that time (fill=true forward-fills — handy for charts, but a cell then no longer means "sampled now"). csv_long: t_ms,symbol,value. Both include plc_filetime (the PLC's own sample timestamp) when available. Default path next to the JSONL. An out_path must be in a folder this server writes to ([server] output_dirs adds more). An existing file — also an earlier export at the default path with other symbols/fill, or of a recording that has grown since — is only replaced with overwrite=true; an identical re-export (same source bytes and parameters) is not refused.
Inputs: id (required), fmt, fill, symbols, +2 more. Returns: object
rec_latencyARead-only
Edge-to-edge latency in a recording: from each time from_symbol from_op from_value
becomes true to the next time to_symbol to_op to_value becomes true (PLC timestamps).
E.g. bOpenCmd == TRUE → rFlow > 0.5.
Inputs: id (required), to_op (required), from_op (required), to_value (required), +4 more. Returns: object
rec_listCRead-only
Recordings of this session (compact status) and recording files on disk, newest first (paged: limit/offset; on_disk_total says how many exist); a recording with Scope: its scope state.
Inputs: limit, offset. Returns: object
rec_profile_deleteCIdempotent
Delete a profile and its checklist file.
Inputs: name (required). Returns: object
rec_profile_getBRead-only
One profile in full: every symbol with its mode and cycle, triggers, per-group cost estimate.
Inputs: name (required). Returns: object
rec_profile_listCRead-only
Saved capture profiles (name, symbol count, modes, source).
Inputs: no named parameters. Returns: object
rec_profile_saveAIdempotent
Save a named capture profile. Sources combine: explicit symbols (mode='auto' picks cycle for REAL/TIME, change for BOOL/INT/enum, poll for strings — or give cycle|change|poll), a marked checklist (path, or the name given to rec_scan), and/or {attribute 'tcmcp.record' := 'cycle'} pragmas in the source (from_attributes=true; scope limits to one program). Triggers and the default cycle are stored with the profile. rec_profile_start(name) replays it.
Inputs: name (required), mode, scope, replace, +9 more. Returns: object
rec_profile_startBIdempotent
Start recording a saved profile: one recording per (mode, cycle_ms) group, all named '/@'. Triggers given here override the profile's. Returns the recording ids; rec_profile_stop(name) stops them together, rec_stats/rec_export work per id. align (default, several groups, no start_when): every group starts on the same PLC cycle — a shared start trigger on the task's cycle counter a moment ahead — and duration_s then counts from that cycle, so all files cover the same window (D29: groups started ≈ 160 ms apart).
Inputs: name (required), align, stop_when, duration_s, +2 more. Returns: object
rec_profile_stopAIdempotent
Stop every live recording started from this profile; returns per-recording status + stats.
Inputs: name (required). Returns: object
rec_pulsesBRead-only
Pulse / dwell analysis of one recorded symbol: for BOOL → pulse count, high/low widths, period, frequency, duty (fine-dosing valve pulses); for other types → state timeline with dwell times.
Inputs: id (required), symbol (required), max_list. Returns: object
rec_readBRead-only
Read a time window of a recording from its file. wide=true: one row per PLC timestamp with one column per selected symbol; a cell is null when that symbol has no sample at that time — nothing is invented (R4). fill=true repeats the last known value into those cells and lists them per row under "_filled" (handy for 'what else was true when X happened', but a filled cell is not a sample). Works on finished recordings from earlier sessions too.
Inputs: id (required), fill, wide, symbols, +3 more. Returns: object
rec_scanARead-only
Enumerate the variables that could be recorded and what each would cost. source='runtime' walks the live symbol/datatype tables (every scalar leaf under prefix, or all programs/GVLs); source='project' walks the source declarations (works offline). pattern selects leaves exactly as rec_start does: '*'/'?' wildcards, '[ ]' literal, a leaf matches when it or a parent matches. Returns counts by type and by group (program.instance) with bytes/s estimates at cycle_ms, a suggested mode per leaf, and — when checklist='' — writes ~/.twincat_mcp/profiles/.checklist.csv with a 'select' column to mark (preselect = patterns already marked). Then rec_profile_save(name, from_checklist=name).
Inputs: show, prefix, source, pattern, +4 more. Returns: object
rec_snapshotCRead-only
Most recent events of a running (or finished) recording — the live tail.
Inputs: id (required), last_n, symbols. Returns: object
rec_startAIdempotent
Start a continuous real-time recording of online PLC variables (runs in the background until rec_stop, duration_s, max_events or stop_when). Select by explicit symbols (an FB or struct instance expands to all its leaves), prefix ('MAIN.fbFill', 'GVL_Sim.aCh[1]' → every leaf under it) or pattern — the same leaves rec_scan lists for it: ''/'?' wildcards, '[ ]' literal ('GVL_Sim.aCh[1].'), a leaf is recorded when it or one of its parents matches ('*bOpen' → every bOpen). mode: 'cycle' = one PLC-timestamped sample per symbol per cycle_ms (ADS notification, cycle-accurate); 'change' = PLC-timestamped sample only when the value changes (checked every cycle_ms); 'poll' = sum-read every cycle_ms from this PC. Triggers: start_when='MAIN.bStart == TRUE' with pre_trigger_ms keeps the events before the trigger (scope-style); stop_when='MAIN.fbFill.bDone == TRUE'. Events stream to a JSONL file. duration_s is PLC time from the first sample (also while waiting for start_when); post_trigger_s ends the recording that long after the start_when trigger fired (scope-style post-trigger window). Timestamps (cycle/change) are the TwinCAT runtime's own, stored exactly with the raw bytes it sent; neighbouring variables share ONE notification (a block), which is what keeps 1 ms recordings lossless — select whole FBs, structs or arrays rather than hundreds of scattered globals. Any notification that cannot be registered fails the start (allow_partial=true records the rest and lists unsubscribed_symbols). max_delay_ms > 0 lets the runtime batch samples (fewer ADS frames; each sample keeps its own timestamp). cycle mode also records a per-cycle counter as ground truth (cycle_counter='auto' = the matching task's _TaskInfo[n].CycleCount, or your own e.g. 'MAIN.nCycleCount', or null for none) and the header carries a manifest of what was recorded from (AppTimestamp, OnlineChangeCnt, tasks, TwinCAT build, symbol version). A recording is of one program: a download / online change while it runs ends it at the last sample verified against the symbol version (program_changed); nothing sampled from the new program is written. Conditions are levels: a start_when that already holds fires at once — edge_triggers=true fires only when it BECOMES true. A condition may name one element of an array recorded as a whole (GVL_Test.aCounter[1] when GVL_Test.aCounter is recorded). engine (cycle mode): 'native' = the C++ capture service (Beckhoff AdsLib on TcAdsDll: ADS callback → ring → file, no Python on the data path), 'python' = the in-process recorder, None = recorder.engine from the config (default 'auto': native when installed). The response says which engine ran and why. After stopping: rec_verify. also_scope: also run the TwinCAT Scope configuration open in XAE (scope = its name when several are open) — StartRecord now; at rec_stop StopRecord and SaveSVD into /Scope Recordings/.svdx, the CSV .scope.csv exported from that file with Beckhoff's export tool (XAE's ExportCSV only without it, flagged), XAE's ExportCSV of what Scope holds in memory beside it (.scope.xae.csv) with both row counts compared (cross_check — a saved .svdx shorter than memory, or the reverse, is a warning), a signed link file, and the Scope View log's new ERROR / FATAL lines (scope_view_log). A .svdx still being written 15 s after SaveSVD is not exported. What Scope records (channels, sample time) is set in that configuration. With recorder.also_scope = 'ask' (default) and a Scope configuration open, leaving also_scope unset asks the user (prompt, or an error that tells you to ask and call again with true/false). After a recording Scope holds its data until it is disconnected: a recording with Scope then asks to disconnect it first — scope_disconnect=true / false is the user's answer (false: this recording without Scope).
Inputs: mode, name, scope, engine, +17 more. Returns: object
rec_statsARead-only
Per-symbol statistics over the whole recording so far: count, first/last, min/max/mean, change count, BOOL rising/falling edges with timestamps, and value runs (state timeline with dwell times). Live (incremental) while complete; recomputed from the file when the ingest had to skip statistics under load, for recordings of earlier sessions, or with exact=true.
Inputs: id (required), exact, symbols, max_runs, +1 more. Returns: object
rec_statusARead-only
Live status of one recording: samples, events, rate, missing_samples (holes in the PLC timeline, cycle mode), completeness, dropped (lost on this PC), backlog, stats_coverage, per-block report, warnings, armed/triggered, last value per symbol; with Scope: scope {state recording | finishing | finished | stop_unknown} (N182; recording with stop_refused: XAE refused StopRecord, rec_stop asks again).
Inputs: id (required). Returns: object
rec_stopBIdempotent
Stop a recording, release the ADS notifications, finalize the file; returns status + stats. With Scope: its part is finished, and Scope (it now holds this recording) is closed, starts a new recording, or keeps the data (pause) — the user is asked (scope_next).
Inputs: id (required). Returns: object
rec_verifyARead-only
Prove a finished recording. integrity: the file is byte-for-byte what the recorder wrote (sha256 of every
line, signed with this install's key) — 'MODIFIED' if anything was edited. timeline (cycle mode): per
notification block, holes between the PLC's own sample timestamps. counter (optional): a PLC variable that
increments every cycle and was recorded with the rest (your nCycleCount, or
TwinCAT_SystemInfoVarList._TaskInfo[1].CycleCount) must step by exactly step per sample — ground truth
for 'no sample lost'. verdict PASS only if all checks hold; INCONCLUSIVE when the file is intact but its
completeness cannot be shown (a change / poll recording without counter=, or a stop from an older version
whose blocks ended apart); FAIL on any loss, a block that never delivered, or symbols not subscribed.
Inputs: id (required), step, counter. Returns: object
scope_exportAIdempotent
Export a saved TwinCAT Scope recording (.svdx / .svd) to CSV with Beckhoff's TC3ScopeExportTool.exe
(command line "svd=<file>" target=<csv> silent; CSV needs no extra licence). Default target:
/Scope Recordings/.csv ([scope] export_dir). The CSV is Beckhoff's output, unchanged — channels, time
column and alignment of channels with different sample times follow the Scope project's export settings. A
signed .provenance.json records the source file and SHA-256, the tool and its SHA-256, and the command.
A read-only source (rec_stop seals its .svdx) is exported from a byte-identical writable copy. scope_view_log:
the ERROR lines the Scope View logs (TcScopeView.log and its numbered siblings, TcScopeView_1.log …) got during the export.
Inputs: svd (required), target, overwrite. Returns: object
scope_listBRead-only
TwinCAT Scope configurations in the solution open in XAE (TwinCAT Measurement projects). Their channels, sample time and record time are what scope_record / rec_start(also_scope=true) record.
Inputs: no named parameters. Returns: object
scope_recordBIdempotent
Drive a Scope configuration open in XAE (Automation Interface IMeasurementScope): action = start | stop | disconnect (Scope discards what it holds and is back in Config — needed before it records again; asks for the user's confirmation unless what it holds is a recording the plugin saved) | new (disconnect, then start) | save (SaveSVD → /Scope Recordings/-.svdx, or path=.svdx; the .csv exported from that file with Beckhoff's export tool — XAE's ExportCSV only without it, flagged, and never over an existing CSV; XAE's ExportCSV of the in-memory data beside it, .xae.csv, row counts compared in cross_check; the Scope View log's new ERROR / FATAL lines). scope = its name when several are open. Affects only the Scope recording, not the PLC. One Scope, one owner (N189): while a recording's Scope part has Scope, its rec_stop / rec_delete stop and save it — start / stop / save / disconnect / new here are refused; a Scope recording started here owns Scope until action='stop'.
Inputs: action (required), path, scope, confirm_token. Returns: object
scope_statusBRead-only
TwinCAT Scope on this PC: where TC3ScopeExportTool.exe is (TE130x Scope View / TF3300 Scope Server) and the default export folder.
Inputs: no named parameters. Returns: object
snap_applyADestructive
Write a saved snapshot back to the PLC (recipe / parameter restore). dry_run lists the differences only. Every differing symbol is gated like ads_write.
Inputs: name (required), dry_run, symbols. Returns: object
snap_compareBRead-only
Diff snapshot a against b (another snapshot or 'live'), numeric tolerance applies.
Inputs: a (required), b, symbols, tolerance. Returns: object
snap_listCRead-only
Saved snapshots.
Inputs: no named parameters. Returns: result
snap_saveBIdempotent
Save a named snapshot of live values (expanded like rec_start) for regression comparison — parameters, recipes, whole FB instances before/after a change.
Inputs: name (required), prefix, pattern, symbols, +1 more. Returns: object
tc_allow_writeAIdempotent
Add (or remove) a write allow-list pattern for THIS session only — the in-session alternative to editing twincat_mcp.toml and reconnecting. fnmatch, case-insensitive: 'GVL_Test.*', 'MAIN.fbDispense.rSetpoint'. Control-class: needs a confirmation (prompt or confirm_token from tc_request_confirmation(action='tc_allow_write', target=''), or target='-' to remove). The deny list still wins; the change is audited and lost at the next server start.
Inputs: pattern (required), remove, confirm_token. Returns: object
tc_audit_tailBRead-only
Last n audit records (mutating calls, confirmations, mode changes).
Inputs: n. Returns: result
tc_doctorARead-only
Environment check: platform, pyads/router, local AMS NetId, XAE ProgIDs in the
registry, running XAE shells, project root, safety mode, whether a confirmation prompt can reach the user
in this session (elicitation: the negotiated MCP revision and the client's declared capability). Run this
first. Starts with a one-line summary; verbose=true adds the full loaded configuration.
Inputs: verbose. Returns: object
tc_reload_configAIdempotent
Re-read twincat_mcp.toml (and TCMCP_* env) without a restart. Applies: safety allow/deny lists, confirm_destructive, confirm_ttl_s, docs settings, naming prefixes, dialog rules, tcunit result path. Reports — but does not apply — changes that need a restart: ads target/port, solution path, project root, mode/max_mode (use tc_set_mode).
Inputs: no named parameters. Returns: object
tc_request_confirmationARead-only
Issue a single-use confirm_token for a control/destructive tool: action = the tool's exact name. Easiest: pass the tool's own arguments as args (e.g. action='xae_plc', args={'action': 'login', 'plc_project_path': 'TIPC^Plc^Plc Project'}) — the server computes the target the tool will check, the same way the tool does. A target given by hand must equal it (a partial one — 'login', 'PLC.Login' — is completed); the error names the right one. Targets: xae_deploy / xae_restart_twincat / xae_activate_configuration / tcunit_run: the XAE target NetId; xae_plc: ':@'; xae_command: '@'; xae_boot_project: the plc_project_path (with '@' when activate_after_generate); xae_tree_delete: '<parent_path>^'; xae_library_add: ':'; xae_library_remove: ':' + ' ()' and ', ' when given; xae_placeholder_add: ':'; xae_placeholder_resolve: ':=' + ', ' when given; xae_placeholder_freeze: ':' ('*' for all); xae_link: ' -> ' (paths as normalised: '^', TIID) + ' [offsets /, bit]' for a part; xae_unlink: ' -> ', or ' -> (all )'; xae_links_import: ':<sha256 of the XML text, 16 hex> over <sha256 of the table now, 16 hex> (+ -)' — the dry run's confirm_target; xae_target: the new NetId; xae_dialog_resolve: ':'; ads_plc_state / ads_system_mode: the action (run, stop, reset / run, config); ads_connect: the NetId, or 'local'; ads_add_route_to_plc: the PLC's IP address; ipc_write_file / ipc_delete_file / ipc_start_process: the remote path; ipc_eventlog: the log name; ipc_reboot: the literal 'target'; rec_delete: the recording id; tc_set_mode: the mode; tc_allow_write: the pattern ('-pattern' to remove); exp_run: the experiment name; kb_rebuild: the index: 'infosys', 'manuals' or 'esi'.
Inputs: action (required), args, target. Returns: object
tc_safety_statusARead-only
Current safety mode (and where it came from), ceiling, allow/deny lists, pending confirmation tokens.
Inputs: no named parameters. Returns: object
tc_session_reportBRead-only
Markdown handover of this session: mode changes, writes, deploys and other mutating calls from the audit log, recordings, snapshots and dumps produced. Written to ~/.twincat_mcp/reports/.md (or out_path).
Inputs: inline, out_path, overwrite. Returns: object
tc_set_modeAIdempotent
Switch safety mode: readonly | guarded | full. Lowering is free. Escalating (guarded→full, readonly→guarded) is capped at max_mode AND needs a confirmation (prompt or confirm_token) — an agent must not be able to widen its own permissions silently.
Inputs: mode (required), confirm_token. Returns: object
tcunit_resultsBRead-only
Parse a TcUnit xUnit result into a pass/fail summary. Source: the file on the target over ADS (default: configured remote path), a local file, or raw XML text.
Inputs: xml_text, local_path, remote_path. Returns: object
tcunit_runADestructive
Full TcUnit cycle: save (checked) → build → boot project autostart+generate → activate → restart → delete old result → wait for the xUnit file on the target → parse. Destructive-class (it activates a configuration on the target): tc_request_confirmation(action='tcunit_run', target=). plc_project_path from xae_plc_projects. TcUnit writes the result file only with its library parameter GVL_Param_TcUnit.xUnitEnablePublish = TRUE (default FALSE): the run is refused before anything is activated when the project source says FALSE, and stops waiting when the PLC reports FALSE (D40).
Inputs: plc_project_path (required), timeout_s, disable_io, save_first, +4 more. Returns: object
tcunit_scaffoldAIdempotent
Generate _Tests.TcPOU (TcUnit.FB_TestSuite) with Test_InitialState and one test method per public method, arranged from the FB interface, and register it in the .plcproj. Assertions are left as TODO stubs.
Inputs: fb_name (required), out_dir, overwrite, add_to_plcproj. Returns: object
test_expectARead-only
Assert conditions on live values. checks: [{symbol, op, value, tolerance?}], op ∈ == != > >= < <= ~= (relative/abs tolerance) in between. within_ms>0 waits until all hold. Returns pass/fail per check with the time each one was met.
Inputs: checks (required), within_ms, interval_ms. Returns: object
test_responseADestructive
Write a stimulus ({symbol: value}) and measure the PLC-timestamped latency until
response ('MAIN.fbValve.bOpen == TRUE') holds — how fast does the FB react? Writes are
gated per symbol; originals are restored afterwards unless restore=false.
Inputs: response (required), stimulus (required), restore, timeout_ms. Returns: object
test_scenarioADestructive
Scripted FB test against the live PLC with a recording in parallel. spec = {name, record:{symbols|prefix|pattern, mode, cycle_ms}, steps:[{at_ms?, write:{sym:val}} | {expect:[checks], within_ms} | {wait_ms} | {wait_until:{symbol,op,value,timeout_ms}} | {stable:{symbol,duration_ms,tolerance}}], final_expect:[checks], timeout_ms, restore, stop_on_fail}. Every written symbol is gated before the run starts; written values are restored at the end. Returns per-step results, overall pass, and the recording id.
Inputs: spec (required). Returns: object
test_stableBRead-only
Assert a value does not move more than tolerance for duration_ms (settle check for a weight, pressure, PID output, state).
Inputs: symbol (required), tolerance, duration_ms, interval_ms. Returns: object
wf_debug_symbolBRead-only
One-call debugging dossier for a variable: live value, declaring file:line chain, the statements that write it, code excerpts around them, and a short change watch.
Inputs: symbol (required), watch_ms, context_lines. Returns: object
wf_fb_profileBIdempotent
Profile an FB instance for duration_s: records every leaf (change mode), samples task timing in parallel, then reports most-active symbols, boolean pulse rates, state dwell timelines, silent symbols and the FB's cost on the task. Read-only on the PLC.
Inputs: instance (required), cycle_ms, duration_s, task_index. Returns: object
wf_project_overviewARead-only
Orientation in one call: index summary, programs with call trees, FBs with interfaces, GVLs/DUTs, lint summary, git state.
Inputs: no named parameters. Returns: object
wf_release_checkAIdempotent
Go/no-go before a deploy: git changes, build result, lint, source-vs-runtime, TcUnit result on the target, task health. Writes nothing to the PLC.
Inputs: run_build, lint_rules, plc_project_path. Returns: object
xae_activate_configurationADestructive
ActivateConfiguration on the current target (overwrites the boot project on the IPC). Destructive-class. Follow with xae_restart_twincat.
Inputs: confirm_token. Returns: object
xae_attachAIdempotent
Attach to the running XAE shell / Visual Studio (Running Object Table) that has the solution: solution_path when given (from then on every xae_* tool works on it — flagged solution_mismatch when it is not xae.solution_path), else xae.solution_path. A solution no shell has open is never replaced by another one (refused, or launch=true starts a shell with it); several shells with different solutions and none named or configured: refused. If the solution is closed later, every xae_* tool refuses until it is open again (in any shell — they find it by themselves).
Inputs: launch, progid, solution_path. Returns: object
xae_boot_projectBIdempotent
Boot project settings: set Autostart and/or GenerateBootProject (local, no activate unless activate_after_generate=true, which is then destructive-class).
Inputs: plc_project_path (required), generate, autostart, confirm_token, +1 more. Returns: object
xae_buildAIdempotent
Build the solution. save_first (default) runs File.SaveAll, saves whatever the shell still reports unsaved, and checks that every xae_pou_set / xae_pou_create edit of this session is in the source files — it refuses to build otherwise (an external reload would discard the edits). Returns success, error/warning items with file:line (VS error list, or parsed from the Build output pane) and the output tail. check_all_objects=true runs PLC 'Check all objects' instead (compiles unused POUs). After a build of 0 errors, link_check names the GVLs nothing in the source references (TwinCAT does not link them: no symbol on the target) unless they carry {attribute 'linkalways'}.
Inputs: clean, rebuild, save_first, check_all_objects. Returns: object
xae_commandBDestructive
Execute an arbitrary DTE command (e.g. 'PLC.Login'). Control-class; commands whose name contains download/reset/activate/restart/delete/remove/shutdown are destructive-class.
Inputs: name (required), args, confirm_token. Returns: object
xae_deployADestructive
Save → build → (boot project autostart on) → activate → restart, in one call. Stops at the first build error. Destructive-class (one confirmation covers all steps). Refuses when the XAE target and the ADS target of this server differ. Done = the target runs the new configuration: in RUN and a restart proven (steps.verify.transition_by): 'poll' (another state seen after the commands), 'mode_change' (it was not in RUN before the activation), 'witness' (task 1's cycle counter went back, or the PLC application's compile timestamp changed). In RUN without such proof is reported as that, not as 'not in RUN'.
Inputs: skip_build, confirm_token, plc_project_path, allow_target_mismatch. Returns: object
xae_diagnosticsBRead-only
Current XAE Error List (errors/warnings/messages with file:line — TwinCAT's own entries too, read from the
list view when the automation interface reports none; this focuses the Error List window) merged with the
Build output pane, plus the pane's tail, without rebuilding. source names where each part came from.
Inputs: tail_lines. Returns: object
xae_dialog_resolveADestructive
Click a button on an open XAE dialog ('OK', 'Yes', 'No', 'Cancel'…). remember=true adds an auto-answer rule for that title (never for machine-affecting prompts). Control-class; machine-affecting prompts (activate/run/download/login/delete/safety) are destructive-class. A window that is not a standard dialog is pressed through UI Automation; one whose buttons cannot be read is refused (close it in XAE) — never closed by the tool.
Inputs: button (required), hwnd, remember, confirm_token. Returns: object
xae_dialogsARead-only
Modal dialogs currently open in the attached XAE shell (title, class, text, buttons), the watchdog's auto-answer rules and its recent log. A pending dialog blocks every COM call. Any window that holds the shell modal (its main window disabled) is listed, whatever its class (WPF About / Options, WinForms): its buttons read through UI Automation, or buttons null + buttons_note when they cannot be read; unidentified when the shell is modal but no window could be named.
Inputs: no named parameters. Returns: object
xae_io_disableAIdempotent
Set/clear the Disabled flag on I/O devices under TIID (all, or the named ones) so a configuration activates without the hardware present — TcUnit on a PC, dry runs.
Inputs: only, disable. Returns: object
xae_library_addAIdempotent
Add a library reference (AddLibrary): library by name, version ('' = '*', the newest installed) and distributor, or by display name 'Tc2_Math, * (Beckhoff Automation GmbH)'. XAE refuses a bare name: a missing distributor / version is completed from the installed libraries (ScanLibraries) — refused when the library is not installed, is installed from several distributors and none is given, or a pinned version is not installed. Refused when it is already referenced. Runs once; the result has the references before / after, XAE's messages, and build_required — it never builds. guarded: confirmation tc_request_confirmation(action='xae_library_add', target=':').
Inputs: library (required), version, distributor, confirm_token, +1 more. Returns: object
xae_library_installedBRead-only
The libraries installed in the repositories XAE uses (ScanLibraries): name, version, distributor — every version of a library. name filters (part of the name, any case).
Inputs: name, max_items, plc_project_path. Returns: object
xae_library_listARead-only
The library references of a PLC project as XAE holds them now (TE1000 ITcPlcLibraryManager): libraries (name, version, distributor) and placeholders (default and effective resolution — '*' and what it resolves to). Flags a library referenced twice and a version that is not installed (ScanLibraries; check_installed=false skips it), and the references and requested versions that differ from the saved .plcproj (unsaved changes; an unsaved resolve / freeze cannot be seen). plc_project_path: plc_path, iec_project_path or instance_path — needed when the solution has more than one PLC project.
Inputs: check_installed, plc_project_path. Returns: object
xae_library_removeADestructive
Remove a library or placeholder reference (RemoveReference). A name referenced more than once (a library and a placeholder of the same name, two versions) is refused until kind ('library' / 'placeholder') or version says which ('#X' = the placeholder X). RemoveReference itself takes a name (and a library's version): which of a placeholder and a library of one name XAE removes is checked afterwards and said. Code that uses it does not build any more — said, nothing in the code is changed. Destructive-class: tc_request_confirmation(action='xae_library_remove', target=':' + ' ()' and ', ' when given).
Inputs: library (required), kind, version, distributor, +2 more. Returns: object
xae_library_repositoriesARead-only
The library repositories XAE uses, in priority order (name, folder). Where this XAE's Automation Interface does not give them, it says so — nothing is guessed.
Inputs: plc_project_path. Returns: object
xae_linkADestructive
Link a variable to its I/O counterpart (ITcSysManager::LinkVariables), both as full tree paths: variable='TIPC^^ Instance^PlcTask Inputs^GVL_IO.bIn', target='TIID^Device 1 (EtherCAT)^Term 1 (EK1100)^Term 2 (EL1004)^Channel 1^Input' (xae_links gives the instance's variables, xae_tree_get the terminals'). offs_* / size_bits for a part (bits; 0 = the smaller of the two). XAE checks that both exist, are variables and fit. A whole link is refused when the two are linked already (a part may be linked besides others). Runs once; the result has what changed in the mapping table and what else the target is linked to. In XAE only — not saved, not activated. TwinSAFE ends are refused. guarded: tc_request_confirmation(action='xae_link', target=' -> ' + ' [offsets /, bit]' for a part).
Inputs: target (required), variable (required), size_bits, offs_target, +2 more. Returns: object
xae_linksARead-only
Variable links of the PLC instance: every AT %I*/%Q* variable (from the instance's XML) with its link targets (the project's mapping table, ProduceMappingInfo); lists the unlinked ones — array elements too, the usual reason an output never moves — and links whose variable is gone. plc_project_path: plc_path, iec_project_path or instance_path. What could not be read is said (unlinked_count null), never counted as 0. not_restored: links the saved project keeps but XAE could not restore (RestoreInfo in the .tsproj / .xti, e.g. ANotFound after a variable moved) — ProduceMappingInfo does not list them.
Inputs: plc_project_path (required). Returns: object
xae_links_importADestructive
Import a mapping table (, as ProduceMappingInfo writes it) through ConsumeMappingInfo, which replaces ALL links of the project. mode='add': its links are added to the table as it is (nothing removed); 'replace': it is the whole new table. dry_run (default): what would be added / removed / changed — nothing done; its confirm_target is the token target the apply needs. dry_run=false: the table as it is goes to a new backup file first (~/.twincat_mcp/backups/links/), then ConsumeMappingInfo once, then the table is read again and compared; a failure says what the table holds then and how to restore it. xml text or file (on this PC, UTF-8 or UTF-16). Refused while the table has a link with a TwinSAFE end (ConsumeMappingInfo rewrites every link). Destructive-class: tc_request_confirmation(action='xae_links_import', args={xml|file, mode}) — the target is the dry run's confirm_target, ': over (+ -)' (a table changed since: refused).
Inputs: xml, file, mode, dry_run, +1 more. Returns: object
xae_list_commandsBRead-only
List DTE command names containing a substring (to discover what this shell exposes).
Inputs: limit, contains. Returns: object
xae_open_solutionBIdempotent
Open a .sln in the attached shell.
Inputs: path (required). Returns: object
xae_placeholder_addBIdempotent
Add a placeholder (AddPlaceholder) with its default library (library '' = the device's placeholder of that name; a library's missing distributor / version is completed as in xae_library_add). target=':'.
Inputs: placeholder (required), library, version, distributor, +2 more. Returns: object
xae_placeholder_freezeBIdempotent
Freeze a placeholder (all when placeholder is left out) at the version it resolves to now (FreezePlaceholder): '' no longer follows newer installed versions. target=':' ('' for all).
Inputs: placeholder, confirm_token, plc_project_path. Returns: object
xae_placeholder_resolveCIdempotent
Set what a placeholder resolves to (SetEffectiveResolution): library, version ('' or '*' = newest), distributor (completed from the installed libraries when not given). The result checks the effective resolution after it. target=':=' + ', ' when given.
Inputs: library (required), placeholder (required), version, distributor, +2 more. Returns: object
xae_plcADestructive
PLC online actions: login | logout | start | stop | reset_cold | reset_origin | download. First the Automation Interface (ConsumeXml online commands on ' Project' — no active project needed; plc_project_path when there are several PLC projects), then the shell's DTE commands (names vary by build). download/reset_cold/reset_origin are destructive-class, the rest control-class.
Inputs: action (required), confirm_token, plc_project_path. Returns: object
xae_plcopen_exportBIdempotent
Export PLC objects ('POUs.FB_X', 'DUTs.ST_Y' — folder.object) to a PLCopen XML file.
Inputs: items (required), xml_file (required), plc_project_path (required). Returns: object
xae_plcopen_importAIdempotent
Import a PLCopen XML file into a PLC project (path from xae_plc_projects). option: none | rename | replace | skip (conflict handling). replace: the existing object keeps its place (folder) and identity and gets the imported text. TwinCAT's own replace deletes it and re-creates the import at the project root, so the file is imported as renamed copies (PRG_X_1, header renamed too) and the tool finishes the replace: the copy's header is named back, the texts are checked against the XML, written into the existing object, read back, and the declared name must equal the object's name. Only then is the copy — created by this import, it was not in the tree before — deleted (nothing that existed before the import is ever deleted). Anything not proven → nothing written, the copy kept and named in the error. An object that is not at its place after an import is named (removed / moved). Result: replaced, header_renamed, copies_removed, build_required + objects_to_build (build next).
Inputs: xml_file (required), plc_project_path (required), option. Returns: object
xae_plc_projectsARead-only
PLC projects in the TwinCAT project with their tree paths (needed by PLCopen / boot tools).
Inputs: no named parameters. Returns: object
xae_pou_createAIdempotent
Create a PLC object under a folder/POU. kind = program | fb | function | method | property | action | transition | struct | enum | union | alias | gvl | interface | itf_method | itf_property | folder | parameter_list, and accessors on their own: property_get | property_set (under a property) | itf_property_get | itf_property_set (under an interface property). A property / itf_property is created with its accessors (accessors='get,set' default, 'get' or 'set'): without one it does not compile (C0373). return_type: function, method, property; access: PUBLIC | PRIVATE | PROTECTED | INTERNAL. Optional code is set after creation.
Inputs: kind (required), name (required), parent_path (required), access, +7 more. Returns: object
xae_pou_getBRead-only
Declaration/implementation text of a POU/DUT/GVL/interface tree item and its methods/properties/actions.
Inputs: path (required), include_subitems. Returns: object
xae_pou_setAIdempotent
Replace declaration and/or implementation text of a POU item inside the live shell (no file round-trip, XAE keeps LineIds consistent). Build afterwards.
Inputs: path (required), declaration, implementation. Returns: object
xae_restart_twincatCDestructive
StartRestartTwinCAT on the current target (runtime restarts in RUN mode). Destructive-class.
Inputs: confirm_token. Returns: object
xae_statusARead-only
Shell version, open solution, projects, TwinCAT project name, target NetId, started flag. Attaches to the shell first if not attached yet (as every xae_* tool does). solution_bound: the solution the xae_* tools work on; solution_mismatch / refused: it is not open (they refuse); reattached: it was found in a shell again.
Inputs: no named parameters. Returns: object
xae_targetBDestructive
Get (net_id=None) or set the target AMS NetId of the TwinCAT project. Setting is control-class.
Inputs: net_id, confirm_token. Returns: object
xae_tree_consume_xmlBIdempotent
ConsumeXml on a tree item — the generic write path for any configuration (add I/O boxes, link variables, set task cycle time, add project routes on TIRR …).
Inputs: xml (required), path (required). Returns: object
xae_tree_create_childBIdempotent
Generic CreateChild (tree item types/subtypes per Infosys). For PLC objects prefer xae_pou_create.
Inputs: name (required), subtype (required), parent_path (required), info, +1 more. Returns: object
xae_tree_deleteBDestructive
Delete a tree item (POU, box, task …). Destructive-class; the confirmation names the item: tc_request_confirmation(action='xae_tree_delete', target='<parent_path>^').
Inputs: name (required), parent_path (required), confirm_token. Returns: object
xae_tree_getARead-only
System Manager tree item: properties, children to depth, and ProduceXml when xml=true.
Path syntax 'TIPC^Plc^Plc Project^POUs^MAIN' (xae_plc_projects gives the ' Project' path;
its children POUs/DUTs/GVLs are walked even though the node itself reports no ChildCount).
Roots (ITcSysManager::LookupTreeItem shortcuts): TIIC (I/O Configuration), TIID (its I/O Devices), TIRC (Real-Time
Configuration), TIRT (its Additional Tasks), TIRS (its Real-Time Settings), TIRR (its Route Settings), TIPC (PLC
Configuration), TINC (NC Configuration).
Inputs: path (required), xml, depth, max_items. Returns: object
xae_tree_set_valuesBIdempotent
Set element texts in a tree item's XML by relative XPath, e.g. {'TaskDef/CycleTime': '10000'} (unit 100 ns).
Inputs: path (required), assignments (required). Returns: object
xae_unlinkADestructive
Remove a link (ITcSysManager::UnlinkVariables): the one between variable and target, or — target left out — every link of the variable. Full tree paths as the mapping table names them (xae_links). Refused when there is no such link, or when a link to be removed has a TwinSAFE end. Runs once; the result has what changed. In XAE only — not saved, not activated. Destructive-class: tc_request_confirmation(action='xae_unlink', target=' -> ' or ' -> (all )', n = the links it has now).
Inputs: variable (required), target, confirm_token. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 171 tools
The domain prefixes help, but there are many near-duplicate entry points for capturing or inspecting PLC behavior: rec_start, rec_capture, ads_watch, test_scenario, wf_fb_profile, and exp_run all overlap in purpose. Similarly, several read/write, status, search, and deploy tools have boundaries that are hard to keep straight at 171 tools.
All names are snake_case and use stable family prefixes such as xae_, ads_, proj_, and rec_, but verb/object ordering is mixed: xae_pou_get versus xae_pou_create, ads_list_symbols versus ads_read, and proj_get_code versus proj_scan. It is readable, but not one predictable convention.
171 tools is far beyond a well-scoped MCP surface, even for a broad TwinCAT automation domain. Many workflow helpers duplicate compositions of lower-level tools, and the sheer count overwhelms selection.
Coverage is unusually broad across shell automation, build/diagnostics, PLC runtime ADS, project files, recordings, tests, experiments, documentation, ESI hardware lookup, HMI, IPC, Scope, and safety. Some lifecycle operations are only reachable through generic escape hatches such as xae_command or tree XML, but no major domain gap is apparent.
Maintenance
Related MCP Connectors
Connect ChatGPT, Claude, Cursor or VS Code to your Windows PC: files, terminal, browser, apps.
Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Use your own Windows, Mac or Linux computer from ChatGPT, Claude, Cursor or Gemini CLI: run commands, read, write and search files, run long processes. Your computer only makes an outgoing connection (no open ports or VPN). Read-only mode, allowed folders, blocked commands and an action log keep you in control. Free plan available.
Related MCP Servers
- AlicenseBqualityDmaintenanceAn 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.1641MIT
- AlicenseBqualityCmaintenanceMCP server for Beckhoff TwinCAT XAE / TE1000 Automation Interface, enabling control of XAE Shell, TwinCAT tree manipulation, PLC operations, and build actions via natural language.2525MIT
- AlicenseNot gradedqualityDmaintenanceEnables read-only access to Beckhoff TwinCAT PLCs via ADS, allowing queries of device info, symbols, variables, and EtherCAT diagnostics through natural language.8MIT
- FlicenseNot gradedqualityAmaintenanceMCP server for TwinCAT 3 PLC development enabling AI coding agents to build, configure, deploy, and debug TwinCAT PLC projects through a standard tool interface.2-