Version Packages - #1985
Merged
Merged
Conversation
github-actions
Bot
force-pushed
the
changeset-release/main
branch
from
July 27, 2026 17:50
aa831e6 to
5b8c636
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
agents@0.20.0
Minor Changes
#1557
447013dThanks @mattzcarey! - Add MCP SDK v2 client and server support.MCPClientConnectionnow uses the exact-pinned@modelcontextprotocol/client@2.0.0-beta.5. It probes for stateless MCP withserver/discover, then falls back to the legacyinitializehandshake on the same connection when needed. The SDK auto-fulfills stateless elicitationinput_requiredresults through the existing form and URL elicitation handlers whilecallTool,getPrompt, andreadResourceremain pending. OAuth reauthorization discards redirect-scoped discovery after token issuance and preserves discovery-triggered authentication, allowing a changed authorization server to be rediscovered and registered without reusing the prior issuer's credentials. Legacy pushed elicitation, Streamable HTTP, SSE, RPC, OAuth, and hibernation recovery remain supported. Codemode's MCP connector now uses an SDK-neutral structural boundary compatible with both MCP client generations.Add MCP SDK v2 support to
createMcpHandler. Pass a factory returningMcpServerorServerfrom the exact-pinned@modelcontextprotocol/server@2.0.0-beta.5peer dependency to serve stateless MCP with legacy compatibility by default. The newagents/mcp/serverentry exports the stateless Agents handler without retainingMcpAgent,WorkerTransport, MCP client transports, PartyServer, or SDK v1 modules. The returned handler remains callable for Worker dispatch and exposes the lower-level SDKfetch(request, options?)method plus typednotifymethods; upstreamcloseand event-bus internals are not part of the Agents surface. The retained v1 server APIs use the exact-pinned@modelcontextprotocol/sdk@1.29.0peer dependency.The legacy compatibility fallback now uses SDK v2's web-standard transport, including fail-fast handling for unsupported server-to-client requests, active-request teardown, and the same 25-second Cloudflare SSE keepalive previously supplied by
WorkerTransport. It returns405for session-only GET and DELETE requests without constructing an application server.createLegacyMcpHandlerremains an explicit public API for SDK v1 servers and complete WorkerTransport options.The MCP client storage codec now preserves stateless discovery data with resumed HTTP sessions and preserves the binding name and props required to restore RPC servers. Stored HTTP session IDs from older Agents versions have no associated protocol version. The upgraded client discards those IDs and reconnects instead of sending an unsafe resumed request, so in-flight work tied to an old remote session does not resume.
The v2 callable handler maps verified provider-issued metadata from compatible
@cloudflare/workers-oauth-providerreleases to standard MCPAuthInfowhile preservinggetMcpAuthContext().props.The Workers handler rejects malformed, opaque, and non-HTTP browser Origins. Its default allowlist includes localhost-class Origins, the endpoint's
workers.devhostname, and a concretecorsOptions.originhostname. It applies matching Host checks to localhost andworkers.devendpoints. Custom-domain deployments with wildcard CORS can setallowedHostnamesandallowedOriginHostnamesexplicitly, or setallowedOriginHostnames: "*"when trusted upstream middleware already enforces the required Origin policy. Requests without Origin remain valid for non-browser MCP clients. Default CORS preflights allow the statelessMcp-MethodandMcp-Namerequest headers.@cloudflare/codemodeis now an optional peer. Applications that importagents/skillsoragents/browserinstall Codemode explicitly; MCP-only applications no longer install it transitively.Deprecations in this release:
McpAgentis deprecated and feature-frozen as a stateful SDK v1 path. New servers should use an SDK v2 factory withcreateMcpHandlerfromagents/mcp/server.createMcpHandleris deprecated for removal in the next major release. Move the server to an SDK v2 factory. UsecreateLegacyMcpHandleronly to temporarily retain sessionful SDK v1 behavior while migrating.MCPClientManager.callTool(params, resultSchema, options)andwithX402Client(...).callTool(confirm, params, resultSchema, options)are deprecated. UsecallTool(params, options)orcallTool(confirm, params, options)instead.experimental_createMcpHandlerwas already deprecated and remains scheduled for removal in the next major release. Its warning now directs users to an SDK v2 factory first and namescreateLegacyMcpHandleronly as a temporary bridge for sessionful SDK v1 behavior.Patch Changes
6c01c8dThanks @agent-think! - Recycle reusable Browser Run sessions after the platform reports HTTP 410 for an expired session.@cloudflare/codemode@0.5.1
Patch Changes
#1557
447013dThanks @mattzcarey! - Add MCP SDK v2 client and server support.MCPClientConnectionnow uses the exact-pinned@modelcontextprotocol/client@2.0.0-beta.5. It probes for stateless MCP withserver/discover, then falls back to the legacyinitializehandshake on the same connection when needed. The SDK auto-fulfills stateless elicitationinput_requiredresults through the existing form and URL elicitation handlers whilecallTool,getPrompt, andreadResourceremain pending. OAuth reauthorization discards redirect-scoped discovery after token issuance and preserves discovery-triggered authentication, allowing a changed authorization server to be rediscovered and registered without reusing the prior issuer's credentials. Legacy pushed elicitation, Streamable HTTP, SSE, RPC, OAuth, and hibernation recovery remain supported. Codemode's MCP connector now uses an SDK-neutral structural boundary compatible with both MCP client generations.Add MCP SDK v2 support to
createMcpHandler. Pass a factory returningMcpServerorServerfrom the exact-pinned@modelcontextprotocol/server@2.0.0-beta.5peer dependency to serve stateless MCP with legacy compatibility by default. The newagents/mcp/serverentry exports the stateless Agents handler without retainingMcpAgent,WorkerTransport, MCP client transports, PartyServer, or SDK v1 modules. The returned handler remains callable for Worker dispatch and exposes the lower-level SDKfetch(request, options?)method plus typednotifymethods; upstreamcloseand event-bus internals are not part of the Agents surface. The retained v1 server APIs use the exact-pinned@modelcontextprotocol/sdk@1.29.0peer dependency.The legacy compatibility fallback now uses SDK v2's web-standard transport, including fail-fast handling for unsupported server-to-client requests, active-request teardown, and the same 25-second Cloudflare SSE keepalive previously supplied by
WorkerTransport. It returns405for session-only GET and DELETE requests without constructing an application server.createLegacyMcpHandlerremains an explicit public API for SDK v1 servers and complete WorkerTransport options.The MCP client storage codec now preserves stateless discovery data with resumed HTTP sessions and preserves the binding name and props required to restore RPC servers. Stored HTTP session IDs from older Agents versions have no associated protocol version. The upgraded client discards those IDs and reconnects instead of sending an unsafe resumed request, so in-flight work tied to an old remote session does not resume.
The v2 callable handler maps verified provider-issued metadata from compatible
@cloudflare/workers-oauth-providerreleases to standard MCPAuthInfowhile preservinggetMcpAuthContext().props.The Workers handler rejects malformed, opaque, and non-HTTP browser Origins. Its default allowlist includes localhost-class Origins, the endpoint's
workers.devhostname, and a concretecorsOptions.originhostname. It applies matching Host checks to localhost andworkers.devendpoints. Custom-domain deployments with wildcard CORS can setallowedHostnamesandallowedOriginHostnamesexplicitly, or setallowedOriginHostnames: "*"when trusted upstream middleware already enforces the required Origin policy. Requests without Origin remain valid for non-browser MCP clients. Default CORS preflights allow the statelessMcp-MethodandMcp-Namerequest headers.@cloudflare/codemodeis now an optional peer. Applications that importagents/skillsoragents/browserinstall Codemode explicitly; MCP-only applications no longer install it transitively.Deprecations in this release:
McpAgentis deprecated and feature-frozen as a stateful SDK v1 path. New servers should use an SDK v2 factory withcreateMcpHandlerfromagents/mcp/server.createMcpHandleris deprecated for removal in the next major release. Move the server to an SDK v2 factory. UsecreateLegacyMcpHandleronly to temporarily retain sessionful SDK v1 behavior while migrating.MCPClientManager.callTool(params, resultSchema, options)andwithX402Client(...).callTool(confirm, params, resultSchema, options)are deprecated. UsecallTool(params, options)orcallTool(confirm, params, options)instead.experimental_createMcpHandlerwas already deprecated and remains scheduled for removal in the next major release. Its warning now directs users to an SDK v2 factory first and namescreateLegacyMcpHandleronly as a temporary bridge for sessionful SDK v1 behavior.@cloudflare/agent-think@0.0.4
Patch Changes
6c01c8d,447013d]: