OpenFOAM

v1.0.0Data Science & MLstable

LLM-powered OpenFOAM MCP server for intelligent CFD education with Socratic questioning and expert error resolution

inllmllm-in-analysismcpmcp-openfoam
Share:
99
Stars
0
Downloads
0
Weekly
0/5

What is OpenFOAM?

OpenFOAM is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to llm-powered openfoam mcp server for intelligent cfd education with socratic questioning and expert error resolution

LLM-powered OpenFOAM MCP server for intelligent CFD education with Socratic questioning and expert error resolution

This server falls under the Data Science & ML category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • LLM-powered OpenFOAM MCP server for intelligent CFD educatio

Use Cases

CFD education and simulation
Socratic questioning support
Expert error resolution
webworn

Maintainer

LicenseNOASSERTION
Languagec++
Versionv1.0.0
UpdatedMay 22, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx openfoam

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use OpenFOAM

The OpenFOAM MCP Server is a C++-native MCP server that connects AI assistants directly to OpenFOAM 12, the leading open-source computational fluid dynamics (CFD) platform, enabling intelligent simulation guidance through Socratic questioning, automated mesh quality assessment, error diagnosis using five-whys methodology, and specialized analysis tools for rotating detonation engines (RDE). It exposes 12 registered tools covering the full CFD workflow from STL geometry preprocessing through mesh generation, solver execution, and results analysis — making it the first AI-powered tutor and automation layer for OpenFOAM practitioners.

Prerequisites

  • OpenFOAM 12 installed at /opt/openfoam12 (or equivalent path with env vars adjusted)
  • CMake 3.16+ and a C++17 compiler (GCC recommended) for building the server
  • Linux environment (the server uses OpenFOAM's Linux-native libraries)
  • Claude Code CLI or another MCP-compatible client
  • Basic familiarity with CFD concepts and OpenFOAM case structure
1

Clone and build the server

Clone the repository and build the C++ MCP server binary using CMake. The build process links against OpenFOAM 12 libraries.

git clone https://github.com/webworn/openfoam-mcp-server.git
cd openfoam-mcp-server
mkdir build && cd build
cmake ..
make -j$(nproc)
2

Set OpenFOAM 12 environment variables

Export the required environment variables so the server can locate OpenFOAM libraries and binaries. Source your OpenFOAM installation profile if available.

export WM_PROJECT_DIR=/opt/openfoam12
export FOAM_INST_DIR=/opt/openfoam12
export FOAM_LIBBIN=/opt/openfoam12/platforms/linux64GccDPInt32Opt/lib
export FOAM_APPBIN=/opt/openfoam12/platforms/linux64GccDPInt32Opt/bin
export LD_LIBRARY_PATH=/opt/openfoam12/platforms/linux64GccDPInt32Opt/lib/dummy:$FOAM_LIBBIN:$LD_LIBRARY_PATH
3

Add the server to your MCP client configuration

Configure your MCP client (e.g., Claude Code) to launch the built binary with the required OpenFOAM environment variables passed through.

4

Verify the connection with Claude Code

Add the server via Claude Code's mcp command and verify it appears in the server list.

claude mcp add-json openfoam-mcp-server '{"command": "/path/to/openfoam-mcp-server/build/openfoam-mcp-server-test", "args": [], "env": {"WM_PROJECT_DIR": "/opt/openfoam12", "FOAM_INST_DIR": "/opt/openfoam12"}}'
claude mcp list
5

Start a CFD assistance session

Use the start_cfd_assistance tool to initiate an educational CFD conversation. The server will use Socratic questioning to guide your understanding of the simulation.

OpenFOAM Examples

Client configuration

Claude Code MCP config for the OpenFOAM server with required environment variables.

{
  "mcpServers": {
    "openfoam-mcp-server": {
      "command": "/path/to/openfoam-mcp-server/build/openfoam-mcp-server-test",
      "args": [],
      "env": {
        "WM_PROJECT_DIR": "/opt/openfoam12",
        "FOAM_INST_DIR": "/opt/openfoam12",
        "FOAM_LIBBIN": "/opt/openfoam12/platforms/linux64GccDPInt32Opt/lib",
        "FOAM_APPBIN": "/opt/openfoam12/platforms/linux64GccDPInt32Opt/bin",
        "FOAM_ETC": "/opt/openfoam12/etc",
        "LD_LIBRARY_PATH": "/opt/openfoam12/platforms/linux64GccDPInt32Opt/lib/dummy:/opt/openfoam12/platforms/linux64GccDPInt32Opt/lib"
      }
    }
  }
}

Prompts to try

Example prompts covering CFD education, simulation analysis, and error resolution.

- "Analyze water flow in a 0.1m diameter pipe at 2 m/s — what turbulence model should I use?"
- "My heat transfer simulation residuals are oscillating — help me diagnose the root cause"
- "Assess the mesh quality of my current case and recommend improvements for the solver"
- "Analyze this STL file for snappyHexMesh preprocessing and identify any geometry issues"
- "I'm simulating turbulent flow with k-omega SST — guide me through selecting appropriate boundary conditions"
- "Calculate RDE thrust and Isp efficiency for my 3D annular geometry"

Troubleshooting OpenFOAM

Build fails with missing OpenFOAM headers or libraries

Ensure OpenFOAM 12 is properly installed at /opt/openfoam12 and that all environment variables (WM_PROJECT_DIR, FOAM_LIBBIN, etc.) are exported before running cmake and make. Source the OpenFOAM bashrc with 'source /opt/openfoam12/etc/bashrc' if available.

Server binary starts but OpenFOAM operations fail at runtime

The README notes the server is approximately 75% operational with solver integration still in progress. Core educational features (CFD guidance, mesh quality, RDE analysis) work. Advanced heat transfer and multiphase solver integrations may be incomplete — check the project's GitHub issues for the latest status.

LD_LIBRARY_PATH errors when launching the binary

The dummy library path must come before the main lib path in LD_LIBRARY_PATH. Use the exact order: '/opt/openfoam12/platforms/linux64GccDPInt32Opt/lib/dummy:/opt/openfoam12/platforms/linux64GccDPInt32Opt/lib'. Add this to the env block in your MCP client configuration.

Frequently Asked Questions about OpenFOAM

What is OpenFOAM?

OpenFOAM is a Model Context Protocol (MCP) server that llm-powered openfoam mcp server for intelligent cfd education with socratic questioning and expert error resolution It connects AI assistants to external tools and data sources through a standardized interface.

How do I install OpenFOAM?

Follow the installation instructions on the OpenFOAM GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with OpenFOAM?

OpenFOAM works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is OpenFOAM free to use?

Yes, OpenFOAM is open source and available under the NOASSERTION license. You can use it freely in both personal and commercial projects.

Browse More Data Science & ML MCP Servers

Explore all data science & ml servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "openfoam": { "command": "npx", "args": ["-y", "openfoam"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use OpenFOAM?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides