-
Notifications
You must be signed in to change notification settings - Fork 325
Upgrade MCP SDK to v1.25.1 #752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: c897ff1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 Code ReviewSummary: MCP SDK upgrade from v1.23.0 to v1.25.2 with enhanced error handling and event store resumability support. Critical IssueRace condition in SSE stream setup (worker-transport.ts:343-383): Fix: Move the priming event write and replay logic before adding the stream to Issues
Minor
TestingGood coverage added:
Tests pass validation of the error code extraction logic and CORS handling. |
59fe808 to
48087db
Compare
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 <[email protected]>
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
commit: |
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 <[email protected]>
- Document new WorkerTransport features: eventStore, onsessionclosed, retryInterval - Highlight new mcp-server example with stateless guide - Explain improved error handling and migration notes Related to cloudflare/agents#752 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Upgrade MCP SDK from 1.25.1 to 1.25.2 - Import EventStore, StreamId, EventId types from SDK instead of local definitions - Regenerate package-lock.json
- Upgrade MCP SDK from 1.23.0 to 1.25.2 - Use caret range for automatic patch updates
This updates the documentation to reflect changes from PR #752 which upgraded the MCP SDK from v1.23.0 to v1.25.2. Key documentation changes: - Add new WorkerTransport options: onsessionclosed, eventStore, retryInterval - Document the closeSSEStream() method for polling behavior - Add example showing how to use WebStandardStreamableHTTPServerTransport directly - Update transport.mdx to present two approaches: Agents SDK vs MCP SDK directly - Link to new mcp-server example on GitHub These changes help developers understand the new transport features including session lifecycle callbacks, event resumability, and direct MCP SDK usage without the Agents SDK. Related PR: cloudflare/agents#752 Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
deathbyknowledge
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very positive changes :D
|
|
||
| This example demonstrates how to use `createMcpHandler` to create an unauthenticated stateless MCP server. | ||
|
|
||
| This is THE simplest way to get started with MCP on Cloudflare. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dethroned. Maybe worth a mention here that this is now supported directly in the mcp library and a link to the new example?
Just a nit, don't have to do this now
No description provided.