@casys/mcp-fmi 0.0.0-stage → 0.1.2

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,82 @@
1
- # Temporary Holding Version
1
+ # `@casys/mcp-fmi`
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 FMI 2.0 Co-Simulation MCP server and Level-2 `@mcpview/compose` Code Mode provider for
4
+ deterministic native-C physics execution.
5
+
6
+ ## Architecture
7
+
8
+ - **Pure TypeScript FMU archive inspector (`inspectFmuArchive`)**: reads `modelDescription.xml`
9
+ directly from any `.fmu` ZIP archive (using Web `DecompressionStream("deflate-raw")`), computes
10
+ the exact archive `fmuSha256`, and verifies typed variable/unit alignment against SysML v2
11
+ attributes (`checkFmiAgainstSysmlAttributes`).
12
+ - **Zero-dependency Python 3 FMI 2.0 runner (`src/runtime/run_fmi2.py`)**: extracts the `.fmu`
13
+ safely, loads `binaries/<platform>/<modelIdentifier>.(dylib|so|dll)` via `ctypes.CDLL`, drives the
14
+ complete FMI 2.0 Co-Simulation C lifecycle (`fmi2Instantiate` -> `fmi2SetupExperiment` ->
15
+ `fmi2EnterInitializationMode` -> `fmi2SetReal` -> `fmi2ExitInitializationMode` -> stepped
16
+ `fmi2DoStep` / `fmi2GetReal` -> `fmi2Terminate` -> `fmi2FreeInstance`), and supports both constant
17
+ inputs and piecewise-constant `inputSchedule` trajectories.
18
+ - **Dual MCP surface (`src/server.ts`)**:
19
+ - Direct MCP tools: `fmi_inspect_fmu`, `fmi_simulate_fmu`
20
+ - Level-2 `@mcpview/compose/code-mode` snippets via `list_snippets` and `run_snippet`:
21
+ `inspect_fmu`, `simulate_fmu`
22
+ - **6-DOF Flight Telemetry Projection**: when simulating a flight-dynamics FMU exporting `posX_m`,
23
+ `posY_m`, `altitude_m`, `pitchDeg`, `rollDeg`, `yawDeg`, and `airspeedMs`, the server
24
+ automatically emits `flightTrack`, effective `flightModel` parameters, and flight qualification
25
+ metrics alongside structural and thermal metrics.
26
+
27
+ ## Literal provenance
28
+
29
+ All simulation results executed against a real compiled `.fmu` emit literal
30
+ `provenance: "verified-solver"`, `engine: "mcp-fmi/fmi2-native"`, and exact `fmuSha256`. When
31
+ `sysmlAttributes` is omitted, `fmiContractStatus` stays literally `"unverified"` — never relabelled
32
+ as `"compatible"`.
33
+
34
+ ## Quick start
35
+
36
+ ### Build the reference native FMUs
37
+
38
+ ```bash
39
+ deno task build:examples
40
+ ```
41
+
42
+ This compiles three zero-dependency C FMI 2.0 Co-Simulation `.fmu` archives into gitignored
43
+ `state/local/fmu/`:
44
+
45
+ - `state/local/fmu/ThermalCantileverHook.fmu` (`examples/thermal-cantilever-hook/`)
46
+ - `state/local/fmu/JetDroneX1.fmu` (`examples/jet-drone-6dof/`)
47
+ - `state/local/fmu/MicroTurbojetBrayton.fmu` (`examples/micro-turbojet-brayton/`)
48
+
49
+ ### Run over stdio
50
+
51
+ ```bash
52
+ deno task serve:stdio
53
+ ```
54
+
55
+ ### Run over HTTP (`POST /mcp`, `GET /health`)
56
+
57
+ ```bash
58
+ deno task serve
59
+ # Optional Bearer authentication on /mcp:
60
+ MCP_BEARER_TOKEN=secret-token deno task serve
61
+ ```
62
+
63
+ ### Run with Docker
64
+
65
+ ```bash
66
+ docker build -t casys/mcp-fmi:0.1.0 .
67
+ docker run --rm -p 3025:3025 -e MCP_BEARER_TOKEN=secret-token casys/mcp-fmi:0.1.0
68
+ ```
69
+
70
+ ## Level-2 Code Mode snippets
71
+
72
+ Connect `@casys/mcp-fmi` to any `@mcpview/compose/code-mode` host using `connectSnippetProviders`:
73
+
74
+ - `inspect_fmu`: `{ fmuPath, sysmlAttributes? }`
75
+ - `simulate_fmu`:
76
+ `{ fmuPath, parameters?, inputs?, inputSchedule?, outputs?, startTime?, stopTime?, stepSize?, sysmlAttributes?, partName?, maxDisplacementLimitMm?, maxStressLimitMPa?, maxTempLimitC?, minThrustToWeight?, minAltitudeLimitM?, minEnduranceLimitMin? }`
77
+
78
+ ## Verification
79
+
80
+ ```bash
81
+ deno task release:check
82
+ ```