Installation#

PyMechanical-MCP supports Python 3.11 through 3.14.

Prerequisites#

  • Ansys Mechanical installation (local or remote) with an available gRPC endpoint

  • Python 3.11 through 3.14

  • Network access between PyMechanical-MCP and the Mechanical server

Install from PyPI#

Install PyMechanical-MCP using pip:

pip install ansys-mechanical-mcp

Install from source#

Clone and install in editable mode:

git clone https://github.com/ansys/pymechanical-mcp
cd pymechanical-mcp
pip install -e ".[dev]"

Run the server#

Use STDIO transport (the default) for MCP clients such as Visual Studio Code and Claude Code:

ansys-mechanical-mcp

Use Streamable HTTP transport for remote or server-style deployments:

ansys-mechanical-mcp --transport http --http-host 127.0.0.1 --http-port 8080

Connect on startup (optional)#

To auto-connect to a running Mechanical instance at startup:

ansys-mechanical-mcp --connect-on-startup --ip 127.0.0.1 --port 10000

Warning

When you use --connect-on-startup, PyMechanical-MCP locks the connection and disables the launch_mechanical, connect_to_mechanical, and disconnect_from_mechanical tools.

Transport security mode#

Select gRPC transport behavior with --transport-mode:

  • auto: Automatically detects the mode based on the platform and certificates.

  • insecure: Uses plaintext gRPC.

  • mtls: Uses mutual TLS (requires certificates).

  • wnua: Uses Windows Named User Authentication.

Example:

ansys-mechanical-mcp --transport-mode mtls --certs-dir /path/to/certs

You can supply the same values with environment variables:

  • PYMECHANICAL_TRANSPORT_MODE

  • ANSYS_GRPC_CERTIFICATES

Next steps#