@renanlido/tia-openness-mcp 1.10.7 → 1.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +32 -15
  2. package/dist/index.js +8019 -2735
  3. package/package.json +19 -3
package/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/%40renanlido%2Ftia-openness-mcp)](https://www.npmjs.com/package/@renanlido/tia-openness-mcp)
4
4
 
5
+ MCP server for Siemens TIA Portal V21, running on macOS, Linux and Windows and connecting to the PLCWare Desktop API on Windows. Using that API requires an active license.
6
+
7
+ 30-day free trial: [https://plcware.io/en/trial?utm_source=npm&utm_medium=readme&utm_campaign=mcp](https://plcware.io/en/trial?utm_source=npm&utm_medium=readme&utm_campaign=mcp)
8
+
5
9
  An **MCP (stdio) server** that is a **pure HTTP client** of the TIA Openness `serve` API
6
10
  (see `docs/API-HTTP.md` in the repository). It does not reference Openness / net48 / x64 — all of that
7
11
  complexity (`AssemblyResolve`, serial MTA worker) lives in the `serve` process. Here we only speak **MCP on
@@ -94,16 +98,23 @@ first. `discardUnsavedChanges:true` is the data-loss choice — the client's con
94
98
  is sent — and is never a way past the refusal. If nothing is modified, both flags are no-ops.
95
99
 
96
100
  **Trust GATE (G1):** setup pre-registers eligible installed executables (Program Files, admin-only ACLs) in the
97
- Openness allow-list. If the executable is not covered by a current entry, connecting can require a human to
98
- confirm the security dialog ON THE HOST. When the dialog is needed, the proactive flow is
99
- **`tia_start` → `tia_show_ui` → (human confirms) → `tia_connect`**.
100
- If `tia_connect` hits the dialog, it does NOT retry-storm: it returns `{ status:"requires_human_action",
101
- gate:"trust_dialog", youMustDo, resumeToken }` after ~180 s without an answer (`TIA_CONNECT_TIMEOUT_MS`) with
102
- `/health` still reachable. Check `tia_status` first — `hasProject:true` means the connect actually succeeded
103
- (the dialog was a false positive on a slow open); with the job mechanism, a `status:"running"` answer from
104
- `tia_connect`/`tia_start`/`tia_show_ui` can ALSO mean the dialog is waiting (`tia_status` itself answers `busy`
105
- until the job ends) — keep polling `tia_job_status`. After the human confirms, call `tia_connect` again with
106
- the `resumeToken`.
101
+ Openness allow-list. If no current entry covers the executable, a human may need to confirm a security dialog
102
+ ON THE HOST. The proactive flow is **`tia_start` → `tia_show_ui` → (human confirms) → `tia_connect`**.
103
+ An explicit G1 handoff is emitted only with serve evidence: `EngineeringSecurityException` from `tia_connect`, or a failed
104
+ start with `kind:"tia_start_failed"` and `details.cause:"trust"`. A human may confirm G1 whenever a trust dialog is visible
105
+ on the serve host; `status:"running"` alone is not G1 evidence, so keep calling `tia_job_status` and do not call `tia_status`
106
+ or repeat the original call while it runs.
107
+ The fixed 20-minute client timeout applies to `tia_start`, `tia_show_ui`, `tia_connect` and `tia_project_create`. An
108
+ ambiguous timeout returns `STARTING_UNCONFIRMED`, not success or G1, and does not cancel the serve-side operation; its serial
109
+ worker may remain occupied. Do not queue serve-bound calls. Ask a human to inspect the serve host and wait until the operation
110
+ is known to be complete before querying `tia_status`. `TIA_CONNECT_TIMEOUT_MS` applies only to `tia_local_session_open` and
111
+ its G6 logon-dialog handling.
112
+ For an explicit `tia_connect` G1 handoff, after the human confirms the visible dialog, call `tia_connect` again with its
113
+ `resumeToken`.
114
+ For a failed start with `details.cause:"trust"`, follow the handoff cleanup steps: close any `stillRunningPids` TIA with no
115
+ project before retrying; verify `unknownPids` in Task Manager and close them only if confirmed as TIA started by this serve
116
+ with no project. Have a human ready at the serve host to click "Yes to all" if the dialog appears, then re-call the same tool
117
+ (for `tia_connect`, with the same `projectPath` and `resumeToken`). See `tia_guide {"topic":"gui-gates"}`.
107
118
 
108
119
  ### M3 — creation/authoring (class M-off) + guards
109
120
  A **compliant-by-construction** creation surface (45 tools) with schema validation (Gd13); every tool except
@@ -294,8 +305,8 @@ soft-deadline job runner instead of blocking the call: `tia_connect`, `tia_start
294
305
  be used to obtain the job ID. The same long tool called again with the same arguments (the key is the tool plus
295
306
  all its arguments) returns the same `jobId` instead of starting a second run; a `tia_connect` that differs in any
296
307
  argument (UI, UMAC, `resumeToken`) answers `busy` while the first one runs.
297
- - If a `tia_connect`/`tia_start`/`tia_show_ui` job stays `running` for minutes, a **trust dialog (G1)**
298
- may be waiting on the serve host — ask a human to look.
308
+ - A lifecycle job that remains running may still be starting or waiting for the trust dialog; `running` alone is not G1 evidence.
309
+ Follow its conditional `nextSteps`, and ask a human to confirm G1 only if the dialog is visible on the serve host.
299
310
 
300
311
  ### Tool annotations, structured output and confirmation dialogs (ADR 0026)
301
312
 
@@ -458,8 +469,8 @@ two inputs and answers the whole list, without `total` or `nextCursor`. The deci
458
469
  |---|---|---|
459
470
  | `TIA_API_BASE` | `http://localhost:5000` | Base URL of the `serve` API. |
460
471
  | `TIA_API_TIMEOUT_MS` | `15000` | Per-request timeout (fail fast if the host/VM does not respond). |
461
- | `TIA_SLOW_TIMEOUT_MS` | `120000` | Timeout for slow/cold ops (catalog, download plan and other slow M1–M3 calls). `tia_project_create` uses `TIA_CONNECT_TIMEOUT_MS`; `tia_compile` does NOT use this variable — it has a separate fixed 120 s timeout. `tia_crossrefs` waits up to 3 900 000 ms (the serve Long timeout of 3600 s plus five minutes, so the serve's own timeout answer arrives first): a larger value here raises that wait, a smaller one never lowers it. |
462
- | `TIA_CONNECT_TIMEOUT_MS` | `180000` | Timeout for the calls that start a new TIA (`tia_connect`, `tia_project_create`, `tia_start`, `tia_show_ui`) before a wait is treated as a possible G1 trust-dialog gate. |
472
+ | `TIA_SLOW_TIMEOUT_MS` | `120000` | Timeout for slow/cold ops (catalog, download plan and other slow M1–M3 calls). Lifecycle tools (`tia_connect`, `tia_project_create`, `tia_start`, `tia_show_ui`) use a fixed 1,200,000 ms ceiling; `tia_compile` does NOT use this variable — it has a separate fixed 120 s timeout. `tia_crossrefs` waits up to 3 900 000 ms (the serve Long timeout of 3600 s plus five minutes, so the serve's own timeout answer arrives first): a larger value here raises that wait, a smaller one never lowers it. |
473
+ | `TIA_CONNECT_TIMEOUT_MS` | `180000` | Timeout for `tia_local_session_open` and its G6 logon-dialog handling. It does not control lifecycle operations or infer G1. |
463
474
  | `TIA_SOFT_DEADLINE_MS` | `20000` | Soft deadline for the 38 long tools before they answer `status:"running"` (capped at `25000`). |
464
475
  | `TIA_PLAN_TTL_MS` | `900000` | Validity of a G3 download `planHash` (15 min); the token lives only in this MCP process. |
465
476
  | `TIA_MCP_MODE` | `full` | `full` registers every tool; `read-only` registers only the class R tools (see [Read-only mode](#read-only-mode-tia_mcp_mode)). Unset, empty or blank means `full`; any other value stops the MCP at start. |
@@ -644,7 +655,7 @@ guide — with the guided setup, each client's exact format and the Windows laun
644
655
  only if the client says the server failed to start) — is in `docs/INSTALL.md` in the repository.
645
656
 
646
657
  **Optional envs** (defaults are built into the MCP — only set them to override): `TIA_API_TIMEOUT_MS` (15000),
647
- `TIA_SLOW_TIMEOUT_MS` (120000), `TIA_CONNECT_TIMEOUT_MS` (180000). E.g. `--env TIA_SLOW_TIMEOUT_MS=180000`
658
+ `TIA_SLOW_TIMEOUT_MS` (120000), `TIA_CONNECT_TIMEOUT_MS` (180000; `tia_local_session_open` G6 logon dialog only). E.g. `--env TIA_SLOW_TIMEOUT_MS=180000`
648
659
  on `claude mcp add`, or the corresponding key in the `.mcp.json` `env`.
649
660
 
650
661
  The `--scope user` command makes the server available across your projects. Only the `.mcp.json` alternative
@@ -660,6 +671,12 @@ npm run smoke # target = local
660
671
  MCP_COMMAND=tia-openness-mcp MCP_ARGS='[]' npm run smoke # (Windows: use the .cmd path)
661
672
  ```
662
673
 
674
+ Dependency security regressions run with `npx vitest run test/shipped-advisories.test.ts`:
675
+ compressed request trailing bytes must not crash the locked parser, and oversized
676
+ constrained collections must be rejected before Zod validates their elements.
677
+ Use `node scripts/audit-shipped.mjs` for the high/critical gate on bundled dependencies;
678
+ `npm audit --omit=dev` alone excludes them because this package bundles its runtime imports.
679
+
663
680
  ## Notes
664
681
 
665
682
  - **No host activation key is sent by the MCP.** Activation is configured on the host (GUI). Human-provided UMAC