@casys/mcp-openems 0.0.0-stage → 0.2.0

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Casys
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,76 @@
1
- # Temporary Holding Version
1
+ # `@casys/mcp-openems`
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Standalone Layer-4 native **openEMS** (3D FDTD Maxwell Equations) Electromagnetic & Antenna MCP
4
+ server for Casys Digital Thread, built with `@mcpview/server` and `@mcpview/compose`.
5
+
6
+ ## Tools & Code Mode Snippets
7
+
8
+ - `openems_simulate_blade_antenna` (snippet: `simulate_blade_antenna`): 3D FDTD quarter-wave blade
9
+ monopole antenna on a conductive carbon-fiber fuselage ground plane (`S11`, `VSWR`, resonant
10
+ frequency, 10 dB bandwidth, qualification).
11
+ - `openems_simulate_radome_patch` (snippet: `simulate_radome_patch`): 3D FDTD `1575.42 MHz` (GPS L1
12
+ / Galileo E1) radome transmission / RF-shielding simulation (`aramid`, `fiberglass`, `carbon`)
13
+ measuring `S21` insertion loss and radome qualification.
14
+
15
+ ## Docker
16
+
17
+ ```bash
18
+ docker build -t casys-mcp-openems:local .
19
+ docker run -d --name casys-mcp-openems -p 127.0.0.1:3030:3030 casys-mcp-openems:local
20
+ curl -s http://127.0.0.1:3030/health
21
+ ```
22
+
23
+ ## Install
24
+
25
+ ```bash
26
+ # Deno (JSR)
27
+ deno run --allow-read --allow-write --allow-run --allow-env --allow-net jsr:@casys/mcp-openems/server --port=3030
28
+ # Node >= 20 (npm)
29
+ npx @casys/mcp-openems --port=3030
30
+ ```
31
+
32
+ Both need a local openEMS build with its Python bindings (`openEMS`, `CSXCAD`, `numpy`) on the host;
33
+ the Docker image above ships one.
34
+
35
+ ## Widgets
36
+
37
+ Results are shown as small, individual MCP App widgets, one reading each, never a dashboard. Each
38
+ widget is its own `ui://mcp-openems/<widget>` resource and adapts to the width its host grants (a
39
+ Compose board snaps its resize handle between `supportedWidths`; a standalone host gets the widest).
40
+ They work for both solver results (blade antenna and radome).
41
+
42
+ | Widget (`ui://mcp-openems/…`) | Kind | Shows | `supportedWidths` |
43
+ | ----------------------------- | ----- | -------------------------------------------------------------------------- | ----------------- |
44
+ | `rf-verdict` | stat | PASS or FAIL with 1 to 3 headline numbers (S11, VSWR, or insertion loss) | 280, 380, 520 |
45
+ | `rf-gates` | table | Each qualification gate: requirement, reported value, pass or fail | 320, 440, 600 |
46
+ | `rf-margin` | chart | Each gated quantity as a marker against its limit (-10 dB, 2, 1.5 dB) | 320, 440, 640 |
47
+ | `rf-case` | table | Solver results, then inputs and numerics of the case, one row per quantity | 340, 480, 680 |
48
+
49
+ Smallest width: the essential. Middle: the usual reading. Largest: the full detail of that one
50
+ thing, with a provenance footer (engine, openEMS version, case SHA-256). The solver returns scalars,
51
+ not the S11 sweep, so no frequency curve is drawn; `rf-margin` shows the best S11 over the sweep as
52
+ a second marker at the largest width. The stat stays a verdict plus at most 3 numbers and a
53
+ provenance line; the gate-by-gate matrix is the `rf-gates` table. `openems_simulate_blade_antenna`,
54
+ `openems_simulate_radome_patch` and `run_snippet` advertise `rf-verdict` by default; a board selects
55
+ another widget for the same result by resource URI. Every successful `run_snippet` result also
56
+ carries `_meta["io.mcpview/views"]` (name, `resourceUri`, title, `supportedWidths` of each widget),
57
+ so a Code Mode program can show one receipt in several widgets with
58
+ `api.panel(receipt.id, { view:
59
+ "rf-gates" })`. `OPENEMS_WIDGETS` (exported from `mod.ts`) lists
60
+ URIs, kinds and `supportedWidths` for a board to read:
61
+
62
+ ```ts
63
+ import { OPENEMS_WIDGETS } from "jsr:@casys/mcp-openems";
64
+ // { resourceUri: widget.uri, supportedWidths: widget.supportedWidths }
65
+ ```
66
+
67
+ The qualification limits (`ANTENNA_S11_MAX_DB`, `ANTENNA_VSWR_MAX`, `RADOME_LOSS_MAX_DB`) live in
68
+ `src/qualification.ts`; the solver scripts and the widgets both read them.
69
+
70
+ The widget bundle is reproducible: `src/ui/widgets/deno.json` pins exact versions with a
71
+ `minimumDependencyAge` of one day, `src/ui/widgets/deno.lock` is committed, and the build runs
72
+ `deno bundle --lock --frozen`. Each widget HTML embeds `THIRD_PARTY_NOTICES.txt`, which also ships
73
+ in the JSR package and the npm bundle.
74
+
75
+ Rebuild the bundled HTML (`src/ui/dist/<widget>/index.html`) with `deno task build:ui`;
76
+ `deno task check:ui:bundle` fails when a committed bundle is stale.