docs/python-sdk/fastmcp-client-transports-memory.mdx
fastmcp.client.transports.memoryFastMCPTransport <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/client/transports/memory.py#L37" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>In-memory transport for FastMCP servers.
This transport connects directly to a FastMCP server instance in the same
Python process. It works with both FastMCP servers and the SDK's own
high-level MCPServer from the low-level MCP SDK. This is particularly
useful for unit tests or scenarios where client and server run in the same
runtime.
Methods:
connect_session <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/client/transports/memory.py#L58" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>connect_session(self, **session_kwargs: Unpack[SessionKwargs]) -> AsyncIterator[ClientSession]