COMSOL Multiphysics driver for sim-cli, distributed as an out-of-tree plugin
Project description
sim-plugin-comsol
Use Codex, Claude Code, or another AI agent to work with COMSOL Multiphysics models from the workflow you already use.
sim-plugin-comsol gives an agent practical COMSOL control paths: inspect
saved .mph files, build or modify models through the COMSOL Java API, run
studies, check live-session health, and work through a shared visible COMSOL
Desktop session when the engineer wants to watch or intervene.
COMSOL itself and its mph Python binding are not bundled. See
LICENSE-NOTICE.md.
What an agent can do with COMSOL
- Load and modify existing COMSOL
.mphmodels. - Build and solve a model step by step while you watch the Model Builder.
- Inspect a saved
.mphfile before deciding what to change. - Run bounded edits, checks, plots, and result-export steps through COMSOL's Java API.
- Keep a structured audit trail of commands, health checks, and generated artifacts so results can be reviewed rather than guessed.
This repository is intended to be the complete COMSOL agent bundle: driver and bundled COMSOL skill. A receiving agent should not need a separate COMSOL skill checkout.
Choose the right COMSOL workflow
1. Agent-owned live Desktop session — best for repeatable work
Use this when the agent should build, inspect, solve, and debug a model across multiple steps while the engineer watches a live COMSOL Desktop client:
uv run sim connect --solver comsol --ui-mode gui --driver-option visual_mode=shared-desktop
uv run sim inspect session.health
uv run sim exec --file step.py
shared-desktop starts comsolmphserver, attaches a full COMSOL Desktop
client to that server, and binds agent snippets to the Desktop active model
tag. session.health should report model_builder_live: true and a
live_model_binding.ok value of true before relying on the GUI as a live
view of agent edits.
Prefer this path for reliable multi-step model building, solving, structured inspection, and repeatable agent workflows.
2. Saved .mph inspection — best before changing a file
When the user only needs to know what is in a saved COMSOL model, use the
bundled offline inspection helpers before launching a heavyweight COMSOL
session. This is the right first step for questions like: "what physics,
parameters, studies, meshes, and result nodes are in this .mph?"
Install
For agent projects, install sim-cli-core and the COMSOL plugin in the project environment:
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
uv run sim check comsol
uv run sim plugin doctor comsol --deep
For Claude Code, sync the bundled skill to .claude/skills instead:
uv run sim plugin sync-skills --target .claude/skills --copy
uv run sim ... runs sim from this project environment, so it sees this
project's plugins. Without uv, create and activate a venv, then install
sim-cli-core plus this plugin with python -m pip.
Agent quickstart
Give Codex, Claude Code, or another coding agent this instruction when the task is about COMSOL:
Use the bundled COMSOL skill from sim-plugin-comsol. First identify whether the
user wants: (1) a reliable agent-owned shared Desktop session or (2) offline
inspection of a saved .mph file. For reliable visible co-editing, use
`sim connect --solver comsol --ui-mode gui --driver-option visual_mode=shared-desktop`
and verify `session.health.live_model_binding.ok`. For non-trivial modeling,
establish the target model identity and working folder first: load the given
.mph, or set a descriptive model tag/title and save an early checkpoint .mph
under a case workdir. Build and solve the requested model one bounded step at a
time.
The bundled skill entry point is:
src/sim_plugin_comsol/_skills/comsol/SKILL.md
How it relates to sim-cli
sim-plugin-comsol is a Python package that extends
sim-cli. sim-cli provides the common
agent runtime surface (connect, exec, inspect, screenshot, run), while
this plugin supplies the COMSOL-specific driver and COMSOL agent skill.
The plugin registers three entry-point groups:
[project.entry-points."sim.drivers"]
comsol = "sim_plugin_comsol:ComsolDriver"
[project.entry-points."sim.skills"]
comsol = "sim_plugin_comsol:skills_dir"
[project.entry-points."sim.plugins"]
comsol = "sim_plugin_comsol:plugin_info"
sim.drivers exposes the driver class; sim.skills exposes a directory of
skill files bundled inside the wheel; sim.plugins exposes plugin metadata for
discovery.
Develop
git clone https://github.com/svd-ai-lab/sim-plugin-comsol
cd sim-plugin-comsol
uv sync
uv run sim plugin list
uv run sim check comsol
uv run pytest
License
Apache-2.0. See LICENSE and LICENSE-NOTICE.md.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sim_plugin_comsol-0.1.14.tar.gz.
File metadata
- Download URL: sim_plugin_comsol-0.1.14.tar.gz
- Upload date:
- Size: 176.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1625d3838b5a4cc3d8072f8a19b02c4a2fb3c77c94f7f286bf96836f5d453a0c
|
|
| MD5 |
b4bfa13149fa6c7df502e91d55f52b3a
|
|
| BLAKE2b-256 |
0f010712e28c60da20bbfa30463e9850911f8550ec76fb114c2bc73ad54a020f
|
Provenance
The following attestation bundles were made for sim_plugin_comsol-0.1.14.tar.gz:
Publisher:
publish.yml on svd-ai-lab/sim-plugin-comsol
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sim_plugin_comsol-0.1.14.tar.gz -
Subject digest:
1625d3838b5a4cc3d8072f8a19b02c4a2fb3c77c94f7f286bf96836f5d453a0c - Sigstore transparency entry: 1531293566
- Sigstore integration time:
-
Permalink:
svd-ai-lab/sim-plugin-comsol@da6e6215c11467e5ddaa65e1a503b29e49cceecd -
Branch / Tag:
refs/tags/v0.1.14 - Owner: https://github.com/svd-ai-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@da6e6215c11467e5ddaa65e1a503b29e49cceecd -
Trigger Event:
push
-
Statement type:
File details
Details for the file sim_plugin_comsol-0.1.14-py3-none-any.whl.
File metadata
- Download URL: sim_plugin_comsol-0.1.14-py3-none-any.whl
- Upload date:
- Size: 111.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f94dce4d346d5e28e526b4d33df88e93d62261b416518147dd0b438bea0d6a94
|
|
| MD5 |
dbbe9d256bb92794e420bd299ba9960d
|
|
| BLAKE2b-256 |
424b738295aa0ccf2ae4be404d42fcad5cac63ec606225c9eb751d70fc62f203
|
Provenance
The following attestation bundles were made for sim_plugin_comsol-0.1.14-py3-none-any.whl:
Publisher:
publish.yml on svd-ai-lab/sim-plugin-comsol
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sim_plugin_comsol-0.1.14-py3-none-any.whl -
Subject digest:
f94dce4d346d5e28e526b4d33df88e93d62261b416518147dd0b438bea0d6a94 - Sigstore transparency entry: 1531293644
- Sigstore integration time:
-
Permalink:
svd-ai-lab/sim-plugin-comsol@da6e6215c11467e5ddaa65e1a503b29e49cceecd -
Branch / Tag:
refs/tags/v0.1.14 - Owner: https://github.com/svd-ai-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@da6e6215c11467e5ddaa65e1a503b29e49cceecd -
Trigger Event:
push
-
Statement type: