Skip to main content

Kratos MCP Server

CI Deploy docs Release PyPI Python License: MIT

An MCP server that lets AI assistants drive Kratos Multiphysics finite element simulations end to end:

  • Introspect the installation: applications, elements, conditions, constitutive laws, variables, solvers and processes and their default parameters (process defaults are parsed from the Kratos source, no build needed).
  • Scaffold simulation cases from templates: structural (static/dynamic/modal), thermal (transient/stationary), fluid (monolithic or fractional-step incompressible) and potential flow — plus multi-stage orchestrated cases that chain analyses. Curated material and linear-solver presets included. ProjectParameters.json, Materials.json and structured MDPA meshes with named boundary regions.
  • Run simulations (single- or multi-stage) as managed background jobs (status, live logs, progress, cancel) that survive server restarts.
  • Post-process VTK results: summaries, point probes, convergence analysis.
  • Preview results without ParaView: PNG screenshots and GIF animations (deformed shapes, field contours) rendered with pyvista and shown inline in the conversation — optional viz extra.
  • Interoperate: explain an existing ProjectParameters.json, and convert cases to/from the Kratos FlowGraph visual node editor (lossless round-trip).

40 tools, 15 resources (10 worked examples) and 5 guided prompts. See the full documentation in docs/ (VitePress).

Quick start

A local Kratos build is not required — the server can pip-install Kratos itself on first use.

Once published to PyPI, no clone needed — uvx fetches and runs it:

claude mcp add kratos -- uvx kratos-mcp-server

From a local checkout (current state, before the first PyPI release):

git clone https://github.com/loumalouomega/Kratos-MCP-Server
cd Kratos-MCP-Server
uv sync
claude mcp add kratos -- uv --directory "$PWD" run kratos-mcp

Then ask your assistant something like:

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

The assistant calls kratos_install the first time and reuses it afterwards. If you already have a compiled Kratos checkout, skip that and point KRATOS_ROOT at it instead (-e KRATOS_ROOT=/path/to/Kratos on the claude mcp add line) — see Installation.

Notebooks

Five notebooks drive the server interactively as an MCP client — no AI assistant involved — each touching most of the relevant tools, resources and prompts in one sitting. Run any with uv sync --extra viz --group dev (adds ipykernel + pyvista) and open it in Jupyter/VS Code against that .venv.

  • notebooks/cantilever.ipynb: the structural cantilever case — installation introspection, mesh generation, scaffolding, a background job you poll while it runs, VTK post-processing, a rendered PNG and an animated GIF, and cancelling a job in flight.
  • notebooks/naca_airfoil.ipynb: a NACA0012 airfoil in incompressible laminar flow — reuses a real ~21k-node airfoil mesh from Kratos's own examples repo (simplified physics; see the notebook/tutorial for what and why), computes lift/drag by summing REACTION over the airfoil surface, and renders/animates the pressure field cropped to the airfoil with the newer crop_bounds option.
  • notebooks/fluid_cavity.ipynb: the lid-driven cavity CFD benchmark — introspect the fluid solver, run the shipped example, probe the velocity field, and render an inline PNG and GIF of the recirculating vortex.
  • notebooks/materials.ipynb: the materials surface — material & linear-solver presets, process-defaults introspection, and a single-element von Mises plasticity run showing the elastic→plastic transition.
  • notebooks/multistage.ipynb: multi-stage orchestration — create_multistage_project chaining two load steps, explain_project_parameters, and a lossless round-trip to/from a Kratos FlowGraph node graph.

Requirements

  • Python ≥ 3.10, uv
  • Kratos Multiphysics, either pip-installed via kratos_install (Linux/Windows x86_64 only — no macOS wheels) or a compiled build (tested with 10.4, StructuralMechanics / ConvectionDiffusion / FluidDynamics / LinearSolvers applications)
  • Optional, for results_render/results_animate: the viz extra (uv sync --extra viz or pip install 'kratos-mcp-server[viz]') and a working OpenGL context (on headless machines: Xvfb or OSMesa VTK wheels — see docs/tools/visualization.md)

Architecture in one paragraph

Kratos is never imported in the server process — it prints a banner on import (which would corrupt the stdio JSON-RPC stream) and can abort the process on solver errors. Short operations run in a worker subprocess that returns JSON through a result file; simulations run detached with per-job directories under ~/.kratos-mcp/jobs/. See docs/guide/architecture.md.

Development

uv run pytest -m "not kratos"   # unit tests (no Kratos needed)
uv run pytest -m kratos          # integration tests against the real build
npm install && npm run docs:dev  # documentation site

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kratos_mcp_server-0.3.1.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kratos_mcp_server-0.3.1-py3-none-any.whl (977.4 kB view details)

Uploaded Python 3

File details

Details for the file kratos_mcp_server-0.3.1.tar.gz.

File metadata

  • Download URL: kratos_mcp_server-0.3.1.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for kratos_mcp_server-0.3.1.tar.gz
Algorithm Hash digest
SHA256 90e5a1895be5daded8939d3d0b95307472cdfc90cca2dc1901581c5b8ac91eef
MD5 b3b844cbb30fdc7615739ef3d9966c6a
BLAKE2b-256 9cf3dfc789de025872e498e02dc2f9796109258b7a32cb597cee333a822551a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for kratos_mcp_server-0.3.1.tar.gz:

Publisher: release.yml on loumalouomega/Kratos-MCP-Server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kratos_mcp_server-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for kratos_mcp_server-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8a2b9dd137abdde0c43a2999013f7fe7339da7472a11d04622b91499e5a29e33
MD5 4841e4d18bfb657ed062d18bfce17f9d
BLAKE2b-256 9b473225e9cf33b4d8fbfabff667fb5c8b1f929207c6eeb8a34aca2cddd973fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for kratos_mcp_server-0.3.1-py3-none-any.whl:

Publisher: release.yml on loumalouomega/Kratos-MCP-Server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 files

0.3.0

2 files

0.2.0

2 files

0.1.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page