MCP TypeScript SDK: how do I use Streamable HTTP transport on the client side?
I'm using the modelcontextprotocol/typescript-sdk (issue opened 2025-03-25) and need to talk to an MCP server that implements the new Streamable HTTP transport from spec PR modelcontextprotocol/specification#206. I tried instantiating StreamableHTTPServerTransport in client code and it failed. Is there a client-side streamable HTTP transport available, and what is the current support status in the SDK?
Originally asked on GitHub: https://github.com/modelcontextprotocol/typescript-sdk/issues/220
4 answers
Status: fixed — this issue is closed as completed. A promising PR (#230) added
StreamableHTTPServerTransportplus unit tests for the server side, and a separate PR for the client-side transport was agreed to be the right follow-up.The key finding from the thread: you cannot use
StreamableHTTPServerTransportin client code. A commenter tried exactly that and it failed, because the SDK follows the same pattern as SSE: client and server transports are distinct types (e.g.,client/sse.tsvsserver/sse.ts;SSEClientTransportandSSEServerTransportare different types). A maintainer confirmed this: "Yep, you are right. You need both, but I'm not sure that they have to both come in the same PR if the server transport is unit tested and seems viable, another PR could be opened for the client transport." A contributor then said they would add a client transport once the server transport was working well.What the new Streamable HTTP transport entails (from spec PR modelcontextprotocol/specification#206): removing the
/sseendpoint, routing all client-to-server messages through/message, supporting server-upgraded SSE for notifications and requests, implementing session IDs for state management, and letting clients initiate an SSE stream with an empty GET to/message. The related spec issue modelcontextprotocol/specification#205 was also flagged as relevant. The maintainer additionally noted the Inspector needs upgrading and the servers project needs at least one example.General advice: if you are building a server, use
StreamableHTTPServerTransport. If you are building a client, you need the separate client transport — check the SDK release notes for the version that shipped both, since no version number appears in this thread.Did this work for you?What @ddebrunner tried on GitHub (Didn't work)
Tried using
StreamableHTTPServerTransportdirectly as a client transport and it failed. The commenter then realized the SDK distinguishes server and client transport types (e.g.,server/sse.tsvsclient/sse.ts), so a server transport cannot double as a client transport.Did this work for you?What @QuantGeekDev tried on GitHub (Outcome unclear)
A commenter said they had already added Streamable HTTP support to mcp-framework (a separate MCP framework) and offered to contribute the same to the TypeScript SDK; no confirmation in this thread that this work landed in the SDK.
Did this work for you?What a GitHub user tried on GitHub (Outcome unclear)
The reporter considered manually patching the SDK to support the new transport but rejected it as unsustainable; no concrete attempt was made.
Source: https://github.com/modelcontextprotocol/typescript-sdk/issues/220 (opens external site)
Did this work for you?
Related questions
- MCP TypeScript SDK StreamableHttp without sticky sessions in multi-replica deployments?
- MCP stdio server: SyntaxError Unexpected token in deserializeMessage when using console.log
- MCP typescript-sdk: tool inputSchema/outputSchema reject JSON Schema type 'array'?
- Use Zod union/intersection as MCP tool paramsSchema in typescript-sdk?
- MCP Inspector: "Invalid transport type: undefined" when connecting to an SSE server