OpenFOAM CFD simulation MCP server
  • TypeScript 95.1%
  • CSS 3.2%
  • Shell 1%
  • Dockerfile 0.6%
  • HTML 0.1%
Find a file
Erwan Lee Pesle 0360a8c647
Some checks failed
ci.yml / Merge pull request #9 from vidimus-dev/feat/widget-compose-sync (push) Failing after 0s
Merge pull request #9 from vidimus-dev/feat/widget-compose-sync
feat(ui): add bidirectional @mcpview/compose portSync to widgets
2026-12-05 20:30:49 +08:00
.github/workflows chore(ci): migrate engineering-toolchain and GHCR target to vidimus-dev 2026-12-05 15:32:20 +08:00
scripts feat: replace the monolithic results viewer with three single-purpose widgets 2026-12-03 13:16:39 +08:00
src feat(ui): add bidirectional @mcpview/compose portSync to widgets 2026-12-05 20:28:43 +08:00
tests feat(ui): add bidirectional @mcpview/compose portSync to widgets 2026-12-05 20:28:43 +08:00
.dockerignore feat: initial native ARM64 OpenFOAM CFD MCP worker (@casys/mcp-openfoam) 2026-12-02 13:13:25 +08:00
.gitignore feat: ship an npm build alongside JSR (0.1.1) 2026-12-03 11:05:00 +08:00
.release-please-manifest.json feat: add opt-in multi-core MPI and actuator-disk thrust momentum source (v0.5.0) 2026-12-04 17:01:26 +08:00
CHANGELOG.md feat: add opt-in multi-core MPI and actuator-disk thrust momentum source (v0.5.0) 2026-12-04 17:01:26 +08:00
deno.json feat: add opt-in multi-core MPI and actuator-disk thrust momentum source (v0.5.0) 2026-12-04 17:01:26 +08:00
deno.lock feat: results viewer MCP App (@mcpview/components), 0.2.0 2026-12-03 12:34:16 +08:00
Dockerfile feat: add opt-in multi-core MPI and actuator-disk thrust momentum source (v0.5.0) 2026-12-04 17:01:26 +08:00
LICENSE feat: initial native ARM64 OpenFOAM CFD MCP worker (@casys/mcp-openfoam) 2026-12-02 13:13:25 +08:00
mod.ts feat: add opt-in multi-core MPI and actuator-disk thrust momentum source (v0.5.0) 2026-12-04 17:01:26 +08:00
README.md feat: add opt-in multi-core MPI and actuator-disk thrust momentum source (v0.5.0) 2026-12-04 17:01:26 +08:00
release-please-config.json chore(ci): adopt superWorldSavior/engineering-toolchain@v1 2026-12-04 11:56:28 +08:00
renovate.json chore(ci): migrate engineering-toolchain and GHCR target to vidimus-dev 2026-12-05 15:32:20 +08:00
server.ts feat: add opt-in multi-core MPI and actuator-disk thrust momentum source (v0.5.0) 2026-12-04 17:01:26 +08:00
THIRD_PARTY_NOTICES.txt feat: results viewer MCP App (@mcpview/components), 0.2.0 2026-12-03 12:34:16 +08:00

@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

  1. 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.
  2. 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 converged polyMesh, p, U, and nut fields to return cd, cdPressure, cdViscous, cl, cm, ldRatio, reynoldsNumber, and case SHA-256.
  3. openfoam_run_case — Executes custom OpenFOAM cases (blockMesh + optional surfaceFeatureExtract / snappyHexMesh + optional topoSet actuator-disk cellZone + checkMesh + simpleFoam or potentialFoam) from caller-provided dictionaries and initial fields, automatically parsing converged postProcessing/ forceCoeffs (Cd, Cl, CmPitch, Cd(f), Cd(r), ldRatio, plus pressure/viscous breakdown), forces (total, pressure, viscous, momentTotal), and yPlus (min, max, average per patch) outputs when configured in controlDict. Supports:
    • Strictly opt-in Multi-Core MPI via parallel: { cores, method } (default cores: 1 = single-core; safely clamped to min(cores, cpus, 8), default scotch decomposition): runs decomposePar, mpirun -np <cores> snappyHexMesh -parallel -overwrite, reconstructParMesh -constant, mpirun -np <cores> simpleFoam -parallel, and reconstructPar -latestTime, reporting parallelCoresUsed and parallelSpeedupNote.
    • Strictly opt-in Actuator-Disk thrust momentum source via actuatorDisk: { name, cellZone, diskDir, diskAreaM2, thrustN, centerM, radiusM, innerRadiusM, thicknessM, upstreamPointM, rhoKgM3 }: auto-generates system/topoSetDict (cylinderToCell + setToCellZone) and constant/fvOptions (vectorSemiImplicitSource, volumeMode absolute), reporting verified selectedCells, selectedVolumeM3, kinematicMomentumSourceM4S2, and equivalentPressureJumpPa.
    • 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 in structuredContent.flowViz while omitting bulky coordinates from content[0].text (flowVizOmittedFromText: true).

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 (optional MCP_BEARER_TOKEN).