Skip to content

add elicitation support and examples#376

Merged
threepointone merged 15 commits into
cloudflare:mainfrom
whoiskatrin:add-elicitation-support
Jul 30, 2025
Merged

add elicitation support and examples#376
threepointone merged 15 commits into
cloudflare:mainfrom
whoiskatrin:add-elicitation-support

Conversation

@whoiskatrin

Copy link
Copy Markdown
Contributor

Added elicitation support so MCP servers can ask users for input during tool execution. Pretty useful for confirmations, forms, and multi-step workflows.

Tested in VS Code
Screenshot 2025-07-22 at 15 00 10

@changeset-bot

changeset-bot Bot commented Jul 22, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 32c7e3b

The changes in this PR will be included in the next version bump.

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

@whoiskatrin
whoiskatrin marked this pull request as draft July 22, 2025 16:04
@whoiskatrin
whoiskatrin marked this pull request as ready for review July 23, 2025 16:23
@whoiskatrin

Copy link
Copy Markdown
Contributor Author

@whoiskatrin
whoiskatrin force-pushed the add-elicitation-support branch from 732ce1a to fa9a031 Compare July 23, 2025 17:11

@threepointone threepointone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll dig into the example later today, but this is looking good. can you clarify my question? I'm not sure what the behaviour is

Comment thread packages/agents/src/mcp/index.ts Outdated
Comment thread packages/agents/src/mcp/index.ts Outdated
private _requestIdToConnectionId: Map<string | number, string> = new Map();

// Event-based elicitation handling
private _elicitationHandlers = new Map<

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't this map instance disappear if the agent hibernates? or is that not a problem?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

valid, didn't think about that, used durable storage instead to fix this

@threepointone

Copy link
Copy Markdown
Contributor

excellent PR, thank you very much! I think this should give us confidence to flesh out all the missing mcp features

@threepointone

Copy link
Copy Markdown
Contributor

lemme fix a couple of lint warnings and land this myself

@threepointone
threepointone merged commit 1eac06e into cloudflare:main Jul 30, 2025
1 check passed
@threepointone threepointone mentioned this pull request Jul 30, 2025
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.

3 participants