- TypeScript 95.1%
- CSS 3.2%
- Shell 1%
- Dockerfile 0.6%
- HTML 0.1%
|
Some checks failed
ci.yml / Merge pull request #9 from vidimus-dev/feat/widget-compose-sync (push) Failing after 0s
feat(ui): add bidirectional @mcpview/compose portSync to widgets |
||
|---|---|---|
| .github/workflows | ||
| scripts | ||
| src | ||
| tests | ||
| .dockerignore | ||
| .gitignore | ||
| .release-please-manifest.json | ||
| CHANGELOG.md | ||
| deno.json | ||
| deno.lock | ||
| Dockerfile | ||
| LICENSE | ||
| mod.ts | ||
| README.md | ||
| release-please-config.json | ||
| renovate.json | ||
| server.ts | ||
| THIRD_PARTY_NOTICES.txt | ||
@casys/mcp-openfoam
Standalone native ARM64/AMD64 OpenFOAM v2412 CFD MCP worker (@mcpview/server + Level-2
@mcpview/compose snippets) executing real blockMesh, snappyHexMesh, surfaceFeatureExtract,
checkMesh, simpleFoam (kOmegaSST), potentialFoam, and postProcess simulations in isolated
temporary case directories.
MCP Tools
openfoam_solve_nozzle_cfd— Axisymmetric 5° wedge RANS (simpleFoam,kOmegaSST) simulation of an internal converging exhaust nozzle with central inner tailcone. Returns real mesh verification (Mesh OK., cell count, non-orthogonality, skewness), final solver residuals, area-averaged inlet/exit velocities, peak velocity, pressure drop, momentum thrust estimate, 11-point axial profile, and case SHA-256.openfoam_solve_airfoil_cfd— External 2D 8-block body-fitted biconvex airfoil RANS (simpleFoam,kOmegaSST) simulation. Integrates exact surface pressure and turbulent wall-shear forces directly from OpenFOAM's convergedpolyMesh,p,U, andnutfields to returncd,cdPressure,cdViscous,cl,cm,ldRatio,reynoldsNumber, and case SHA-256.openfoam_run_case— Executes custom OpenFOAM cases (blockMesh+ optionalsurfaceFeatureExtract/snappyHexMesh+ optionaltopoSetactuator-diskcellZone+checkMesh+simpleFoamorpotentialFoam) from caller-provided dictionaries and initial fields, automatically parsing convergedpostProcessing/forceCoeffs(Cd,Cl,CmPitch,Cd(f),Cd(r),ldRatio, plus pressure/viscous breakdown),forces(total,pressure,viscous,momentTotal), andyPlus(min,max,averageper patch) outputs when configured incontrolDict. Supports:- Strictly opt-in Multi-Core MPI via
parallel: { cores, method }(defaultcores: 1= single-core; safely clamped tomin(cores, cpus, 8), defaultscotchdecomposition): runsdecomposePar,mpirun -np <cores> snappyHexMesh -parallel -overwrite,reconstructParMesh -constant,mpirun -np <cores> simpleFoam -parallel, andreconstructPar -latestTime, reportingparallelCoresUsedandparallelSpeedupNote. - Strictly opt-in Actuator-Disk thrust momentum source via
actuatorDisk: { name, cellZone, diskDir, diskAreaM2, thrustN, centerM, radiusM, innerRadiusM, thicknessM, upstreamPointM, rhoKgM3 }: auto-generatessystem/topoSetDict(cylinderToCell+setToCellZone) andconstant/fvOptions(vectorSemiImplicitSource,volumeMode absolute), reporting verifiedselectedCells,selectedVolumeM3,kinematicMomentumSourceM4S2, andequivalentPressureJumpPa. - Strictly opt-in 3D streamline & wake extraction via
flowViz: { enabled: true, seedStart, seedEnd, seedCount, rakes, maxPointsPerLine, mirrorY }(default OFF — zero overhead on routine solves), preserving full downsampled trajectories instructuredContent.flowVizwhile omitting bulky coordinates fromcontent[0].text(flowVizOmittedFromText: true).
- Strictly opt-in Multi-Core MPI via
Widgets
Results are shown as small, individual MCP App widgets, one reading each, never a dashboard. Each
widget is its own ui://mcp-openfoam/<widget> resource and adapts to the width its host grants (a
Compose board snaps its resize handle between supportedWidths; a standalone host gets the widest).
Widget (ui://mcp-openfoam/…) |
Kind | Shows | supportedWidths |
|---|---|---|---|
cfd-verdict |
stat | Converged / not converged / mesh failed with 2 to 3 headline numbers | 280, 380, 520 |
cfd-metrics |
table | Results, mesh quality and final residuals, quantities down | 340, 480, 680 |
axial-profile |
chart | Velocity (and pressure) along the nozzle axis; nozzle runs only | 320, 440, 640 |
Smallest width: the essential. Middle: the usual reading. Largest: the full detail of that one
thing, with a provenance footer (provenance, engine, case SHA-256). The three tools and
run_snippet advertise cfd-verdict by default; a board selects another widget for the same result
by resource URI. Only a nozzle result has an axial profile: for an airfoil or custom-case result
axial-profile shows an explicit empty state, so a board should only offer it for nozzle runs
(kind === "openfoam-nozzle-cfd"). OPENFOAM_WIDGETS (exported from mod.ts) lists URIs, kinds
and supportedWidths for a board to read:
import { OPENFOAM_WIDGETS } from "jsr:@casys/mcp-openfoam";
// { resourceUri: widget.uri, supportedWidths: widget.supportedWidths }
Rebuild the committed single-file HTML with deno task build:ui (needs network access to JSR for
@mcpview/components); deno task check:ui:bundle fails when a bundle is stale.
Docker Quickstart
docker build -t casys-mcp-openfoam:local .
docker run -d --name casys-mcp-openfoam -p 127.0.0.1:3028:3028 casys-mcp-openfoam:local
curl --noproxy '*' http://127.0.0.1:3028/health
HTTP Endpoints
GET /health— Service status, detected OpenFOAM version, registered tools and snippets.POST /mcp— Stateless Streamable HTTP MCP JSON-RPC endpoint (optionalMCP_BEARER_TOKEN).