feat: enums connection state and standardise tool discovery#672
feat: enums connection state and standardise tool discovery#672whoiskatrin merged 22 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: d6c1796 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 |
commit: |
Claude Code ReviewIssues Found:
Testing: Comprehensive test coverage for the connection lifecycle, OAuth flows, discovery timeout/cancellation, and edge cases. Good focus on state machine transitions. The PR successfully addresses the discovery hanging issue and crash-looping DO problem. The separation of init/discover is architecturally sound. |
Synchronizes documentation with cloudflare/agents PR #672 which introduces enum-based connection state management. Changes: - Document new MCPConnectionState enum export with usage examples - Update getMcpServers() return type to use MCPConnectionState enum - Add examples showing type-safe state checking with enum constants - Document fail-fast behavior during capability discovery Related PR: cloudflare/agents#672 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This documentation sync corresponds to PR #672 in cloudflare/agents: cloudflare/agents#672 Changes: - Document new MCPConnectionState enum for type-safe connection states - Update all code examples to use enum constants instead of string literals - Add migration guide for transitioning from string literals - Document improved error handling with fail-fast behavior - Create changelog entry for the release - Update OAuth flow documentation with enum usage The MCPConnectionState enum provides better type safety when working with MCP server connection states (AUTHENTICATING, CONNECTING, DISCOVERING, READY, FAILED). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
needs changeset. |
Updates documentation for PR #672 (feat: enums connection state) ## Changes - Added new "connected" state to MCPConnectionState enum - Documented new discoverIfConnected() method for manual capability discovery - Updated connection state machine documentation with detailed descriptions - Added note about discovery failures now throwing errors immediately - Updated getMcpServers() return type to include "connected" state ## API Changes - New connection state "connected" for servers with transport connected but capabilities not yet discovered - New method discoverIfConnected(serverId) for refreshing server capabilities - Discovery failures now throw errors immediately instead of continuing with empty arrays Related PR: cloudflare/agents#672 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Adds comprehensive documentation for MCP connection state improvements: - Add changelog entry for MCP connection state improvements - Enhance connection state descriptions with better explanations - Add version note about new 'connected' state (v0.0.24) - Document fail-fast error handling behavior Builds on existing discoverIfConnected() documentation already in the branch. Related PR: cloudflare/agents#672
threepointone
left a comment
There was a problem hiding this comment.
bit confusing to follow, but stamping to unblock
Synced from cloudflare/agents PR #672 - Document new MCPConnectionState enum with type-safe constants - Add new 'connected' state to connection state machine - Update state transition documentation - Document improved discovery error handling - Add changelog entry for breaking changes and new features Related PR: cloudflare/agents#672 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This sync updates the documentation to reflect changes from cloudflare/agents PR #672: - Documented new connection state machine with separate CONNECTED and READY states - ClientConnection.init() no longer automatically discovers capabilities - Added MCPConnectionState enum documentation with all possible states - Documented new CONNECTED state for transport connection without capabilities - Added detailed state transition flows for OAuth and non-OAuth connections - Updated error handling section to reflect fail-fast behavior with Promise.all - Added explanations for each connection state - Clarified the difference between CONNECTED and READY states Related PR: cloudflare/agents#672 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Updates documentation for PR cloudflare/agents#672 ## Changes - Updated addMcpServer() return type to discriminated union - Added MCPConnectionState enum documentation - Documented new "connected" state in connection lifecycle - Added connection state transition diagrams - Documented new discovery behavior with timeout and cancellation - Created comprehensive changelog with migration guide ## Breaking Changes - MCPClientConnection.init() no longer auto-discovers capabilities - addMcpServer() return type changed to discriminated union - New "connected" state added to connection lifecycle 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
also fail fast with promise.all
Deployed to: https://workers-ai-playground.mattzcarey.workers.dev/