BackendClient#
- class ansys.aedt.mcp.lanes.client.BackendClient(port: int, host: str = '127.0.0.1', path: str = DEFAULT_PATH, auth_token: str | None = None)#
MCP client bound to one lane backend.
Use it as an async context manager:
>>> async with BackendClient(port=8090, auth_token=token) as backend: ... port = await backend.discover_aedt_port()
Overview#
Call a tool on the lane. |
|
Return the parsed |
|
Return the gRPC port of the AEDT session the lane is connected to. |
|
Connect the lane to an existing AEDT session. |
Open the MCP session. |
|
Close the MCP session. |
Import detail#
from ansys.aedt.mcp.lanes.client import BackendClient
Attribute detail#
- BackendClient.url#
Method detail#
- async BackendClient.__aenter__() BackendClient#
Open the MCP session.
- async BackendClient.__aexit__(exc_type: type[BaseException] | None, exc: BaseException | None, tb: types.TracebackType | None) None#
Close the MCP session.
- async BackendClient.call(tool_name: str, arguments: dict[str, Any] | None = None) str#
Call a tool on the lane.
- Parameters:
- Returns:
strText payload of the result.
- Raises:
BackendAuthErrorIf the lane rejected the token.
RuntimeErrorIf the client is not open or the call fails.