Skip to content

Conversation

@mattzcarey
Copy link
Contributor

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Dec 24, 2025

⚠️ No Changeset found

Latest commit: aae1db9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@claude
Copy link

claude bot commented Dec 24, 2025

Claude Code Review

Summary: MCP SDK v1.23.0 → v1.25.1 upgrade with compatibility fixes and new resumability features.

Issues

1. Removed patch file without verification

The patch file patches/@modelcontextprotocol+sdk+1.23.0.patch was deleted. Verify the patch is no longer needed with the new SDK version - review what it fixed and confirm those fixes are either unnecessary or included in v1.25.1.

2. Missing validation in closeSSEStream

packages/agents/src/mcp/worker-transport.ts:773 - The new closeSSEStream method lacks validation:

  • Should check if streamId === standaloneSseStreamId to prevent closing the GET stream
  • No check if transport is started or stream exists before cleanup

3. Error handling edge case

packages/agents/src/mcp/errors.ts:5-15 - getErrorCode doesn't validate code is a safe integer. Could fail with code: NaN or code: Infinity. Consider adding Number.isSafeInteger() check.

4. Example uses deprecated CORS header

examples/mcp-server/src/index.ts:35 - Header mcp-protocol-version should match the SDK constant MCP-Protocol-Version (capitalization matters for case-sensitive headers).

Observations

Positive:

  • Comprehensive test coverage for error utilities (138 lines)
  • Well-documented new options (eventStore, retryInterval, onsessionclosed)
  • Backward-compatible error detection (both code and message)

Note: SDK import changes (isJSONRPCErrorisJSONRPCErrorResponse, etc.) are breaking changes from v1.24.0. The fallback error handling correctly addresses the StreamableHTTPError format change.

agents-git-bot bot pushed a commit to cloudflare/cloudflare-docs that referenced this pull request Dec 24, 2025
This sync updates the documentation to reflect the following changes from
cloudflare/agents PR #752:

## API Changes

### WorkerTransportOptions (mcp-handler-api.mdx)
- Added `onsessionclosed` callback that fires when a session is closed via
  DELETE request
- Added `eventStore` option for SSE resumability support, enabling clients to
  reconnect and resume using Last-Event-ID header
- Added `retryInterval` option to control client reconnection timing for
  polling behavior
- Added `closeSSEStream()` method to WorkerTransport class for implementing
  polling behavior during long-running operations
- Updated `sessionIdGenerator` description to clarify it can return undefined
  for stateless mode

### MCPTransportOptions (mcp-client-api.mdx)
- Added `connectionTimeoutMs` option (default: 15000ms) to prevent infinite
  hangs when connecting to MCP servers. Particularly useful when proxies strip
  SSE newline terminators.

### New Example (transport.mdx)
- Added documentation for the new `mcp-server` example showing how to use
  `WebStandardStreamableHTTPServerTransport` from the MCP SDK directly without
  the agents package. This is the simplest way to create stateless MCP servers
  on Cloudflare Workers.

Related PR: cloudflare/agents#752

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
agents-git-bot bot pushed a commit to cloudflare/cloudflare-docs that referenced this pull request Dec 24, 2025
This commit documents the new stateless MCP server approach introduced in PR #752 (Upgrade MCP SDK to v1.25.1).

Changes:
- Add new stateless-mcp-server.mdx guide demonstrating WebStandardStreamableHTTPServerTransport usage
- Update MCP index page to explain both stateless and McpAgent-based approaches
- Update remote-mcp-server guide to clarify it uses McpAgent and link to stateless option
- Document the simplest way to create MCP servers on Cloudflare Workers

The new example (examples/mcp-server) uses the MCP SDK directly without the agents package, providing a zero-config stateless option that is simpler for basic use cases.

Related PR: cloudflare/agents#752
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 24, 2025

Open in StackBlitz

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

commit: aae1db9

agents-git-bot bot pushed a commit to cloudflare/cloudflare-docs that referenced this pull request Dec 24, 2025
Document the MCP SDK upgrade from v1.23.0 to v1.25.1 with the following updates:

- Add new section on using MCP SDK directly without Agents SDK
- Document the new mcp-server example using WebStandardStreamableHTTPServerTransport
- Add documentation for new WorkerTransport options:
  - onsessionclosed callback for session cleanup
  - eventStore for connection resumability support
  - retryInterval for SSE polling behavior control

Related to cloudflare/agents#752

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

1 participant