Tools and capabilities#
Tool availability model#
PyMechanical-MCP uses connection-aware visibility.
Offline-capable tools are available before any Mechanical session.
Live-session tools use
REQUIRES_MECHANICAL_TAGand remain hidden until you successfully calllaunch_mechanicalorconnect_to_mechanical.If you use
--connect-on-startup, live-session tools are available immediately, and PyMechanical-MCP locks the connection lifecycle tools.If you use
--static-tools, all tools (including live-session tools) are visible from startup. Calling a live-session tool before connecting returns a clear “No Mechanical connection available” message instead of the tool being hidden. Use this if your MCP client does not reliably refresh its tool list when the server dynamically enables tools. See Configuration for details.
Always available (before connection)#
Tool |
Description |
|---|---|
|
Verify that Mechanical is installed and discoverable. |
|
Inspect connection state, ownership, transport, pending operations, and
persistent Python diagnostics, including when disconnected. Replaces
|
|
List running Mechanical processes. |
|
Start a new Mechanical session. GUI is preferred by default, and batch mode remains available. |
|
Attach to an existing Mechanical instance. |
|
Return workflow guidance by topic. |
Available after connection#
Tool |
Description |
|---|---|
|
End the session. Closes an instance started by |
|
Execute Python snippets in the persistent session. |
|
Produce custom plots from analysis data. |
|
Clear the current model (unsaved work is lost). Mechanical and the connection stay open. |
|
Execute a Mechanical script string or read one from a local file with |
|
Check a script without running it: compile it in the connected scripting engine and look up its API names in the live session. |
|
Find Outline objects by name, category, or parent and return their stable object IDs. |
|
With |
|
Validate a new property value and show the current and proposed values without changing the model. Returns a single-use token. |
|
Apply a previewed change. The change is rejected if the token was already used, has expired, or the value changed since the preview. |
|
Save active project. |
|
Open an existing MECHDB project. |
|
Upload local file to Mechanical working directory. |
|
Download file from Mechanical working directory. |
|
Download all supported project files, optionally filtered by extension. |
|
List files in working directory. |
|
Solve the analysis selected by |
|
Return a structured model summary: geometry and mesh counts, active mesh metric, named selections, materials, unit system, analyses, and boundary conditions. Lists are limited previews with total counts and truncation information. |
|
Return solved result minima, maxima, and averages with units, without exporting files. |
|
Capture the |
|
Retrieve Mechanical logs for diagnostics. |
|
Export result objects and artifacts for the analysis selected by
|
Note
When you run with --connect-on-startup, PyMechanical-MCP disables
the launch_mechanical, connect_to_mechanical, and
disconnect_from_mechanical tools by design.
Guideline topics#
get_guidelines_for supports these topic values:
workflowgeometrymaterialsmeshinganalysis_setupboundary_conditionssolutionpostprocessingnamed_selectionsgeneral
Tool set discovery resource#
PyMechanical-MCP exposes toolsets://definition for service-side discovery.
The payload groups tools into:
lifecycle
scripting
project-management
file-management
simulation
inspection
object-discovery
property-changes
results
guidelines
This resource is read-only metadata. It does not modify runtime behavior.
Object discovery and safe changes#
These tools read the connected session, so their results match the installed Mechanical release, including releases newer than the bundled API reference.
find_objectsreturns stable object IDs. Use IDs rather than names, which can repeat, or positions, which change when objects are added. To retrieve more matches, setoffsetto the returnednext_offsetuntil it is null. Keep filters unchanged and restart ifresult_fingerprintchanges. Each page scans the current Outline tree; paging is not a saved model snapshot.describe_apiwithobject_idlists properties shown in the Details view by default. Setdetails_only=Falsefor every public API property.describe_apiwithquerysearches API types, properties, methods, and enumeration members by keyword, such as"element size". A query that names a type, such as"FixedSupport", also lists all its members. Use it to find real API names before writing a script. Results include installed API documentation where available. An exact query, such as"Analysis.Solve", includes available parameter descriptions, remarks, and examples, with source and truncation information. Help comes from the connected Mechanical installation without internet access. If documentation is unavailable, API names and signatures are still returned.preview_property_changechecks values strictly against the property type. Booleans must betrueorfalse, integers must fit the property range, enumeration values must be exact member names, and quantities must be strings such as"10 [mm]"whose unit is compatible with the current value.apply_property_changeapplies only a matching, unused, unexpired preview whose current value has not changed, and then reads the value back.
A preview is not a sandbox. Applied changes are not undone automatically, so
save the project first if you need a restore point. Properties of other types,
such as geometry scoping or tabular data, still require run_python_script.
check_script compiles a script in the connected scripting engine without
running it. Remote Mechanical sessions, including 2026 R1 and 2027 R1, run
IronPython 2.7, so syntax such as f-strings is reported. It then looks up names
such as Model.Mesh.ElementSize in the live session to find misspelled or
nonexistent members. The check reads properties but never calls methods. A passing
check does not validate argument types, values, or the model state at run time.
Large-model summaries#
get_model_info defaults to max_items=50 entries per named-selection,
material, analysis and boundary-condition list. Check collection_info for
total counts, returned counts, truncation, and read errors. A null total means
the collection could not be counted.
Set
max_items=0for counts without list entries.Increase
max_itemsfor a larger preview, up to 1000 entries per list.Set
max_items=None(nullin MCP arguments) for full lists; responses can be large.Use filtered
find_objectspages to locate objects in large models.
Geometry is reported as counts by body type (body_counts_by_type) and
suppression state (suppression_counts), without listing body names.
These counts describe the model; they do not validate its engineering setup.
Example workflows#
Static structural run#
check_mechanical_statuslaunch_mechanicalorconnect_to_mechanicalupload_file(geometry)run_python_script(import geometry, assign material, and mesh)run_python_script(apply boundary conditions and loads)solve_analysisexport_resultsandscreenshot
Modal analysis#
Connect to Mechanical.
Import the model and set materials and supports for the intended analysis.
Create a modal analysis and configure mode extraction with script tools.
Run
solve_analysis.Add and evaluate modal results with
run_python_script.Use
screenshotorexport_resultsto report mode shapes.
Change a setting with a preview#
find_objectswithcategory="Mesh"to get the mesh object IDdescribe_apiwith the object ID to readElementSizeand its unitpreview_property_changewithvalue="2 [mm]"Confirm the preview with the user
apply_property_changewith the returnedpreview_token
Checks after solving#
get_model_infofor verifying solved stateget_mechanical_logsfor warnings and errorsget_results_summaryfor result values and unitsrun_python_codefor processing exported dataexport_resultsfor report artifacts
Feature reference#
For complete parameter signatures and return values for all tools, see API reference.
Next steps#
See Best practices for recommendations on using the tools effectively.
Explore Review engineering workflow examples for end-to-end workflow examples.
For startup and environment options, see Configuration.