Skip to content

COMSOL plugin for sim-cli

Drive COMSOL Multiphysics from Codex, Claude Code, and other local AI coding agents through sim-cli.

  • Run a model — point sim at a .mph file and let it solve, headless or with the GUI visible.
  • Connect a live session — keep one COMSOL process open across many steps, send model-control snippets, observe model state, watch results stream back.
  • Shared desktop — the agent and a human engineer share the same Model Builder window. Edits the agent makes appear live in the engineer’s screen; the engineer can interrupt, click around, or hand control back.
  • Parametric sweeps — vary parameters between runs and collect results without restarting COMSOL.
  • Extract solved fields — pull temperature, velocity, or any other evaluated quantity out of a finished study for downstream analysis.
  • Server attach mode — point sim at a COMSOL server you already have running; sim won’t take ownership and won’t kill it on disconnect.

Works on Linux, macOS, and Windows.

Use uv to install sim-cli-core and the COMSOL plugin into the same project environment, then sync the bundled COMSOL skill into the agent harness:

Terminal window
uv init # only if this is not already a uv project
uv add sim-cli-core sim-plugin-comsol
uv run sim plugin sync-skills --target .agents/skills --copy # Codex / Copilot
uv run sim plugin sync-skills --target .claude/skills --copy # Claude Code
uv run sim check comsol
uv run sim plugin doctor comsol --deep

uv run sim ... is the canonical command form for agent projects — it runs the sim installed in this project’s venv so the plugin is visible.

One-shot run:

Terminal window
uv run sim run --solver comsol path/to/model.mph

Persistent session with the engineer watching the GUI:

Terminal window
uv run sim connect --solver comsol --ui-mode gui --driver-option visual_mode=shared-desktop
uv run sim exec '<your model-control snippet>'
uv run sim inspect session.health
uv run sim disconnect
  • A licensed COMSOL Multiphysics installation on the host
  • Python 3.10+ and uv on the same machine

Not the same as other Ansys / SIMULIA plugins

Section titled “Not the same as other Ansys / SIMULIA plugins”

Use the COMSOL plugin only for COMSOL Multiphysics workflows. For Dassault SIMULIA Abaqus see abaqus; for Ansys Workbench see workbench; for Ansys Mechanical see mechanical.