-
Notifications
You must be signed in to change notification settings - Fork 289
feat: elicit-me example #620
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
|
commit: |
Claude Code ReviewPR Summary: Adds MCP elicitation support with persistent transport state, comprehensive tests, and refactored example. Issues Found1. Type mismatch in elicitation example (examples/mcp-elicitation/src/index.ts:49)The example uses server.registerTool() but mixes Zod with JSON Schema incorrectly. The inputSchema expects a JSON Schema object, not Zod. Line 54 has: Should be JSON Schema: 2. Incorrect schema property (examples/mcp-elicitation/src/index.ts:73)minLength: 1 is for strings, not numbers. Should be minimum: 1 or removed. 3. Race condition potential (packages/agents/src/mcp/worker-transport.ts:522-523)saveState() called immediately after sync initialization. If restoreState() async call has not completed, could cause state conflicts. 4. Potential memory leak (packages/agents/src/mcp/worker-transport.ts:332)keepAlive interval might not clear if client aborts before cleanup. Try-catch helps but does not guarantee clearing. 5. Error loses context (examples/mcp-elicitation/src/index.ts:108)console.log(error) followed by generic message loses debugging info. Testing CoverageExcellent: 690 lines covering CORS, protocol versions, sessions, storage, errors ArchitectureClean separation: handler routes, transport manages protocol. Storage abstraction enables persistence. RecommendationFix type/schema issues (1-2) before merge. Issues 3-5 are edge cases worth noting. |
This commit syncs documentation changes from cloudflare/agents PR #620. Changes: - Add new elicitation.mdx documentation covering MCP elicitation feature - Update transport.mdx with storage and authContext configuration options - Update authorization.mdx to reflect new API where auth is accessed via extra.authInfo Related PR: cloudflare/agents#620
|
📚 Documentation sync PR created: cloudflare/cloudflare-docs#26453 |
threepointone
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.
stamping, but with notes on storage usage
|
think you need to run npm i and update package lock to pass CI |
📚 Documentation Sync CompleteDocumentation has been updated in the cloudflare-docs repository to reflect the changes in this PR. Documentation PRcloudflare-docs PR: cloudflare/cloudflare-docs#26453 Changes DocumentedThis PR introduces several new MCP handler configuration options for advanced use cases: New API Options
Documentation Added
The documentation follows the Diátaxis framework with clear separation between reference documentation (new API page) and how-to guides (existing transport page). 🤖 This comment was automatically generated by the documentation sync workflow |
- Add persistent transport state documentation to transport.mdx - Add new guide for MCP elicitation support - Update chatgpt-app.mdx with clarifying comment Synced from: cloudflare/agents#620
|
📚 Documentation Sync A documentation PR has been created/updated in cloudflare-docs to sync these changes: PR: cloudflare/cloudflare-docs#26453 Documentation changes:
The docs PR is ready for review and covers:
|
Documentation Sync CompleteDocumentation for this PR has been synced to cloudflare-docs. What was documentedNew API Features:
Cross-references:
Examples:
Documentation PRcloudflare/cloudflare-docs#26453 🤖 Generated with Claude Code |
Documentation SyncA documentation sync PR has been created in cloudflare-docs to reflect the changes in this PR. Documentation PR: cloudflare/cloudflare-docs#26453 Changes synced:
Once this PR is merged, please review and merge the documentation PR. |
Synced from cloudflare/agents#620 Changes: - Add comprehensive elicitation documentation with examples - Document new WorkerTransport storage API for session persistence - Update transport docs with MCPStorageApi and TransportState interfaces - Simplify MCP elicitation example (removed complex UI demo) Related PR: cloudflare/agents#620
📚 Documentation Sync CompleteThe documentation for this PR has been synced to cloudflare/cloudflare-docs. Documentation PR🔗 cloudflare/cloudflare-docs#26453 What was documentedNew Documentation
API Reference Updates
Updated Content
Files Changed in Docs Repo
Review the DocumentationView the full documentation changes in the PR above. The docs PR includes:
This comment was automatically generated by the documentation sync workflow. |
- Add comprehensive guide for MCP elicitation (user input) - Document new createMcpHandler options (storage, authContext, transport) - Add examples for state persistence and custom transport configuration - Cover elicitation schema types and response handling Related to cloudflare/agents#620
📚 Documentation synced to cloudflare-docsDocumentation has been synced to: cloudflare/cloudflare-docs#26453 Documentation Added/Updated:
The documentation covers:
|
- Add comprehensive elicitation guide with examples - Document createMcpHandler configuration options - Add storage persistence documentation for transport state - Include code examples for all new features Related to cloudflare/agents#620
📚 Documentation SyncDocumentation has been updated to reflect the changes in this PR. Documentation PR: cloudflare/cloudflare-docs#26453 Changes included:
The documentation covers:
|
Things to think about with this pattern:
AuthContext
This is really annoying because the types we get from
propsare not the same as the auth types in theextraparam in tools etc. At the moment you can access them withasyncLocalStorageStorage
The storage interface is pretty extensible. It would be cool to have patterns with kv or even cookies and no DO at all. This would tee us up very well for the stateless by default SEP coming soon to MCP.