Understand the different ways FlashMCP Clients can connect to servers.
New in version: 2.0.0
The FlashMCP Client
relies on a ClientTransport
object to handle the specifics of connecting to and communicating with an MCP server. FlashMCP provides several built-in transport implementations for common connection methods.
While the Client
often infers the correct transport automatically (see Client Overview), you can also instantiate transports explicitly for more control.
async with client:
), a new connection or process starts. For best performance, keep client contexts open while performing multiple operations rather than repeatedly opening and closing them.StreamableHttpTransport
(recommended, default for HTTP URLs) or SSETransport
(legacy option) for web-based deployments.
FlashMCPTransport
for in-memory, same-process testing of your FlashMCP servers.
UvxStdioTransport
(Python/uv) or NpxStdioTransport
(Node/npm) if you need to run MCP servers as packaged tools.
New in version: 2.3.0
Streamable HTTP is the recommended transport for web-based deployments, providing efficient bidirectional communication over HTTP.
FlashMCP.client.transports.StreamableHttpTransport
http://
or https://
(default for HTTP URLs since v2.3.0) that do not contain /sse/
in the pathstreamable-http
modeNew in version: 2.0.0
Server-Sent Events (SSE) is a transport that allows servers to push data to clients over HTTP connections. While still supported, Streamable HTTP is now the recommended transport for new web-based deployments.
FlashMCP.client.transports.SSETransport
/sse/
in the pathsse
mode/sse/
in the path:
/sse/
in the path or for more control:
streamable-http
modesse
modeFlashMCP.client.transports.PythonStdioTransport
.py
filesmcp.run()
or FlashMCP.server.run()
. The Client only launches the script; it doesn’t inject the server logic.FlashMCP.client.transports.NodeStdioTransport
.js
filesFlashMCP.client.transports.UvxStdioTransport
uvx
FlashMCP.client.transports.NpxStdioTransport
npx
UvxStdioTransport
, but for the Node.js ecosystem.
FlashMCP.client.transports.FlashMCPTransport
FlashMCP.server.FlashMCP
FlashMCP
server instance in the same Python processNew in version: 2.3.6
FlashMCP.client.transports.MCPConfigTransport
MCPConfig
or a dictionary matching the MCPConfig schema