Something went wrong. Try again.
mirror of github.com/PrefectHQ/fastmcp
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829---title: memorysidebarTitle: memory---
# `fastmcp.client.transports.memory`
## Classes
### `FastMCPTransport` <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 samePython process. It works with both FastMCP servers and the SDK's ownhigh-level `MCPServer` from the low-level MCP SDK. This is particularlyuseful for unit tests or scenarios where client and server run in the sameruntime.
**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>
```pythonconnect_session(self, **session_kwargs: Unpack[SessionKwargs]) -> AsyncIterator[ClientSession]```