:class:`PyAnsysBaseAppContext` ============================== .. py:class:: ansys.common.mcp.context.PyAnsysBaseAppContext Base application context for PyAnsys MCP servers. This class provides a common structure that product-specific contexts can extend. The ``product_instance`` field can hold any Ansys product connection (such as MAPDL, Fluent, or Maxwell). :Attributes: **product_instance** : [:obj:`Any`], default: :data:`python:None` Main product instance (such as MAPDL or Fluent) associated with the context. **python_executable** : [:obj:`Any`], default: :data:`python:None` Python executable to use for the session. **python_session** : [:obj:`Any`], default: :data:`python:None` Instance of the ``PersistentPythonSession`` class for managing the persistent Python session. **metadata** : :class:`python:dict` Dictionary for storing arbitrary metadata related to the context. **command_history** : :class:`python:list` List to keep track of executed commands in the session. .. rubric:: Examples Extend the base context for a specific product: >>> from ansys.common.mcp import PyAnsysBaseAppContext >>> from dataclasses import dataclass >>> from typing import Optional, Any >>> >>> @dataclass >>> class NewAppContext(PyAnsysBaseAppContext): ... instance: Optional[Any] = None ... ... @property ... def product_instance(self): ... return self.instance .. !! processed by numpydoc !! .. py:currentmodule:: PyAnsysBaseAppContext Overview -------- .. tab-set:: .. tab-item:: Attributes .. list-table:: :header-rows: 0 :widths: auto * - :py:attr:`~product_instance` - * - :py:attr:`~python_executable` - * - :py:attr:`~python_session` - * - :py:attr:`~metadata` - * - :py:attr:`~command_history` - Import detail ------------- .. code-block:: python from ansys.common.mcp.context import PyAnsysBaseAppContext Attribute detail ---------------- .. py:attribute:: product_instance :type: Optional[Any] :value: None .. py:attribute:: python_executable :type: Optional[Any] :value: None .. py:attribute:: python_session :type: Optional[Any] :value: None .. py:attribute:: metadata :type: dict[str, Any] .. py:attribute:: command_history :type: list[str] :value: []