Skip to main content
Glama
HBPEKING-TKS

COMSOL MCP Server

by HBPEKING-TKS

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
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)

Returns: Session info including version and core count, or error message

comsol_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

comsol_disconnectA

Disconnect from COMSOL and clear all models from memory.

Returns: Success status and message

comsol_statusA

Get the current COMSOL session status.

Returns: Session information including connection status, version, and loaded models

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

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

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') model_name: Model name (default: current model)

Returns: Created component info

model_list_componentsA

List all components in a model.

Args: model_name: Model name (default: current model)

Returns: List of component names

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

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

model_listB

List all models currently loaded in the COMSOL session.

Returns: List of models with their names, file paths, and status

model_set_currentC

Set the current active model for subsequent operations.

Args: model_name: Name of the model to set as current

Returns: Confirmation or error message

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

model_removeC

Remove a model from memory.

Args: model_name: Name of the model to remove

Returns: Confirmation or error message

model_inspectB

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.

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

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

param_listA

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

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

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

geometry_listA

List all geometry sequences in a model.

Args: model_name: Model name (default: current model)

Returns: List of geometry sequence names

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

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

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

geometry_add_cylinderA

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

geometry_add_sphereB

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

geometry_add_rectangleA

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

geometry_add_circleC

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

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

geometry_boolean_differenceA

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

geometry_importB

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

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

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

physics_listA

List all physics interfaces defined in a model.

Args: model_name: Model name (default: current model)

Returns: List of physics interface names

physics_get_availableA

Get a list of available physics interfaces organized by category.

Returns: Dictionary of physics categories and their interfaces

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

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

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

physics_add_heat_transferA

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

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

physics_configure_boundaryB

Configure a boundary condition for a physics interface.

Common boundary conditions for Electrostatics:

  • "Ground": Zero potential boundary

  • "ElectricPotential": Specified voltage

  • "SurfaceChargeDensity": Surface charge

  • "ZeroCharge": Zero normal displacement field

Common for Solid Mechanics:

  • "Fixed": Fixed constraint

  • "Roller": Roller constraint

  • "Symmetry": Symmetry plane

  • "BoundaryLoad": Applied force/pressure

Common for Heat Transfer:

  • "Temperature": Fixed temperature

  • "HeatFlux": Heat flux boundary

  • "ConvectiveHeatFlux": Convection cooling

  • "Symmetry": Symmetry (adiabatic)

Args: physics_name: Name of the physics interface boundary_condition: Type of boundary condition boundary_selection: Boundary/edge numbers to apply condition to properties: Dictionary of property names and values model_name: Model name (default: current model)

Returns: Created boundary condition info

physics_set_materialB

Assign a material to physics domains.

Args: physics_name: Name of the physics interface material_name: Name of the material to assign domain_selection: Domain numbers (default: all domains for this physics) model_name: Model name (default: current model)

Returns: Assignment confirmation

multiphysics_addB

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

physics_list_featuresB

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

physics_removeC

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

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) model_name: Model name (default: current model)

Returns: List of boundaries with their numbers and areas

physics_interactive_setup_flowA

Interactive setup wizard for Laminar Flow boundary conditions.

This tool helps identify and configure flow boundary conditions:

  1. Lists all available boundaries

  2. Prompts user to select inlet, outlet, and wall boundaries

  3. 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

physics_setup_flow_boundariesB

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

physics_interactive_setup_heatB

Interactive setup wizard for Heat Transfer boundary conditions.

This tool helps identify and configure thermal boundary conditions:

  1. Lists all available boundaries

  2. Shows typical boundary condition types for thermal analysis

  3. 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

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

physics_boundary_selectionB

Generic boundary condition setup with boundary selection.

Use this tool to configure any boundary condition by specifying:

  1. The physics interface name

  2. The boundary condition type

  3. The boundary numbers to apply the condition to

  4. Properties specific to the boundary condition

Common boundary condition types by physics:

Heat Transfer (ht):

  • TemperatureBoundary: Set T0 (temperature)

  • HeatFluxBoundary: 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 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

mesh_listA

List all mesh sequences in a model.

Args: model_name: Model name (default: current model)

Returns: List of mesh sequence names

mesh_createB

Run a mesh sequence to generate the mesh.

This executes the meshing operations defined in the mesh sequence.

Args: mesh_name: Mesh sequence name (default: run all mesh sequences) model_name: Model name (default: current model)

Returns: Mesh generation status

mesh_infoB

Get information about a mesh.

Args: mesh_name: Mesh sequence name (default: first mesh) model_name: Model name (default: current model)

Returns: Mesh statistics including element counts

study_listA

List all studies in a model.

Args: model_name: Model name (default: current model)

Returns: List of study names with their types

study_solveC

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

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

study_get_progressA

Get the progress of the current solving operation.

Returns: Progress information including status, percentage, and elapsed time

study_cancelA

Cancel the current solving operation.

Note: The solver may take a moment to respond to cancellation.

Returns: Cancellation status

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

solutions_listB

List all solutions in a model.

Args: model_name: Model name (default: current model)

Returns: List of solution configurations

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

results_evaluateB

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

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

results_inner_valuesC

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)

results_outer_valuesB

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

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

results_export_imageA

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

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

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

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

docs_listA

List all available documentation topics.

Returns: List of available documentation topics with descriptions

physics_get_guideA

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

Args: physics_type: Type of physics to get guide for

Returns: Quick reference guide for the physics type

troubleshootA

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

modeling_best_practicesA

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

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

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.

pdf_list_modulesA

List all available COMSOL documentation modules.

Returns: List of module names with file counts

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription
get_session_info Get current COMSOL session information as a resource. Returns formatted session status including connection state and loaded models.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/HBPEKING-TKS/mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server