PyMechanicalAppContext#
- class ansys.mechanical.mcp.server.PyMechanicalAppContext#
Bases:
ansys.common.mcp.context.PyAnsysBaseAppContextApplication context with typed dependencies and CLI options.
- Attributes:
- mechanical
Optional[Any] Mechanical instance connection.
- transport_type
str Transport type for PyMechanical-MCP. Options are
'stdio'and'http'.- mechanical_ip
Optional[str] IP address or hostname for Mechanical connection.
- mechanical_port
Optional[int] Port number for Mechanical connection.
- connect_on_startupbool
Whether to attempt Mechanical connection on PyMechanical-MCP startup.
- http_host
str Host address for HTTP transport.
- http_port
int Port number for HTTP transport.
- cors_origins
Optional[list[str]] List of allowed CORS origins for HTTP transport.
- grpc_transport_mode
Optional[str] gRPC transport mode for Mechanical connections. Options are
'auto','insecure','mtls', and'wnua'. When set to'auto'(default), the mode is determined automatically based on the platform and certificate availability.- certs_dir
Optional[str] Path to directory containing mTLS certificate files (
ca.crt,client.crt, andclient.key). Used whengrpc_transport_modeis'mtls'.
- mechanical
Overview#
Returns the Mechanical instance for backward compatibility. |
Import detail#
from ansys.mechanical.mcp.server import PyMechanicalAppContext