Skip to content

Conversation

@mattzcarey
Copy link
Contributor

These aren't needed since summer time when the mode param was supported by workerd.

@changeset-bot
Copy link

changeset-bot bot commented Nov 5, 2025

🦋 Changeset detected

Latest commit: 9027d6b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
agents Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@claude
Copy link

claude bot commented Nov 5, 2025

Claude Code Review

Critical Issue: Lost Edge Runtime Functionality

The old SSEEdgeClientTransport and StreamableHTTPEdgeClientTransport classes provided Cloudflare Workers-specific fetch overrides that:

  1. Removed mode property (unsupported in Workers)
  2. Handled OAuth auth headers via authProvider
  3. Merged custom requestInit/eventSourceInit options

The new implementation in client-transports.ts (lines 15-42) only extends the base SDK classes without any customization. This means:

Lost functionality:

  • OAuth authorization headers are no longer added automatically
  • Worker-incompatible properties (mode) are not stripped
  • Custom fetch initialization is not applied

Impact: This will break existing MCP connections in Cloudflare Workers that rely on:

  • OAuth authentication
  • Custom fetch configuration
  • Edge-specific request handling

Recommendation:
Either:

  1. Verify the MCP SDK now handles all these cases natively (per PR description "supported by workerd"), OR
  2. Restore the custom logic in the deprecated wrapper classes

The changeset mentions "deprecation warnings to update imports" but the wrappers have lost critical functionality, not just changed import paths.


Minor: Deprecation warnings use console.warn - consider using a proper logging abstraction if available.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 5, 2025

Open in StackBlitz

npm i https://pkg.pr.new/cloudflare/agents@637

commit: 9027d6b

threepointone pushed a commit to cloudflare/cloudflare-docs that referenced this pull request Nov 5, 2025
…ClientTransport

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 <noreply@anthropic.com>
Copy link
Contributor

@threepointone threepointone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh thank god yes

@threepointone
Copy link
Contributor

Documentation Updated

I've created a documentation PR to document the deprecation of the client edge transport classes:

Docs PR: cloudflare/cloudflare-docs#26328

Changes Made

Added a new section to the Transport documentation that:

  1. Deprecation Notice: Clearly indicates that SSEEdgeClientTransport and StreamableHTTPEdgeClientTransport are deprecated
  2. Migration Guide: Provides before/after code examples showing users how to update their imports from agents/mcp to the official MCP SDK imports (@modelcontextprotocol/sdk/client/sse.js and @modelcontextprotocol/sdk/client/streamableHttp.js)
  3. Context: Explains that the official SDK now supports Cloudflare Workers natively since summer 2024, eliminating the need for custom edge transport wrappers

Target Audience

This documentation targets the small subset of advanced users who were directly importing and using these transport classes in custom MCP client implementations. Most users rely on the automatic transport handling provided by McpAgent and addMcpServer() and won't be affected by this change.


Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

threepointone pushed a commit to cloudflare/cloudflare-docs that referenced this pull request Nov 5, 2025
Document the deprecation of SSEEdgeClientTransport and
StreamableHTTPEdgeClientTransport in favor of standard MCP SDK transports.

Since workerd now supports the duplex parameter, the custom edge transports
are no longer necessary. Users should migrate to SSEClientTransport and
StreamableHTTPClientTransport from @modelcontextprotocol/sdk.

Related to cloudflare/agents#637
@threepointone
Copy link
Contributor

Documentation Sync Complete

Documentation has been updated in cloudflare-docs PR #26328 to reflect the deprecation of the custom edge transport classes.

Changes Made

Changelog Entry: Created comprehensive migration guide at src/content/changelog/agents/2025-11-05-mcp-transport-deprecation.mdx including:

  • Explanation of what changed and why (workerd now supports the duplex parameter)
  • Clear before/after code examples for migrating from SSEEdgeClientTransport and StreamableHTTPEdgeClientTransport to standard MCP SDK transports
  • Information that users of the high-level Agent.addMcpServer() API require no changes
  • Deprecation timeline (warnings now, removal in next major version)
  • Links to relevant documentation and support resources

Transport Documentation: Updated transport.mdx with deprecation notice directing users to use the official @modelcontextprotocol/sdk transport classes instead of the deprecated edge wrappers.

Review the Documentation PR

Please review cloudflare-docs PR #26328 to ensure the migration guidance is accurate and complete before merging.


This documentation sync was performed automatically by Claude Code

// Call the original fetch with fixed options
return (
// @ts-expect-error Custom fetch function for Cloudflare Workers compatibility
(options.requestInit?.fetch?.(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was also broken since thats the wrong level to get custom fetch from

@mattzcarey mattzcarey merged commit 1e3b8c9 into main Nov 5, 2025
8 of 9 checks passed
@mattzcarey mattzcarey deleted the chore-remove-client-transports branch November 5, 2025 19:45
@threepointone threepointone mentioned this pull request Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants