FluidsLeafMCP#
- class ansys.fluent.mcp.common.base.FluidsLeafMCP(*, backends: dict[str, ansys.fluent.mcp.common.backend.Backend], expose_tools: Iterable[str] = ALL_TOOLS, name: str | None = None, **fastmcp_kwargs: Any)#
Bases:
ansys.common.mcp.server.PyAnsysBaseMCPBase server class for a single Fluids MCP leaf.
Overview#
Start the MCP server via the parent implementation when available. |
|
No persistent product session at startup. Backends connect lazily. |
|
Disconnect any active backend at shutdown. |
|
Build toolset definitions filtered to the tools this leaf exposes. |
|
Register a callable invoked after every |
Return the active backend instance. |
Import detail#
from ansys.fluent.mcp.common.base import FluidsLeafMCP
Property detail#
- property FluidsLeafMCP.backend: ansys.fluent.mcp.common.backend.Backend#
Return the active backend instance.
- Returns:
BackendBackend produced by the operation.
Attribute detail#
Method detail#
- FluidsLeafMCP.run(transport: str = 'stdio', host: str | None = None, port: int | None = None) None#
Start the MCP server via the parent implementation when available.
- FluidsLeafMCP.product_startup() None#
No persistent product session at startup. Backends connect lazily.
- Returns:
NoneThe function completes through its side effects.
- FluidsLeafMCP.product_cleanup() None#
Disconnect any active backend at shutdown.
- Returns:
NoneThe function completes through its side effects.
- FluidsLeafMCP.build_toolsets() list[dict[str, Any]]#
Build toolset definitions filtered to the tools this leaf exposes.
Returns a list of toolset dicts conforming to the PyAnsysMCPService conductor contract.
- FluidsLeafMCP.register_run_code_observer(observer: Callable[Ellipsis, Awaitable[None] | None]) None#
Register a callable invoked after every
run_codetool call.The observer is called as
observer(code=..., result=..., error=...).resultis the backend’sRunCodeResulton success (andNoneon exception);erroris the raised exception on failure (andNoneon success). Observers may be sync or async. Exceptions raised by an observer are logged and swallowed so the original tool result is preserved.