@casys/mcp-openfoam 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,61 @@
1
- # Temporary Holding Version
1
+ # `@casys/mcp-openfoam`
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 native ARM64/AMD64 OpenFOAM CFD MCP worker (`@mcpview/server` + Level-2
4
+ `@mcpview/compose` snippets) executing real `blockMesh`, `checkMesh`, `simpleFoam` (`kOmegaSST`),
5
+ and `potentialFoam` simulations in isolated temporary case directories.
6
+
7
+ ## MCP Tools
8
+
9
+ 1. **`openfoam_solve_nozzle_cfd`** — Axisymmetric 5° wedge RANS (`simpleFoam`, `kOmegaSST`)
10
+ simulation of an internal converging exhaust nozzle with central inner tailcone. Returns real
11
+ mesh verification (`Mesh OK.`, cell count, non-orthogonality, skewness), final solver residuals,
12
+ area-averaged inlet/exit velocities, peak velocity, pressure drop, momentum thrust estimate,
13
+ 11-point axial profile, and case SHA-256.
14
+ 2. **`openfoam_solve_airfoil_cfd`** — External 2D 8-block body-fitted biconvex airfoil RANS
15
+ (`simpleFoam`, `kOmegaSST`) simulation. Integrates exact surface pressure and turbulent
16
+ wall-shear forces directly from OpenFOAM's converged `polyMesh`, `p`, `U`, and `nut` fields to
17
+ return `cd`, `cdPressure`, `cdViscous`, `cl`, `cm`, `ldRatio`, `reynoldsNumber`, and case
18
+ SHA-256.
19
+ 3. **`openfoam_run_case`** — Executes custom OpenFOAM cases (`blockMesh` + `checkMesh` +
20
+ `simpleFoam` or `potentialFoam`) from caller-provided dictionaries and initial fields.
21
+
22
+ ## Widgets
23
+
24
+ Results are shown as small, individual MCP App widgets, one reading each, never a dashboard. Each
25
+ widget is its own `ui://mcp-openfoam/<widget>` resource and adapts to the width its host grants (a
26
+ Compose board snaps its resize handle between `supportedWidths`; a standalone host gets the widest).
27
+
28
+ | Widget (`ui://mcp-openfoam/…`) | Kind | Shows | `supportedWidths` |
29
+ | ------------------------------ | ----- | -------------------------------------------------------------------- | ----------------- |
30
+ | `cfd-verdict` | stat | Converged / not converged / mesh failed with 2 to 3 headline numbers | 280, 380, 520 |
31
+ | `cfd-metrics` | table | Results, mesh quality and final residuals, quantities down | 340, 480, 680 |
32
+ | `axial-profile` | chart | Velocity (and pressure) along the nozzle axis; nozzle runs only | 320, 440, 640 |
33
+
34
+ Smallest width: the essential. Middle: the usual reading. Largest: the full detail of that one
35
+ thing, with a provenance footer (provenance, engine, case SHA-256). The three tools and
36
+ `run_snippet` advertise `cfd-verdict` by default; a board selects another widget for the same result
37
+ by resource URI. Only a nozzle result has an axial profile: for an airfoil or custom-case result
38
+ `axial-profile` shows an explicit empty state, so a board should only offer it for nozzle runs
39
+ (`kind === "openfoam-nozzle-cfd"`). `OPENFOAM_WIDGETS` (exported from `mod.ts`) lists URIs, kinds
40
+ and `supportedWidths` for a board to read:
41
+
42
+ ```ts
43
+ import { OPENFOAM_WIDGETS } from "jsr:@casys/mcp-openfoam";
44
+ // { resourceUri: widget.uri, supportedWidths: widget.supportedWidths }
45
+ ```
46
+
47
+ Rebuild the committed single-file HTML with `deno task build:ui` (needs network access to JSR for
48
+ `@mcpview/components`); `deno task check:ui:bundle` fails when a bundle is stale.
49
+
50
+ ## Docker Quickstart
51
+
52
+ ```bash
53
+ docker build -t casys-mcp-openfoam:local .
54
+ docker run -d --name casys-mcp-openfoam -p 127.0.0.1:3028:3028 casys-mcp-openfoam:local
55
+ curl --noproxy '*' http://127.0.0.1:3028/health
56
+ ```
57
+
58
+ ## HTTP Endpoints
59
+
60
+ - `GET /health` — Service status, detected OpenFOAM version, registered tools and snippets.
61
+ - `POST /mcp` — Stateless Streamable HTTP MCP JSON-RPC endpoint (optional `MCP_BEARER_TOKEN`).