Skip to content

Getting started

The Kratos MCP Server connects AI assistants (Claude Code, Claude Desktop, or any MCP client) to Kratos Multiphysics, the open-source multiphysics finite element framework.

A local Kratos build is optional — if none is configured, the assistant can pip-install Kratos into the server's own environment on the spot via the kratos_install tool (Linux/Windows x86_64 only; macOS needs a local build).

Once connected, an assistant can carry a simulation through its whole lifecycle:

  1. Check the environmentkratos_check_installation reports the Kratos version and which applications are compiled; if it's missing, kratos_install pip-installs it on demand.
  2. Create a meshmdpa_create_structured_mesh writes a line, rectangle or box mesh with named boundary regions (left, right, xmin, ...).
  3. Scaffold the casecreate_project renders ProjectParameters.json and Materials.json from a template (structural_static, thermal_transient, fluid_transient, ...).
  4. Add boundary conditionsadd_boundary_condition inserts fixes, loads, fluxes or inlet/outlet conditions into the parameters file.
  5. Validatevalidate_case catches missing files, bad model part references and invalid solver settings before anything runs.
  6. Runrun_simulation starts a background job; job_status, job_logs and job_cancel manage it.
  7. Inspect resultsresults_list, results_summary, results_probe and results_convergence read the VTK output and the solver log.

Five-minute setup

bash
git clone <this-repo> Kratos-MCP-Server
cd Kratos-MCP-Server
uv sync

claude mcp add kratos -- uv --directory "$PWD" run kratos-mcp

No KRATOS_ROOT needed yet — the assistant can pip-install Kratos itself on first use. (If you already have a compiled checkout, pass -e KRATOS_ROOT=/path/to/Kratos instead; see Installation.)

Then, in Claude Code:

Check the Kratos installation — if it's missing, install it — then set up and run a cantilever plate (1 m × 0.2 m, fixed on the left, 1 MN/m downward line load on the right) and report the tip deflection.

The assistant will chain the tools above and answer with the deflection — for the setup in the cantilever tutorial it is about 0.43 mm downward, within a few percent of beam theory.

What you need

RequirementNotes
Python ≥ 3.10 + uvserver runtime
Kratos, one of:
— pip-installed via kratos_installLinux/Windows x86_64 only; no setup needed beforehand
— a compiled buildbin/Release inside KRATOS_ROOT; needed on macOS or for custom builds — see Installation
Kratos applicationsStructuralMechanics, ConvectionDiffusion, FluidDynamics, LinearSolvers cover all templates
Node 18+only for building this documentation

Where to go next