openfoam-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@openfoam-mcp Set up a simpleFoam case for a pipe flow with y+ of 30."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
OpenFOAM MCP by iLab — a CFD co-pilot for any MCP client
openfoam-mcp is a Model Context Protocol
server that turns an AI assistant (Claude Desktop, and any other MCP client)
into an OpenFOAM setup and debugging co-pilot. It scaffolds runnable cases,
edits dictionaries safely, sizes your near-wall mesh, computes inlet turbulence
values, and reads solver logs to tell you whether a run converged or blew up —
all without you leaving the chat.
Most of the tools are pure Python and need no OpenFOAM installation, so they
work anywhere. The few that call OpenFOAM utilities (e.g. blockMesh,
checkMesh) detect the environment and degrade gracefully when it is absent.
Validated end-to-end on real OpenFOAM (ESI v1912). Generated cases run through
blockMeshand the solvers — simpleFoam converges, all four mesh presets produce valid meshes, and the real logs are read back correctly by the residual and mesh-quality parsers. SeeVALIDATION.md.
OpenFOAM version support
scaffold_case takes an openfoam_flavor:
classic(default) —application <solver>;withtransportProperties. Validated on ESI v1912; works on ESI v2006+ and Foundation v8–v10.foundation-v12—application foamRun;+solver incompressibleFluid;withphysicalProperties, for OpenFOAM Foundation v11/v12. RunfoamRuninstead of the solver name.
Why it's useful
Setting up a CFD case is fiddly bookkeeping: the right y+, matching boundary
patches between the mesh and every 0/ field, consistent turbulence fields for
the chosen model, a stable Courant number, and reading pages of residual output
to see if it converged. This server does that bookkeeping through natural
language.
Related MCP server: Foam-Agent
Make the hard part simple
Two tools do the work most people find fiddly:
recommend_setup— tell it your goal in plain words ("flow through a pipe", "drag on a car") and it returns the solver, turbulence model, targety+, mesh preset, per-patch boundary conditions and a numbered plan — asking you for only the numbers it still needs.generate_blockmesh— auto-writes a valid, boundary-layer-gradedblockMeshDictfrom a geometry preset. Give it your target first-cell height and it computes the wall grading for you. No hand-writing vertices or blocks.
Tools (20)
Tool | What it does |
| Start here. Goal to solver, model, mesh preset, BCs, plan (asks for missing inputs). |
| Auto blockMesh with wall grading auto-sized to your y+ (presets: channel, flatplate, step, box). |
| List the blockMesh geometry presets. |
| List scaffold-able solver templates (simpleFoam, pimpleFoam, icoFoam). |
| Reynolds number, laminar/turbulent verdict, turbulence-model recommendation. |
| First-cell height for a target |
| Inverse: predicted |
| Inlet |
| Transient time step from a target Courant number. |
| Colebrook-White friction factor + Darcy-Weisbach pressure drop / head loss. |
| Convective |
| Write a runnable case tree ( |
| Read a dictionary file or a single entry (via |
| Set a dictionary keyword (nested via |
| Set/insert a patch's |
| STL watertight/manifold check, bbox, area, volume, snappyHexMesh prep. |
| Parse a |
| Validate a case: files present, turbulence fields consistent, patches match mesh. |
| Parse a solver log into per-field residual drop + convergence verdict. |
| Run a whitelisted OpenFOAM utility inside a case (if installed). |
Install & run
The server ships as a PyPI package with a console entry point, so the usual
zero-install runner is uvx:
uvx openfoam-mcpor install it into an environment:
pip install openfoam-mcp
openfoam-mcpClaude Desktop configuration
Add this to claude_desktop_config.json
(macOS: ~/Library/Application Support/Claude/,
Windows: %APPDATA%\Claude\):
{
"mcpServers": {
"openfoam": {
"command": "uvx",
"args": ["openfoam-mcp"]
}
}
}Restart Claude Desktop; the OpenFOAM tools appear under the tools menu.
Example prompts
"I have air at 30 m/s over a 0.5 m chord. What Reynolds number is that, and what first-cell height do I need for y+ = 1?"
"Scaffold a steady simpleFoam case in ./duct at 12 m/s and check it."
"Set
endTimeto 3000 in ./duct/system/controlDict.""Read ./duct/log.simpleFoam and tell me if it converged."
Solver templates
Template | Physics | Typical use |
| Steady incompressible RANS (k-ω SST) | Ducts, external aero, general steady flow |
| Transient incompressible RANS (k-ω SST) | Vortex shedding, unsteady flows |
| Transient incompressible laminar | Low-Re teaching cases (cavity, low-Re pipe) |
Templates follow the OpenFOAM foundation v9–v12 / ESI v2306+ tutorial style
(transportProperties + momentumTransport). The generated box mesh has
patches inlet, outlet, walls, frontAndBack.
Development
pip install -e ".[dev]"
pytestLicense
MIT © 2026 iLab (Tanawat Manokieng)
Available Tools
20 toolsanalyze_residualsA
Parse an OpenFOAM solver log file and report per-field residual drop, Courant number, bounded fields, and a convergence verdict (converged / diverging / NaN / still running).
Inputs: log_path (required).
analyze_stlA
Analyze an STL surface (ASCII or binary): triangle count, bounding box, surface area, enclosed volume, and a watertight/closed-manifold check with the count of unpaired edges — plus a suggested background cell size and snappyHexMesh advice. No OpenFOAM needed. Use before snappyHexMesh.
Inputs: path (required).
check_caseA
Logically validate a case directory: required system files present, solver read, turbulence fields consistent with the model, and 0/ boundary patches matching the mesh. Returns errors, warnings and a pass flag. Does not require OpenFOAM to be installed.
Inputs: case_dir (required).
first_cell_heightA
Estimate the wall-normal first-cell height needed to hit a target y+ on a turbulent boundary layer (flat-plate correlation). Use before meshing to set the near-wall cell size. Defaults are for air at sea level.
Inputs: length (required), y_plus (required), velocity (required), density, +1 more.
flow_regimeA
Reynolds number, laminar/transitional/turbulent classification, and a
turbulence-model recommendation. geometry = 'internal' (pipe/duct) or
'external' (plate/bluff body/airfoil).
Inputs: length (required), velocity (required), geometry, kinematic_viscosity.
generate_blockmeshA
Auto-generate a valid, boundary-layer-graded blockMeshDict and write it to output_path (typically '/system/blockMeshDict'). Pick a preset (channel, flatplate, step, box). If first_cell_height > 0, wall-normal grading is computed automatically so the near-wall cell matches that height (feed it the value from the first_cell_height tool to hit a target y+). This removes the hardest, most error-prone part of setting up a case.
Inputs: output_path (required), depth, height, length, +5 more.
heat_transfer_pipeB
Convective heat-transfer coefficient for internal flow (Dittus-Boelter Nu = 0.023 Re^0.8 Pr^n; laminar Nu = 3.66). Defaults are for water. Returns Nusselt number and h (W/m^2K).
Inputs: diameter (required), velocity (required), density, heating, +3 more.
inlet_turbulenceA
Compute inlet k, epsilon, omega and nut from turbulence intensity (fraction, e.g. 0.05) and turbulent length scale (m). Use to fill the 0/ directory inlet/internalField values for a RANS case.
Inputs: velocity (required), length_scale (required), turbulence_intensity (required), kinematic_viscosity.
list_mesh_presetsA
List the auto-blockMesh geometry presets (channel, flatplate, step, box).
Inputs: no named parameters.
list_solversA
List the OpenFOAM solver templates this server can scaffold, with a one-line description of each and when to use it.
Inputs: no named parameters.
mesh_quality_reportA
Parse a checkMesh log file into a quality verdict: max/avg non-orthogonality, skewness, aspect ratio, pass/fail, and concrete fvSchemes/fvSolution advice (e.g. nNonOrthogonalCorrectors). Works from a saved log without OpenFOAM installed.
Inputs: log_path (required).
pipe_pressure_dropB
Darcy friction factor (Colebrook-White for turbulent, 64/Re laminar) and Darcy-Weisbach pressure drop / head loss for pipe flow. Defaults are for water; set roughness (m) for rough pipes. Handy sanity check against CFD.
Inputs: length (required), diameter (required), velocity (required), density, +2 more.
read_dictA
Read an OpenFOAM dictionary file. If entry is given (foamDictionary
path syntax, e.g. 'endTime' or 'solvers/p/solver') and OpenFOAM is
installed, return just that entry's value; otherwise return full contents.
Inputs: path (required), entry.
recommend_setupA
Turn a plain-language goal (e.g. 'flow through a pipe', 'drag on a car') into a complete setup plan: recommended solver, turbulence model, target y+, which blockMesh preset to auto-generate, the 0/ fields needed, per-patch boundary conditions, and a numbered step list. If velocity/length are missing it returns targeted questions to ask the user first. Start here.
Inputs: goal (required), fluid, length, velocity, +2 more.
run_openfoam_commandA
Run a whitelisted OpenFOAM utility (blockMesh, checkMesh, foamDictionary, renumberMesh, decomposePar, foamListTimes, surfaceCheck, transformPoints) inside a case directory. Requires OpenFOAM installed and its environment sourced. Returns return code and the tail of stdout/stderr.
Inputs: command (required), case_dir (required), timeout.
scaffold_caseA
Create a runnable OpenFOAM case skeleton at case_dir for the chosen
solver (simpleFoam / pimpleFoam / icoFoam). Writes system/, constant/ and 0/
with a single-block box mesh (patches: inlet, outlet, walls, frontAndBack)
and consistent turbulence fields.
openfoam_flavor selects the case style:
'classic' (default): application ; + transportProperties. Validated on ESI v1912; works on ESI v2006+ and Foundation v8-v10.
'foundation-v12': application foamRun; solver incompressibleFluid; + physicalProperties. Targets OpenFOAM Foundation v11/v12. Run blockMesh, then
<solver>(classic) orfoamRun(foundation-v12).
Inputs: case_dir (required), solver, cells_x, cells_y, +8 more.
set_boundary_conditionA
Set (or insert) the boundaryField entry for a patch in a 0/ field file, e.g. field_file='0/U', patch='inlet', bc_type='fixedValue', value='(10 0 0)'.
Inputs: patch (required), bc_type (required), field_file (required), value.
set_dict_entryA
Set a keyword in a dictionary file. Uses foamDictionary when available (supports nested entries like 'solvers/p/tolerance'); otherwise falls back to editing a top-level single-line entry as text.
Inputs: path (required), entry (required), value (required).
time_step_from_cflB
Maximum/target transient time step from a target Courant number (dt = Co * dx / U).
Inputs: velocity (required), cell_size (required), target_courant.
y_plus_from_heightB
Predict the y+ that a given first-cell height will produce, and whether it lands in the viscous sublayer, buffer layer (avoid), or log-law region.
Inputs: length (required), velocity (required), first_cell_height_m (required), density, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 20 tools
Each tool serves a distinct purpose: analysis (residuals, mesh quality), setup (scaffolding, blockMesh), physical calculations (y+, pressure drop), config editing (dict, boundary conditions), and execution. The inverse pair first_cell_height/y_plus_from_height are clearly complementary, not overlapping. No two tools could be easily confused.
All tool names follow a consistent snake_case convention with a verb_noun pattern (analyze_residuals, scaffold_case, run_openfoam_command) or descriptive noun phrases (pipe_pressure_drop, heat_transfer_pipe). No mixing of camelCase or inconsistent verb styles, making the set predictable.
20 tools is on the higher end but well-scoped for a CFD setup and analysis server. The count is justified by covering the full workflow: planning, mesh generation, case configuration, execution utilities, and diagnostics. Slightly above the 15-tool sweet spot but not excessive.
The tools cover the complete lifecycle from recommended setup through mesh generation, case validation, boundary condition editing, running whitelisted utilities, and analyzing both residuals and mesh quality. Minor gaps: no direct solver execution (by design) and no post-processing tools, but core workflows are fully supported.
Related MCP Connectors
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
MCP server for AI dialogue using various LLM models via AceDataCloud
Generate game-ready 3D models, textures, and audio from natural language, over MCP.
Related MCP Servers
- AlicenseBqualityFmaintenanceEnables natural language-driven ANSYS simulations (Fluent, Mechanical, Geometry) with automatic TUI script generation for reproducibility.415MIT
- AlicenseNot gradedqualityAmaintenanceAutomates OpenFOAM CFD simulations via MCP, enabling AI agents to mesh, run, and post-process cases from natural language prompts without any API keys.MIT

Ansys CFX-MCPofficial
AlicenseAqualityBmaintenanceAn MCP server that enables AI assistants to interact with Ansys CFX through PyCFX, supporting natural-language-assisted CFX-Pre, CFX Solver, and CFD-Post workflows for setup, execution, and postprocessing.71,162 PyPI4Apache 2.0- AlicenseAqualityCmaintenanceVoice-driven CFD MCP server that enables natural language setup, execution, and analysis of OpenFOAM simulations, with results exportable to ParaView.16MIT