Skip to main content
FastAPI-MCP supports two MCP transport methods for client-server communication: HTTP transport (recommended) and SSE transport (backwards compatibility). HTTP transport is the recommended transport method as it implements the latest MCP Streamable HTTP specification. It provides better session management, more robust connection handling, and aligns with standard HTTP practices.

Using HTTP Transport

SSE Transport (Backwards Compatibility)

SSE (Server-Sent Events) transport is maintained for backwards compatibility with older MCP implementations.

Using SSE Transport

Advanced Configuration

Both transport methods support the same FastAPI integration features like custom routing and authentication:

Client Connection Examples

HTTP Transport Client Connection

For HTTP transport, MCP clients connect directly to the HTTP endpoint:

SSE Transport Client Connection

For SSE transport, MCP clients use the same URL but communicate via Server-Sent Events: