The base.py module#
Summary#
Base server class for a single shared MCP leaf. |
Filter named CFX objects from a mapping using include and exclude rules. |
|
|
|
Description#
Base MCP server for the CFX MCP leaf.
A leaf:
Picks one or more Backend instances at construction time.
Inherits from PyAnsysBaseMCP so it can be registered alongside other PyAnsys MCP servers at the organization level.
- Auto-registers the requested tool surface from ALL_TOOLS, including
session_status, connect, disconnect, codegen, clarify, model-context helpers, run_code, validate_code, and optional lifecycle/reporting tools.
Concrete leaves only have to declare which tools to expose as a subset of the preceding list, keeping the MCP surface lean per leaf.
Module detail#
- base.select_named_objects_from_mapping(named: dict[str, list[str]], *, collection: str, pattern: str = '*', include_shadows: bool = True, exclude: list[str] | None = None) dict[str, Any]#
Filter named CFX objects from a mapping using include and exclude rules.
- Parameters:
- named
dict[str,list[str]] Mapping of named objects grouped by collection.
- collection
str Named-object collection to inspect.
- pattern
str,optional Name or wildcard pattern used to select objects. Default is
'*'.- include_shadowsbool,
optional Whether shadowed names should be included in object-selection results. Default is
True.- exclude
Optional[list[str]],optional Names or patterns to omit from object-selection results. Default is
None.
- named
- Returns:
- base.ALL_TOOLS = ('session_status', 'connect', 'disconnect', 'codegen', 'clarify', 'error_remediation',...#