COMSOL MCP Server
COMSOL MCP Server lets AI agents drive COMSOL Multiphysics simulations end-to-end, from session setup through geometry, physics, meshing, solving, and results analysis.
Session control – start a local COMSOL client (cores, version, products), connect to a remote server, disconnect, and check status.
Model management – create, load, save, version, clone, remove, and inspect models; manage components and set the active model.
Parameters – get/set/list parameters with units, add descriptions, and set up parametric sweeps.
Geometry – build blocks, cylinders, spheres, rectangles, circles, and generic features; boolean union/difference; import CAD; build sequences; query boundaries; create named box/side selections.
Physics – add Electrostatics, Solid Mechanics, Heat Transfer, Laminar Flow, Pressure/other Acoustics, and Coefficient/General/Weak Form PDEs; configure boundary conditions (generic, acoustic, PDE, heat, flow); assign materials; add multiphysics couplings; list/remove interfaces.
Meshing – list mesh sequences, create them, generate meshes (auto-create if needed), and inspect mesh info.
Studies & solving – create stationary/time-dependent/eigenfrequency/frequency/perturbation studies; solve synchronously or asynchronously; monitor progress, wait, cancel; list solutions and datasets.
Results – evaluate expressions and global scalars, read inner (time) and outer (sweep) values, export data and plot images, list export and plot nodes.
Knowledge & help – retrieve docs, physics quick guides, troubleshooting tips, and modeling best practices; semantic-search indexed COMSOL PDF documentation and list available modules.
Enables automation of COMSOL Multiphysics simulations, including model management, geometry construction, physics configuration, meshing, solving, and results visualization.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@COMSOL MCP Server Load chip_thermal.mph, set power to 5W, and run the stationary solver."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
COMSOL MCP Server
MCP Server for COMSOL Multiphysics simulation automation via AI agents.
English | 中文
Star History
Related MCP server: flex-sensor-agent-mcp
Publication and Citation
The research paper describing COMSOL-MCP is available in Neurocomputing:
Naiyin Zhang and Junchao Wang, “COMSOL-MCP: An open-source model context protocol interface for AI-assisted multiphysics simulation,” Neurocomputing, vol. 703, article 134481, 2026.
Publisher page: ScienceDirect
If COMSOL-MCP contributes to your research, please cite the paper:
@article{Zhang2026COMSOLMCP,
title = {COMSOL-MCP: An Open-Source Model Context Protocol Interface for AI-Assisted Multiphysics Simulation},
author = {Zhang, Naiyin and Wang, Junchao},
journal = {Neurocomputing},
volume = {703},
pages = {134481},
year = {2026},
doi = {10.1016/j.neucom.2026.134481},
url = {https://doi.org/10.1016/j.neucom.2026.134481}
}Citation guidance
Cite the paper when referring to the COMSOL-MCP method, architecture, capabilities, or evaluation.
If you use or modify the software, cite both the paper and the repository. Use GitHub’s Cite this repository menu, which is backed by
CITATION.cff.For reproducibility, identify the exact release tag or commit used and include the repository URL and access date in your data/code availability statement.
Project Goal
Build a complete COMSOL MCP Server enabling AI agents (like Claude, opencode) to perform multiphysics simulations through the MCP protocol:
Model Management - Create, load, save, version control
Geometry Building - Blocks, cylinders, spheres, boolean operations
Physics Configuration - Heat transfer, fluid flow, electrostatics, solid mechanics
Meshing & Solving - Auto mesh, stationary/time-dependent studies
Results Visualization - Evaluate expressions, export plots
Knowledge Integration - Embedded guides + PDF semantic search
Requirements
COMSOL Multiphysics (version 5.x or 6.x)
Python 3.10+ (NOT Windows Store version)
Java runtime (required by MPh/COMSOL)
Installation
# Clone repository
git clone https://github.com/wjc9011/COMSOL_Multiphysics_MCP.git
cd COMSOL_Multiphysics_MCP
# Install dependencies
python -m pip install -e .
# Test server
python -m src.serverBuilding PDF Knowledge Base
# Install additional dependencies
pip install pymupdf chromadb sentence-transformers
# Build knowledge base
python scripts/build_knowledge_base.py
# Check status
python scripts/build_knowledge_base.py --statusUsage
Option 1: With opencode
Create opencode.json in project root:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"comsol": {
"type": "local",
"command": ["python", "-m", "src.server"],
"enabled": true,
"environment": {
"HF_ENDPOINT": "https://hf-mirror.com"
},
"timeout": 30000
}
}
}Option 2: With Claude Desktop
{
"mcpServers": {
"comsol": {
"command": "python",
"args": ["-m", "src.server"],
"cwd": "/path/to/COMSOL_Multiphysics_MCP"
}
}
}Code Structure
comsol_mcp/
├── opencode.json # MCP server config for opencode
├── pyproject.toml # Python project config
├── README.md # This file
│
├── src/
│ ├── server.py # MCP Server entry point
│ ├── tools/
│ │ ├── session.py # COMSOL session management (start/stop/status)
│ │ ├── model.py # Model CRUD + versioning
│ │ ├── parameters.py # Parameter management + sweeps
│ │ ├── geometry.py # Geometry creation (block/cylinder/sphere)
│ │ ├── physics.py # Physics interfaces + boundary conditions
│ │ ├── mesh.py # Mesh generation
│ │ ├── study.py # Study creation + solving (sync/async)
│ │ └── results.py # Results evaluation + export
│ ├── resources/
│ │ └── model_resources.py # MCP resources (model tree, parameters)
│ ├── knowledge/
│ │ ├── embedded.py # Embedded physics guides + troubleshooting
│ │ ├── retriever.py # PDF vector search retriever
│ │ └── pdf_processor.py # PDF chunking + embedding
│ ├── async_handler/
│ │ └── solver.py # Async solving with progress tracking
│ └── utils/
│ └── versioning.py # Model version path management
│
├── scripts/
│ └── build_knowledge_base.py # Build PDF vector database
│
├── client_script/ # Standalone modeling scripts (examples)
│ ├── create_chip_tsv_final.py # Example: Chip thermal model
│ ├── create_micromixer_auto.py # Example: Fluid flow simulation
│ ├── create_chip_thermal*.py # Various chip thermal variants
│ ├── create_micromixer*.py # Various micromixer variants
│ ├── visualize_*.py # Result visualization scripts
│ ├── add_visualization.py # Add plot groups to model
│ └── test_*.py # Integration tests
│
├── comsol_models/ # Saved models (structured)
│ ├── chip_tsv_thermal/
│ │ ├── chip_tsv_thermal_20260216_*.mph
│ │ └── chip_tsv_thermal_latest.mph
│ └── micromixer/
│ └── micromixer_*.mph
│
└── tests/
└── test_basic.py # Unit testsAvailable Tools (100+ total)
Session (4)
Tool | Description |
| Start local COMSOL client |
| Connect to remote server |
| Clear session |
| Get session info |
Model (9)
Tool | Description |
| Load .mph file |
| Create empty model |
| Save to file |
| Save with timestamp |
| List loaded models |
| Set active model |
| Clone model |
| Remove from memory |
| Get model structure |
Parameters (5)
Tool | Description |
| Get parameter value |
| Set parameter |
| List all parameters |
| Setup parametric sweep |
| Get/set description |
Geometry (16)
Tool | Description |
| List geometry sequences |
| Create geometry sequence |
| Add generic feature |
| Add rectangular block |
| Add cylinder |
| Add sphere |
| Add 2D rectangle |
| Add 2D circle |
| Union objects |
| Subtract objects |
| Import CAD file |
| Build geometry |
| List features |
| Get boundary numbers |
| Create a named selection by position |
| Create left/right/top/bottom selections |
Physics (28)
Tool | Description |
| List physics interfaces |
| Available physics types |
| Add generic physics |
| Add Electrostatics |
| Add Solid Mechanics |
| Add Heat Transfer |
| Add Laminar Flow |
| Add a geometry-based acoustic interface by COMSOL type |
| Add Pressure Acoustics |
| Add Coefficient Form PDE |
| Add General Form PDE |
| Add Weak Form PDE |
| Configure boundary condition |
| Configure one acoustic boundary condition |
| Configure multiple acoustic boundary conditions |
| Configure one PDE boundary condition |
| Configure multiple PDE boundary conditions |
| List common acoustic boundary feature types |
| List common PDE boundary feature types |
| Assign material |
| List physics features |
| Remove physics |
| Add coupling |
| Interactive heat BC setup |
| Configure heat boundaries |
| Interactive flow BC setup |
| Generic boundary setup |
Electrochemistry (10)
Battery, fuel cell, electrodeposition, and corrosion support backed by a type
registry verified against a live COMSOL 6.3 session (26 interfaces, 600+
feature/subfeature types). A complete worked example — an 18650 cell 1C
constant-current discharge — is included in
src/knowledge/prompts/electrochemistry.md; call docs_get("electrochemistry")
to retrieve it at runtime.
Tool | Description |
| List verified interface types (battery, current distribution, corrosion, ...) |
| List verified feature types of an interface with dimensions |
| Add a verified interface (e.g. |
| Inspect features with actual COMSOL types ( |
| Create a feature, incl. subfeatures via |
| Assign domains/boundaries to an existing feature |
| Set feature properties (rejected names reported) |
| Ask COMSOL for a feature's valid property names |
| Read interface-level property groups (e.g. |
| Configure interface-level settings (capacity, SOC, current, ...) |
Mesh (4)
Tool | Description |
| List mesh sequences |
| Create a mesh sequence |
| Generate mesh |
| Get mesh statistics |
Study & Solving (8)
Tool | Description |
| List studies |
| Solve synchronously |
| Solve in background |
| Get progress |
| Cancel solving |
| Wait for completion |
| List solutions |
| List datasets |
Results (9)
Tool | Description |
| Evaluate expression |
| Evaluate scalar |
| Get time steps |
| Get sweep values |
| Export data |
| Export plot image |
| List export nodes |
| List plot nodes |
Knowledge (8)
Tool | Description |
| Get documentation |
| List available docs |
| Physics quick guide |
| Troubleshooting help |
| Best practices |
| Search PDF docs |
| PDF search status |
| List PDF modules |
Example Cases
Case 1: Chip Thermal Model with TSV
3D thermal analysis of a silicon chip with Through-Silicon Via (TSV).
Geometry: 60×60×5 µm chip, 5 µm diameter TSV hole, 10×10 µm heat source
# Key steps:
# 1. Create chip block and TSV cylinder
# 2. Boolean difference (subtract TSV from chip)
# 3. Add Silicon material (k=130 W/m·K)
# 4. Add Heat Transfer physics
# 5. Set heat flux on top, temperature on bottom
# 6. Solve and evaluate temperature distributionScript: client_script/create_chip_tsv_final.py
Run:
cd /path/to/COMSOL_Multiphysics_MCP
python client_script/create_chip_tsv_final.pyResults: Temperature rise from ambient with heat flux of 1 MW/m²
Case 2: Micromixer Fluid Flow
3D laminar flow simulation in a microfluidic channel.
Geometry: 600×100×50 µm rectangular channel
# Key steps:
# 1. Create rectangular channel block
# 2. Add water material (ρ=1000 kg/m³, μ=0.001 Pa·s)
# 3. Add Laminar Flow physics
# 4. Set inlet velocity (1 mm/s), outlet pressure
# 5. Add Transport of Diluted Species for mixing
# 6. Solve and evaluate velocity profileScript: client_script/create_micromixer_auto.py
Run:
cd /path/to/COMSOL_Multiphysics_MCP
python client_script/create_micromixer_auto.pyResults: Velocity distribution, concentration mixing profile
Model Versioning
Models are saved with structured paths:
./comsol_models/{model_name}/{model_name}_{timestamp}.mph
./comsol_models/{model_name}/{model_name}_latest.mphExample:
./comsol_models/chip_tsv_thermal/chip_tsv_thermal_20260216_140514.mph
./comsol_models/chip_tsv_thermal/chip_tsv_thermal_latest.mphKey Technical Discoveries
1. mph Library API Patterns
# Access Java model via property (not callable)
jm = model.java # NOT model.java()
# Create component with True flag
comp = jm.component().create('comp1', True)
# Create 3D geometry
geom = comp.geom().create('geom1', 3)
# Create physics with geometry reference
physics = comp.physics().create('spf', 'LaminarFlow', 'geom1')
# Boundary condition with selection
bc = physics.create('inl1', 'InletBoundary')
bc.selection().set([1, 2, 3])
bc.set('U0', '1[mm/s]')2. Boundary Condition Property Names
Physics | Condition | Property |
Heat Transfer | HeatFluxBoundary |
|
Heat Transfer | TemperatureBoundary |
|
Heat Transfer | ConvectiveHeatFlux |
|
Laminar Flow | InletBoundary |
|
Laminar Flow | OutletBoundary |
|
Pressure Acoustics | SoundHard | No additional property |
Pressure Acoustics | SoundSoft | No additional property |
Pressure Acoustics | Pressure |
|
Pressure Acoustics | Impedance |
|
Pressure Acoustics | NormalAcceleration |
|
Pressure Acoustics | NormalVelocity |
|
Pressure Acoustics | PlaneWaveRadiation | No additional property |
Pressure Acoustics | SphericalWaveRadiation | No additional property |
PDE | DirichletBoundary |
|
PDE | FluxBoundary |
|
PDE | ZeroFluxBoundary | No additional property |
PDE | WeakContribution |
|
PDE | PeriodicCondition | No additional property |
3. Client Session Limitation
The mph library creates a singleton COMSOL client. Only one Client can exist per Python process:
# This is handled in session.py - client is kept alive and models are cleared
client.clear() # Clear models instead of full disconnect4. Offline Embedding Model
PDF search supports offline operation with local HuggingFace cache:
# Set mirror for China
export HF_ENDPOINT=https://hf-mirror.comDevelopment Status
Phase | Description | Status |
1 | Basic framework + Session + Model | Done |
2 | Parameters + Solving + Results | Done |
3 | Geometry + Physics + Mesh | Done |
4 | Embedded knowledge + Tool docs | Done |
5 | PDF vector retrieval | Done |
6 | Integration tests | In Progress |
Next Steps
Complete Phase 6 - Full integration test with proper boundary conditions
Visualization Export - Generate PNG images from plot groups
LSP Warnings - Fix type hints in physics.py
More Examples - Add electrostatics, solid mechanics cases
Error Handling - Improve error messages and recovery
Resources
URI | Description |
| Session information |
| Model tree structure |
| Model parameters |
| Physics interfaces |
License
MIT
Available Tools
93 toolscomsol_connectA
Connect to a remote COMSOL server.
Args: port: Port number the COMSOL server is listening on host: Server hostname or IP address (default: 'localhost')
Returns: Connection info or error message
Inputs: port (required), host.
comsol_disconnectA
Disconnect from COMSOL and clear all models from memory.
Returns: Success status and message
Inputs: no named parameters.
comsol_startA
Start a local COMSOL client session.
Args: cores: Number of processor cores to use (default: all available) version: COMSOL version to use, e.g., '6.0' (default: latest installed) products: List of COMSOL products to load, e.g., ["ACDC"], ["ACDC", "CADImport"] (default: all available products)
Returns: Session info including version and core count, or error message
Inputs: cores, version, products.
comsol_statusA
Get the current COMSOL session status.
Returns: Session information including connection status, version, and loaded models
Inputs: no named parameters.
datasets_listB
List all datasets in a model.
Datasets represent solution data that can be evaluated or visualized.
Args: model_name: Model name (default: current model)
Returns: List of dataset names
Inputs: model_name.
docs_getA
Get documentation on a specific topic.
Available topics:
"mph_api": MPh Python API reference
"physics_guide": Physics interfaces and boundary conditions
"workflow": Step-by-step modeling workflows
Args: topic: Documentation topic to retrieve
Returns: Documentation content for the topic
Inputs: topic (required).
docs_listB
List all available documentation topics.
Returns: List of available documentation topics with descriptions
Inputs: no named parameters.
geometry_add_blockB
Add a block (rectangular cuboid) to the geometry.
Args: position: Base position [x, y, z] in meters (default: origin) size: Dimensions [width, depth, height] in meters (default: 1m cube) geometry_name: Geometry sequence name (default: first geometry) component_name: Component name (default: 'comp1') feature_name: Feature name (auto-generated if None) model_name: Model name (default: current model)
Returns: Created block info
Inputs: size, position, model_name, feature_name, +2 more.
geometry_add_circleB
Add a circle to a 2D geometry or work plane.
Args: position: Center [x, y] in meters radius: Radius in meters (default: 0.5) geometry_name: Geometry sequence name model_name: Model name (default: current model)
Returns: Created circle info
Inputs: radius, position, model_name, geometry_name.
geometry_add_cylinderC
Add a cylinder to the geometry.
Args: position: Center of base [x, y, z] in meters radius: Radius in meters (default: 0.5) height: Height in meters (default: 1.0) geometry_name: Geometry sequence name (default: first geometry) component_name: Component name (default: 'comp1') feature_name: Feature name (auto-generated if None) model_name: Model name (default: current model)
Returns: Created cylinder info
Inputs: height, radius, position, model_name, +3 more.
geometry_add_featureB
Add a geometry feature to a geometry sequence.
Common feature types:
Block: Rectangular block (3D)
Cylinder: Cylinder (3D)
Sphere: Sphere (3D)
Cone: Cone (3D)
WorkPlane: Working plane for 2D geometry
Rectangle: Rectangle (2D)
Circle: Circle (2D)
Polygon: Polygon from points
Import: Import CAD geometry
Union, Intersection, Difference: Boolean operations
Args: feature_type: Type of geometry feature (Block, Cylinder, etc.) geometry_name: Geometry sequence name (default: first geometry) feature_name: Name for the feature (auto-generated if None) model_name: Model name (default: current model) **kwargs: Feature-specific properties (position, size, etc.)
Returns: Created feature info
Inputs: kwargs (required), feature_type (required), model_name, feature_name, +1 more.
geometry_add_rectangleB
Add a rectangle to a 2D geometry or work plane.
Args: position: Base position [x, y] in meters size: Dimensions [width, height] in meters geometry_name: Geometry sequence name (default: first geometry) component_name: Component name (default: 'comp1') feature_name: Feature name (auto-generated if None) model_name: Model name (default: current model)
Returns: Created rectangle info
Inputs: size, position, model_name, feature_name, +2 more.
geometry_add_sphereA
Add a sphere to the geometry.
Args: position: Center [x, y, z] in meters radius: Radius in meters (default: 0.5) geometry_name: Geometry sequence name (default: first geometry) component_name: Component name (default: 'comp1') feature_name: Feature name (auto-generated if None) model_name: Model name (default: current model)
Returns: Created sphere info
Inputs: radius, position, model_name, feature_name, +2 more.
geometry_boolean_differenceB
Create a boolean difference (subtract objects from another).
Args: input_object: Object to subtract from (e.g., 'blk1') objects_to_subtract: Objects to remove (e.g., ['cyl1']) geometry_name: Geometry sequence name (default: first geometry) component_name: Component name (default: 'comp1') feature_name: Feature name (auto-generated if None) model_name: Model name (default: current model)
Returns: Created difference operation info
Inputs: input_object (required), objects_to_subtract (required), model_name, feature_name, +2 more.
geometry_boolean_unionB
Create a boolean union of geometry objects.
Args: input_objects: Names of objects to unite geometry_name: Geometry sequence name model_name: Model name (default: current model)
Returns: Created union operation info
Inputs: input_objects (required), model_name, geometry_name.
geometry_buildA
Build the geometry sequence to generate the actual geometry.
This must be called after adding/modifying geometry features.
Args: geometry_name: Geometry sequence name (default: build all) component_name: Component name (default: 'comp1') model_name: Model name (default: current model)
Returns: Build status
Inputs: model_name, geometry_name, component_name.
geometry_createA
Create a new geometry sequence in the model's component.
IMPORTANT: A component must exist first. Use model_create_component if needed.
Args: geometry_name: Name for the geometry sequence (default: 'geom1') space_dimension: Space dimension - 2 for 2D, 3 for 3D (default: 3) component_name: Component name (default: 'comp1') model_name: Model name (default: current model)
Returns: Created geometry info
Inputs: model_name, geometry_name, component_name, space_dimension.
geometry_create_box_selectionA
Create a named Box selection for geometry entities by position.
For a 2D model, use entity_dimension=1 to select boundaries. For a 3D model, use entity_dimension=2 to select boundary faces.
Args: selection_name: Stable selection tag x_min: Minimum x-coordinate expression x_max: Maximum x-coordinate expression y_min: Minimum y-coordinate expression y_max: Maximum y-coordinate expression z_min: Optional minimum z-coordinate expression z_max: Optional maximum z-coordinate expression entity_dimension: Entity dimension (default: 1) condition: Box condition, usually "intersects" or "inside" geometry_name: Geometry sequence tag (default: first geometry) component_name: Component name (default: "comp1") model_name: Model name (default: current model)
Returns: Created named selection and matched entity numbers when available
Inputs: x_max (required), x_min (required), y_max (required), y_min (required), +8 more.
geometry_create_side_selectionsB
Create named left, right, bottom, and top Box selections.
This is intended for rectangular 2D domains such as waveguides and water-wave tanks. The resulting tags are _left, _right, _bottom, and _top.
Inputs: x_max (required), x_min (required), y_max (required), y_min (required), +6 more.
geometry_get_boundariesA
Get all boundaries from a geometry with their properties.
Use this to identify which boundary numbers correspond to which faces before setting boundary conditions.
Args: geometry_name: Geometry sequence name (default: first geometry) component_name: Component name (default: 'comp1') model_name: Model name (default: current model)
Returns: List of boundaries with their numbers and areas
Inputs: model_name, geometry_name, component_name.
geometry_importA
Import geometry from a CAD file.
Supported formats: STEP, IGES, STL, NASTRAN, etc.
Args: file_path: Path to the CAD file geometry_name: Geometry sequence name import_type: Import type (CAD, mesh, etc.) model_name: Model name (default: current model)
Returns: Import operation info
Inputs: file_path (required), model_name, import_type, geometry_name.
geometry_listA
List all geometry sequences in a model.
Args: model_name: Model name (default: current model)
Returns: List of geometry sequence names
Inputs: model_name.
geometry_list_featuresB
List all features in a geometry sequence.
Args: geometry_name: Geometry sequence name (default: first geometry) model_name: Model name (default: current model)
Returns: List of geometry features with their types
Inputs: model_name, geometry_name.
mesh_createB
Run one or all mesh sequences, creating a default sequence when needed.
Args: mesh_name: Mesh sequence tag (default: all, or "mesh1" when created) geometry_name: Geometry tag used when creating a mesh sequence component_name: Component name (default: first component) auto_create: Create a missing mesh sequence (default: True) model_name: Model name (default: current model)
Returns: Mesh generation status
Inputs: mesh_name, model_name, auto_create, geometry_name, +1 more.
mesh_create_sequenceC
Create a mesh sequence bound to a geometry.
Args: mesh_name: Mesh sequence tag (default: "mesh1") geometry_name: Geometry sequence tag (default: first geometry) component_name: Component name (default: first component) model_name: Model name (default: current model)
Returns: Created mesh sequence info
Inputs: mesh_name, model_name, geometry_name, component_name.
mesh_infoA
Get mesh information using a stable Java tag.
Args: mesh_name: Mesh sequence tag (default: first mesh) component_name: Component name (default: first component) model_name: Model name (default: current model)
Returns: Mesh tag, component, geometry, and feature information
Inputs: mesh_name, model_name, component_name.
mesh_listC
List mesh sequences by stable COMSOL Java tag.
Args: component_name: Component name (default: all components) model_name: Model name (default: current model)
Returns: Mesh sequence tags, components, and usable labels
Inputs: model_name, component_name.
model_cloneA
Clone a model to create a copy for comparison or modification.
Args: model_name: Name of the model to clone (default: current model) new_name: Name for the cloned model (auto-generated if not provided) set_current: Whether to set the clone as current model (default: False)
Returns: Info about the cloned model, or error message
Inputs: new_name, model_name, set_current.
model_createA
Create a new empty COMSOL model.
Args: name: Optional name for the model (auto-generated if not provided) set_current: Whether to set this as the current active model (default: True)
Returns: Model info including name, or error message
Inputs: name, set_current.
model_create_componentA
Create a component in the model (required before adding geometry/physics).
Components are containers for geometry, physics, materials, and mesh. Must be created before adding geometry or physics.
Args: component_name: Name for the component (default: 'comp1') space_dimension: Space dimension - 0=0D, 1=1D, 2=2D, 3=3D, 20=2D axisymmetric, 30=3D axisymmetric (default: 3) model_name: Model name (default: current model)
Returns: Created component info
Inputs: model_name, component_name, space_dimension.
modeling_best_practicesB
Get best practices for different modeling categories.
Categories:
"geometry": Geometry creation and import
"mesh": Mesh generation strategies
"physics": Physics interface configuration
"solver": Solver configuration and optimization
"results": Results evaluation and visualization
Args: category: Category to get best practices for
Returns: Best practices for the specified category
Inputs: category (required).
model_inspectA
Get detailed information about a model's structure and contents.
Args: model_name: Name of the model to inspect (default: current model)
Returns: Detailed model structure including parameters, physics, studies, etc.
Inputs: model_name.
model_listA
List all models currently loaded in the COMSOL session.
Returns: List of models with their names, file paths, and status
Inputs: no named parameters.
model_list_componentsA
List all components in a model.
Args: model_name: Model name (default: current model)
Returns: List of component names
Inputs: model_name.
model_loadA
Load a COMSOL model from a .mph file.
Args: file_path: Absolute or relative path to the .mph model file set_current: Whether to set this as the current active model (default: True)
Returns: Model info including name, file path, and version, or error message
Inputs: file_path (required), set_current.
model_removeC
Remove a model from memory.
Args: model_name: Name of the model to remove
Returns: Confirmation or error message
Inputs: model_name (required).
model_saveA
Save a COMSOL model to file.
Args: model_name: Name of the model to save (default: current model) file_path: Path to save to (default: original file path) format: Save format - 'Comsol', 'Java', 'Matlab', or 'VBA' (default: Comsol/.mph)
Returns: Save confirmation with file path, or error message
Inputs: format, file_path, model_name.
model_save_versionA
Save a model with a timestamp version suffix.
Creates a new file with structured path: ./comsol_models/{model_name}/{model_name}_{timestamp}.mph
Also saves a 'latest' copy: ./comsol_models/{model_name}/{model_name}_latest.mph
Useful for version control and design iterations.
Args: model_name: Name of the model to save (default: current model) description: Optional description for this version (stored in metadata)
Returns: Save confirmation with versioned file path, or error message
Inputs: model_name, description.
model_set_currentB
Set the current active model for subsequent operations.
Args: model_name: Name of the model to set as current
Returns: Confirmation or error message
Inputs: model_name (required).
multiphysics_addA
Add a multiphysics coupling between physics interfaces.
Common coupling types:
"ThermalStress": Couples Heat Transfer and Solid Mechanics
"FluidStructureInteraction": Couples Fluid Flow and Solid Mechanics
"ElectromechanicalForces": Couples Electrostatics and Solid Mechanics
"JouleHeating": Couples Electric Currents and Heat Transfer
Args: coupling_type: Type of multiphysics coupling physics_list: Names of physics interfaces to couple model_name: Model name (default: current model)
Returns: Created coupling info
Inputs: physics_list (required), coupling_type (required), model_name.
param_descriptionA
Get or set the description of a parameter.
Args: name: Parameter name text: New description text (if None, returns current description) model_name: Model name (default: current model)
Returns: Parameter description, or confirmation of update
Inputs: name (required), text, model_name.
param_getA
Get the value of a model parameter.
Args: name: Parameter name model_name: Model name (default: current model) evaluate: If True, return evaluated numerical value; if False, return expression string
Returns: Parameter value and description, or error message
Inputs: name (required), evaluate, model_name.
param_listB
List all parameters in a model.
Args: model_name: Model name (default: current model) evaluate: If True, return numerical values; if False, return expressions
Returns: Dictionary of all parameters with values and descriptions
Inputs: evaluate, model_name.
param_setA
Set the value of a model parameter.
Args: name: Parameter name value: Parameter value (can include units, e.g., "5[V]", "1.5[mm]") model_name: Model name (default: current model) description: Optional description for the parameter
Returns: Confirmation with new value, or error message
Inputs: name (required), value (required), model_name, description.
param_sweep_setupC
Set up a parametric sweep for a parameter.
Args: parameter_name: Name of the parameter to sweep values: List of parameter values to sweep through model_name: Model name (default: current model) study_name: Study to attach sweep to (default: first study)
Returns: Sweep configuration confirmation, or error message
Inputs: values (required), parameter_name (required), model_name, study_name.
pdf_list_modulesA
List all available COMSOL documentation modules.
Returns: List of module names with file counts
Inputs: no named parameters.
pdf_searchA
Search COMSOL PDF documentation using semantic search.
This searches through the indexed COMSOL documentation (60+ modules) to find relevant information about physics, modeling, and API usage.
Args: query: Search query describing what you're looking for n_results: Number of results to return (default: 5, max: 20) module: Optional module filter (e.g., "CFD_Module", "Heat_Transfer_Module")
Returns: Search results with relevant documentation snippets
Inputs: query (required), module, n_results.
pdf_search_statusA
Get the status of the PDF documentation search system.
Returns: Status information including whether the knowledge base is built, number of indexed documents, and available modules.
Inputs: no named parameters.
physics_addA
Add a physics interface to the model.
Common physics types:
"Electrostatics" or "es": Electrostatic field analysis
"ElectricCurrents" or "ec": Electric current conduction
"SolidMechanics" or "solid": Structural stress analysis
"HeatTransfer" or "ht": Heat transfer in solids
"LaminarFlow" or "spf": Fluid dynamics
Args: physics_type: Type identifier (e.g., "Electrostatics", "es") component_name: Component to add physics to (default: first component) model_name: Model name (default: current model)
Returns: Created physics interface info
Inputs: physics_type (required), model_name, component_name.
physics_add_acousticsA
Add a geometry-based Acoustics Module physics interface.
Use the exact COMSOL physics type for the installed version. Confirmed COMSOL 6.3 examples include PressureAcoustics and ThermoacousticsSinglePhysics. This tool also supports other acoustic interface types without maintaining a hard-coded allowlist.
Args: physics_type: Exact COMSOL acoustic physics type physics_tag: Physics interface tag (default: generated from type) domain_selection: Domain numbers (default: all domains) component_name: Component to add physics to (default: first component) geometry_name: Geometry sequence tag (default: first geometry) model_name: Model name (default: current model)
Returns: Created physics info
Inputs: physics_type (required), model_name, physics_tag, geometry_name, +2 more.
physics_add_coefficient_form_pdeC
Add a Coefficient Form PDE interface.
Common equation properties include c, a, f, da, ea, al, be, and ga. Values can be scalar, vector, or matrix expressions. Rejected properties are returned explicitly.
Inputs: model_name, physics_tag, component_name, domain_selection, +2 more.
physics_add_electrostaticsB
Add Electrostatics physics interface for electric field analysis.
Args: domain_selection: Selection name for domains (default: all domains) model_name: Model name (default: current model)
Returns: Created physics info
Inputs: model_name, domain_selection.
physics_add_general_form_pdeC
Add a General Form PDE interface.
Common equation properties include Ga, f, da, and ea. Values can be scalar, vector, or matrix expressions. Rejected properties are returned explicitly.
Inputs: model_name, physics_tag, component_name, domain_selection, +2 more.
physics_add_heat_transferB
Add Heat Transfer physics for thermal analysis.
Args: domain_selection: Selection name for domains (default: all domains) model_name: Model name (default: current model)
Returns: Created physics info
Inputs: model_name, domain_selection.
physics_add_laminar_flowB
Add Laminar Flow physics for fluid dynamics.
Args: domain_selection: Selection name for domains (default: all domains) model_name: Model name (default: current model)
Returns: Created physics info
Inputs: model_name, domain_selection.
physics_add_pressure_acousticsC
Add Pressure Acoustics physics for frequency-domain acoustic analysis.
Args: domain_selection: Domain numbers (default: all domains) component_name: Component to add physics to (default: first component) geometry_name: Geometry sequence tag (default: first geometry) physics_tag: Physics interface tag (default: "acpr") model_name: Model name (default: current model)
Returns: Created physics info
Inputs: model_name, physics_tag, geometry_name, component_name, +1 more.
physics_add_solid_mechanicsB
Add Solid Mechanics physics for structural analysis.
Args: domain_selection: Selection name for domains (default: all domains) model_name: Model name (default: current model)
Returns: Created physics info
Inputs: model_name, domain_selection.
physics_add_weak_form_pdeC
Add a Weak Form PDE interface.
Set the weak expression with equation_properties={"weak": "..."}. Rejected properties are returned explicitly.
Inputs: model_name, physics_tag, component_name, domain_selection, +2 more.
physics_boundary_selectionB
Generic boundary condition setup with boundary selection.
Use this tool to configure any boundary condition by specifying:
The physics interface name
The boundary condition type
The boundary numbers to apply the condition to
Properties specific to the boundary condition
Common boundary condition types by physics:
Heat Transfer (ht):
Temperature: Set T0 (temperature)
HeatFlux: Set q0 (heat flux)
ConvectiveHeatFlux: Set h (coefficient), Text (ambient temp)
Laminar Flow (spf):
InletBoundary: Set U0 (velocity)
OutletBoundary: Set p0 (pressure)
Wall: No-slip wall
Solid Mechanics (solid):
Fixed: Fixed constraint
BoundaryLoad: Set Fx, Fy, Fz or FAx, FAy, FAz
Args: physics_name: Name or label of the physics interface boundary_condition_type: Type of boundary condition boundary_numbers: List of boundary numbers properties: Dictionary of property names and values model_name: Model name (default: current model)
Returns: Configuration confirmation
Inputs: physics_name (required), boundary_numbers (required), boundary_condition_type (required), model_name, +1 more.
physics_configure_acoustic_boundaryC
Configure one Pressure Acoustics boundary condition.
Common types are SoundHard, SoundSoft, Pressure, Impedance, NormalAcceleration, NormalVelocity, PlaneWaveRadiation, and SphericalWaveRadiation. Unknown types are passed through for other acoustic interfaces and versions. Property-setting errors are returned instead of being ignored.
Inputs: physics_name (required), boundary_condition (required), model_name, properties, +3 more.
physics_configure_boundaryA
Configure a boundary condition for a physics interface.
Common boundary conditions for Heat Transfer:
"Temperature": Fixed temperature
"HeatFlux": Heat flux boundary
"ConvectiveHeatFlux": Convection cooling
"ThermalInsulation": Thermal insulation (adiabatic)
Common for Solid Mechanics:
"Fixed": Fixed constraint
"Roller": Roller constraint
"Symmetry": Symmetry plane
"BoundaryLoad": Applied force/pressure
Common for Electrostatics:
"Ground": Zero potential boundary
"ElectricPotential": Specified voltage
"SurfaceChargeDensity": Surface charge
"ZeroCharge": Zero normal displacement field
Args: physics_name: Name or label of the physics interface boundary_condition: Type of boundary condition (e.g. "Temperature", "HeatFlux") boundary_selection: Boundary/edge numbers to apply condition to properties: Dictionary of property names and values (e.g. {"T0": "293.15[K]"}) model_name: Model name (default: current model)
Returns: Created boundary condition info
Inputs: physics_name (required), boundary_condition (required), boundary_selection (required), model_name, +1 more.
physics_configure_pde_boundaryA
Configure one Coefficient, General, or Weak Form PDE boundary condition.
Common types are DirichletBoundary, FluxBoundary, ZeroFluxBoundary, WeakContribution, and PeriodicCondition. Unknown types are passed through for version-specific PDE features. Use selection_name to bind the condition to a named geometric selection instead of entity numbers. Property-setting errors are returned instead of being ignored.
Inputs: physics_name (required), boundary_condition (required), model_name, properties, +3 more.
physics_get_acoustic_boundary_conditionsA
Get common Pressure Acoustics boundary feature types and properties.
Returns: Acoustic boundary condition reference
Inputs: no named parameters.
physics_get_availableA
Get a list of available physics interfaces organized by category.
Returns: Dictionary of physics categories and their interfaces
Inputs: no named parameters.
physics_get_guideB
Get a quick guide for a specific physics type.
Available physics types:
"electrostatics": Electric field and capacitance
"heat_transfer": Thermal analysis
"solid_mechanics": Stress and deformation
"fluid_flow": CFD analysis
"pressure_acoustics": Frequency-domain pressure acoustics
"coefficient_form_pde": Coefficient Form PDE
"general_form_pde": General Form PDE
"weak_form_pde": Weak Form PDE
Args: physics_type: Type of physics to get guide for
Returns: Quick reference guide for the physics type
Inputs: physics_type (required).
physics_get_pde_boundary_conditionsB
Get common PDE boundary feature types and properties.
Returns: PDE boundary condition reference
Inputs: no named parameters.
physics_interactive_setup_flowB
Interactive setup wizard for Laminar Flow boundary conditions.
This tool helps identify and configure flow boundary conditions:
Lists all available boundaries
Prompts user to select inlet, outlet, and wall boundaries
Configures appropriate boundary conditions
Args: physics_name: Name of the Laminar Flow physics interface model_name: Model name (default: current model)
Returns: Boundary information and setup instructions
Inputs: model_name, physics_name.
physics_interactive_setup_heatC
Interactive setup wizard for Heat Transfer boundary conditions.
This tool helps identify and configure thermal boundary conditions:
Lists all available boundaries
Shows typical boundary condition types for thermal analysis
Provides setup instructions
Args: physics_name: Name of the Heat Transfer physics interface model_name: Model name (default: current model)
Returns: Boundary information and setup instructions
Inputs: model_name, physics_name.
physics_listA
List all physics interfaces defined in a model.
Args: model_name: Model name (default: current model)
Returns: List of physics interface names
Inputs: model_name.
physics_list_featuresC
List all features (boundary conditions, domain settings) in a physics interface.
Args: physics_name: Name of the physics interface model_name: Model name (default: current model)
Returns: List of physics features
Inputs: physics_name (required), model_name.
physics_removeB
Remove a physics interface from the model.
Args: physics_name: Name of the physics interface to remove model_name: Model name (default: current model)
Returns: Removal confirmation
Inputs: physics_name (required), model_name.
physics_set_materialB
Assign a material to physics domains.
This tool tries to add the material from COMSOL's built-in library if it's not already in the model.
Args: physics_name: Name of the physics interface material_name: Name of the material (e.g. "Silicon", "Steel AISI 4340", "Copper") domain_selection: Domain numbers (default: all domains for this physics) model_name: Model name (default: current model)
Returns: Assignment confirmation
Inputs: physics_name (required), material_name (required), model_name, domain_selection.
physics_setup_acoustic_boundariesB
Configure multiple acoustic boundary conditions in one call.
Each item accepts:
type: COMSOL boundary feature type
boundaries: List of boundary numbers
selection_name: Optional named COMSOL selection instead of numbers
properties: Optional COMSOL property dictionary
dimension: Optional geometric entity dimension override
tag: Optional explicit feature tag
label: Optional display label
Example: [ {"type": "SoundHard", "boundaries": [1, 2]}, { "type": "Impedance", "boundaries": [3], "properties": {"Zn": "rho0*c0"} } ]
Inputs: physics_name (required), boundary_conditions (required), model_name, boundary_dimension.
physics_setup_flow_boundariesA
Setup Laminar Flow boundary conditions with specified boundaries.
This tool configures inlet velocity and outlet pressure boundary conditions for a fluid flow simulation.
Args: physics_name: Name of the Laminar Flow physics interface inlet_boundaries: List of boundary numbers for inlets outlet_boundaries: List of boundary numbers for outlets inlet_velocity: Inlet velocity expression (default: "1[mm/s]") outlet_pressure: Outlet pressure expression (default: "0") model_name: Model name (default: current model)
Returns: Configuration confirmation
Inputs: physics_name (required), inlet_boundaries (required), outlet_boundaries (required), model_name, +2 more.
physics_setup_heat_boundariesA
Setup Heat Transfer boundary conditions with specified boundaries.
This tool configures thermal boundary conditions for heat transfer simulation:
Heat flux boundaries (heat sources)
Temperature boundaries (heat sinks)
Convective cooling/heating boundaries
Args: physics_name: Name of the Heat Transfer physics interface heat_flux_boundaries: List of boundary numbers for heat flux temperature_boundaries: List of boundary numbers for fixed temperature convection_boundaries: List of boundary numbers for convection heat_flux_value: Heat flux value (default: "1e6[W/m^2]") temperature_value: Temperature value (default: "293.15[K]" = 20°C) convection_coeff: Convection coefficient (default: "10[W/(m^2*K)]") ambient_temp: Ambient temperature for convection (default: "293.15[K]") model_name: Model name (default: current model)
Returns: Configuration confirmation
Inputs: physics_name (required), model_name, ambient_temp, heat_flux_value, +5 more.
physics_setup_pde_boundariesC
Configure multiple PDE boundary conditions in one call.
Each item accepts:
type: COMSOL boundary feature type
boundaries: List of boundary numbers
selection_name: Optional named COMSOL selection instead of numbers
properties: Optional scalar, vector, or matrix property dictionary
dimension: Optional geometric entity dimension override
tag: Optional explicit feature tag
label: Optional display label
Inputs: physics_name (required), boundary_conditions (required), model_name, boundary_dimension.
results_evaluateC
Evaluate an expression on a solution dataset.
Args: expression: Expression(s) to evaluate, e.g., "es.normE" or ["x", "y", "es.normE"] unit: Desired unit for result, e.g., "V/m", "pF" dataset: Dataset name (default: uses default dataset) inner: For time-dependent solutions: index, 'first', 'last', or list of indices outer: For parametric sweeps: index or list of indices model_name: Model name (default: current model)
Returns: Evaluated values as lists, or error message
Inputs: expression (required), unit, inner, outer, +2 more.
results_export_dataA
Export data from an export node.
Args: node_name: Export node name (default: run all exports) file_path: Output file path (overrides node setting) model_name: Model name (default: current model)
Returns: Export confirmation with file path
Inputs: file_path, node_name, model_name.
results_export_imageB
Export a plot as an image.
Args: node_name: Plot export node name file_path: Output image path (e.g., "results.png", "field.png") model_name: Model name (default: current model)
Returns: Export confirmation with file path
Inputs: file_path, node_name, model_name.
results_exports_listA
List all export nodes defined in a model.
Args: model_name: Model name (default: current model)
Returns: List of export node names
Inputs: model_name.
results_global_evaluateB
Evaluate a global expression (returns a single scalar value).
Common global expressions include:
Integration: "intop1(T)" where intop1 is an integration operator
Maximum: "maxop1(T)"
Derived values: "2*es.intWe/U^2" for capacitance
Args: expression: Global expression to evaluate unit: Desired unit for result dataset: Dataset name model_name: Model name (default: current model)
Returns: Single numerical value
Inputs: expression (required), unit, dataset, model_name.
results_inner_valuesA
Get inner solution indices and values (time steps in time-dependent study).
Args: dataset: Dataset name (default: default dataset) model_name: Model name (default: current model)
Returns: Arrays of indices and corresponding values (e.g., time values)
Inputs: dataset, model_name.
results_outer_valuesC
Get outer solution indices and values (parameter values in parametric sweep).
Args: dataset: Dataset name (default: default dataset) model_name: Model name (default: current model)
Returns: Arrays of indices and corresponding parameter values
Inputs: dataset, model_name.
results_plots_listA
List all plot nodes defined in a model.
Args: model_name: Model name (default: current model)
Returns: List of plot node names
Inputs: model_name.
solutions_listB
List all solutions in a model.
Args: model_name: Model name (default: current model)
Returns: List of solution configurations
Inputs: model_name.
study_cancelA
Cancel the current solving operation.
Note: The solver may take a moment to respond to cancellation.
Returns: Cancellation status
Inputs: no named parameters.
study_createB
Create a new study in the model.
Common study types:
"Stationary": Stationary study (most common for electrostatics, structural)
"TimeDependent": Time-dependent study
"Eigenfrequency": Eigenfrequency analysis
"Frequency": Frequency domain study
"Perturbation": Perturbation study
Args: study_type: Type of study to create study_name: Optional name/tag for the study model_name: Model name (default: current model)
Returns: Created study info
Inputs: model_name, study_name, study_type.
study_get_progressA
Get the progress of the current solving operation.
Returns: Progress information including status, percentage, and elapsed time
Inputs: no named parameters.
study_listA
List all studies in a model.
Args: model_name: Model name (default: current model)
Returns: List of study names with their types
Inputs: model_name.
study_solveA
Solve a study (synchronous by default).
Args: study_name: Study to solve (None for all studies) model_name: Model name (default: current model) wait: If True, wait for completion; if False, return immediately timeout: Maximum wait time in seconds (only used if wait=True)
Returns: Solution status, or error message
Inputs: wait, timeout, model_name, study_name.
study_solve_asyncA
Start solving a study in the background (asynchronous).
Use study_get_progress to monitor progress and study_cancel to stop.
Args: study_name: Study to solve (None for all studies) model_name: Model name (default: current model)
Returns: Confirmation that solving started, or error message
Inputs: model_name, study_name.
study_waitA
Wait for the current solving operation to complete.
Args: timeout: Maximum time to wait in seconds (None for indefinite)
Returns: Final progress status
Inputs: timeout.
troubleshootB
Get troubleshooting suggestions for common issues.
Common error types:
"geometry_build_failed": Geometry sequence failed to build
"mesh_failed": Mesh generation failed
"solver_no_convergence": Solver did not converge
"memory_error": Out of memory
"license_error": COMSOL license issues
Args: error_type: Type of error encountered context: Additional context about the error
Returns: Troubleshooting suggestions
Inputs: error_type (required), context.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 93 tools
The server has clear high-level groups, but many tools overlap heavily: generic physics_add coexists with specific adders for laminar flow, heat transfer, acoustics, etc., and generic boundary tools coexist with multiple specialized boundary setup tools. Descriptions help distinguish some cases, but an agent can still easily misselect between generic and specialized tools for the same task.
Most tools follow a predictable domain_action or domain_object_action pattern, such as model_save, geometry_add_block, physics_configure_boundary, and study_solve_async. A few names like troubleshoot and modeling_best_practices break the convention, but the overall pattern is readable and mostly consistent.
With 93 tools, this is far beyond a well-scoped MCP surface and includes many redundant generic/specialized wrappers. The count is extreme even for a complex domain, making the toolset unwieldy for an agent to navigate.
Coverage is broad: session management, model lifecycle, parameters, geometry, physics, multiphysics, mesh, studies, solutions, datasets, results, exports, docs, and troubleshooting are all represented. Minor gaps remain, such as richer mesh feature customization and results plot creation/management, but core workflows are covered.
Maintenance
Related MCP Connectors
Build, validate, and deploy multi-agent AI solutions from any AI environment.
MCP server for building and testing AI agents with multi-model experimentation and insights.
AgentPMT is the AI agent marketplace that turns any MCP-compatible AI assistant into an autonomous employee. Connect once and your agents gain access to a growing ecosystem of tools, workflows, and skills spanning communication, data analytics, development, file management, search, and more. AgentPMT dynamically discovers and orchestrates tools from across the MCP ecosystem, so your agents can independently find the right tool for any task without manual configuration.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Related MCP Servers
- AlicenseBqualityDmaintenanceMCP Server for COMSOL Multiphysics simulation automation via AI agents.782MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server for COMSOL Multiphysics that enables AI agents to perform flexible pressure sensor simulation, including DXF analysis, contact model building, parameter sweeping, and result export using natural language.1MIT
- AlicenseBqualityCmaintenanceEnables AI agents to automate COMSOL Multiphysics simulations, including model management, geometry building, physics configuration, meshing, solving, and results visualization through the MCP protocol.78MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to automate COMSOL Multiphysics simulations, including model management, geometry building, physics configuration, meshing, solving, and results visualization via the MCP protocol.MIT