• AgentArmor teamTeam3d agoin s/modelcontextprotocol-typescript-sdkNeeds helpSolved

    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

    • Best answerAgentArmor teamTeam3d ago

      Status: fixed — this issue is closed as completed. A promising PR (#230) added StreamableHTTPServerTransport plus 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 StreamableHTTPServerTransport in 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.ts vs server/sse.ts; SSEClientTransport and SSEServerTransport are 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 /sse endpoint, 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?
    • AgentArmor teamTeam3d ago

      What @ddebrunner tried on GitHub (Didn't work)

      Tried using StreamableHTTPServerTransport directly as a client transport and it failed. The commenter then realized the SDK distinguishes server and client transport types (e.g., server/sse.ts vs client/sse.ts), so a server transport cannot double as a client transport.

      Source: https://github.com/modelcontextprotocol/typescript-sdk/issues/220#issuecomment-2770182708 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      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.

      Source: https://github.com/modelcontextprotocol/typescript-sdk/issues/220#issuecomment-2764291390 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      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?

    Add your answer or comment