PyAnsysGeometryMCP#

class ansys.geometry.mcp.server.PyAnsysGeometryMCP(name: str = 'pyansys-geometry-mcp', *args, **kwargs)#

Bases: ansys.common.mcp.PyAnsysBaseMCP

MCP server for PyAnsys Geometry-MCP.

This server enables AI assistants to interact with PyAnsys Geometry (ansys-geometry-core) for simulation and analysis workflows.

Overview#

create_context

Create (or return the pre-existing) product-specific context.

product_startup

Launch the product instance when the server starts.

product_cleanup

Clean up the product instance when the server stops.

context

App context for the MCP server.

Import detail#

from ansys.geometry.mcp.server import PyAnsysGeometryMCP

Attribute detail#

PyAnsysGeometryMCP.context: ansys.geometry.mcp.context.PyAnsysGeometryContext#

App context for the MCP server.

Contains the product instance and related information.

Method detail#

PyAnsysGeometryMCP.create_context() → ansys.geometry.mcp.context.PyAnsysGeometryContext#

Create (or return the pre-existing) product-specific context.

If the context has already been initialised, for example because CLI arguments were written to app.context before app.run() was called, this method returns it unchanged so that caller-set configuration is preserved.

Returns#

PyAnsysGeometryContext

Context instance with command history.

PyAnsysGeometryMCP.product_startup()#

Launch the product instance when the server starts.

This method is called automatically during server startup.

PyAnsysGeometryMCP.product_cleanup()#

Clean up the product instance when the server stops.

This method is called automatically during server shutdown.