Skip to content

Commit 90a455e

Browse files
Document deprecation of SSEEdgeClientTransport and StreamableHTTPEdgeClientTransport
Added migration guide for users who were using the deprecated transport classes directly. These classes have been replaced by the official MCP SDK transport classes which now work natively with Cloudflare Workers. Changes: - Add deprecation notice for SSEEdgeClientTransport and StreamableHTTPEdgeClientTransport - Provide before/after code examples showing import path migration - Explain that the official SDK classes now support Workers natively Related to cloudflare/agents#637 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
1 parent 7a85c1b commit 90a455e

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

src/content/docs/agents/model-context-protocol/transport.mdx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,38 @@ With these few changes, your MCP server will support both transport methods, mak
109109
While most MCP clients have not yet adopted the new Streamable HTTP transport, you can start testing it today using [`mcp-remote`](https://www.npmjs.com/package/mcp-remote), an adapter that lets MCP clients that otherwise only support local connections work with remote MCP servers.
110110
111111
Follow [this guide](/agents/guides/test-remote-mcp-server/) for instructions on how to connect to your remote MCP server from Claude Desktop, Cursor, Windsurf, and other local MCP clients, using the [`mcp-remote` local proxy](https://www.npmjs.com/package/mcp-remote).
112+
113+
## Advanced: Using transport classes directly
114+
115+
:::note[Deprecated transport classes]
116+
The `SSEEdgeClientTransport` and `StreamableHTTPEdgeClientTransport` classes previously exported from the Agents SDK have been deprecated. If you were using these classes directly, update your imports to use the transport classes from the MCP TypeScript SDK instead.
117+
:::
118+
119+
In most cases, you don't need to work with transport classes directly — the `McpAgent` class and the [`addMcpServer()` method](/agents/model-context-protocol/mcp-client-api#addmcpserver) handle transport configuration automatically.
120+
121+
However, if you're building custom MCP client connections outside of the standard Agent patterns, you should use the transport classes from the official MCP TypeScript SDK:
122+
123+
<Tabs syncKey="transportExamples">
124+
<TabItem label="Before (deprecated)" icon="seti:javascript">
125+
126+
```ts
127+
// Deprecated - these classes will be removed in the next major version
128+
import {
129+
SSEEdgeClientTransport,
130+
StreamableHTTPEdgeClientTransport
131+
} from "agents/mcp";
132+
```
133+
134+
</TabItem>
135+
<TabItem label="After (recommended)" icon="seti:typescript">
136+
137+
```ts
138+
// Use the official MCP SDK transport classes instead
139+
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
140+
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
141+
```
142+
143+
</TabItem>
144+
</Tabs>
145+
146+
The official SDK transport classes have been updated to work natively with Cloudflare Workers since summer 2024, eliminating the need for the custom edge transport wrappers. The behavior and API are identical — only the import path changes.

0 commit comments

Comments
 (0)