Skip to content

Agents: document MCP client elicitation + url-elicitation changelog#31974

Draft
mattzcarey wants to merge 11 commits into
productionfrom
docs/agents-url-elicitation
Draft

Agents: document MCP client elicitation + url-elicitation changelog#31974
mattzcarey wants to merge 11 commits into
productionfrom
docs/agents-url-elicitation

Conversation

@mattzcarey

@mattzcarey mattzcarey commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Documents MCP client elicitation support in the Agents SDK, finalized in cloudflare/agents#1911 (with #1903 and #1910).

  • client-api.mdx: new Elicitation section — registering handlers with this.mcp.configureElicitationHandlers({ form, url }) in onStart(); handler-driven capability advertisement (connections advertise exactly the configured modes, no handlers means no elicitation capability, explicit client.capabilities.elicitation declarations win and are persisted); hibernation behavior (restored connections advertise the persisted modes and handlers reattach when onStart() runs); why url mode keeps sensitive URLs such as OAuth links out of model context; and the broadcast/@callable pattern for forwarding elicitation requests to a browser UI, linking the runnable mcp-client and mcp-elicitation examples.
  • agent-api.mdx: cross-link from the server-side elicitation note to the client-side handler guidance.
  • Changelog: 2026-07-09-url-elicitation.mdx — "URL elicitations are in the Agents SDK": why to use url elicitations, how to register handlers, how to upgrade.

Important

Draft on purpose — do not merge yet. The documented API is in cloudflare/agents main but not yet released (pending Version Packages). Merging would publish a changelog for an unreleased feature. Before marking ready: confirm the Agents SDK release containing #1911 has shipped, and update the changelog entry's filename/date to the publish date.

Documentation checklist

…elog

- New Elicitation section in the McpClient API docs: onElicitRequest,
  handler-driven capability advertisement (form+url with an override,
  form-only without), explicit capability narrowing, and the
  broadcast/respond pattern for forwarding elicitation to a UI
- Cross-link from the server-side elicitInput docs
- Changelog: URL elicitations are in the Agents SDK
@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review

⚠️ 1 warning, 💡 2 suggestions found in commit 5375f19.

Fix in your agent
Fix the following review findings in PR #31974 (https://github.com/cloudflare/cloudflare-docs/pull/31974).

Before making changes, review each finding and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g. the fix requires disproportionate effort for minimal benefit,
  or the finding is factually incorrect), explain why
- If you need clarification before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order

After triaging, fix all legitimate findings. For any you decide to skip,
post a comment on this PR with the finding ID and your reasoning.

---

## Code Review

### Suggestions (1)

#### CR-fb0f7b385b05 · Misleading code example comment
- **File:** `src/content/changelog/agents/2026-07-09-url-elicitation.mdx` line 39
- **Issue:** The form-mode comment in the TypeScript example says "collect the fields described by requestedSchema", but the next line returns `{ action: "decline", content: {} }` instead of collecting anything. A developer copying the snippet may be confused about why the return value does not match the comment.
- **Fix:** Update the comment to explain that the example declines form-mode requests, matching the fuller comment in `src/content/docs/agents/model-context-protocol/apis/client-api.mdx` ("Form mode: collect the fields described by requestedSchema, or decline if your surface cannot prompt the user").

---

## Style Guide Review

### Warnings (1)

#### SG-03b8011f3d5e · Internal links must have a trailing slash
- **File:** `src/content/docs/agents/model-context-protocol/apis/client-api.mdx` line 437
- **Issue:** Internal link `](/agents/model-context-protocol/apis/agent-api/#elicitinputoptions-context)` omits the trailing slash before the anchor.
- **Fix:** Change the link to `](/agents/model-context-protocol/apis/agent-api/#elicitinputoptions-context)`.

### Suggestions (1)

#### SG-33c9b1a171c0 · Passive voice
- **File:** `src/content/changelog/agents/2026-07-09-url-elicitation.mdx` line 49
- **Issue:** Line uses passive constructions: `is now honored` and `is persisted`.
- **Fix:** Rewrite in active voice, e.g., `addMcpServer now honors an explicitly declared ...`.

Code Review

This code review is in beta and may not always be helpful — use your judgment.

Suggestions (1)
File Issue
changelog/agents/2026-07-09-url-elicitation.mdx line 39 Misleading code example comment — The form-mode comment in the TypeScript example says "collect the fields described by requestedSchema", but the next line returns { action: "decline", content: {} } instead of collecting anything. A developer copying the snippet may be confused about why the return value does not match the comment. Fix: Update the comment to explain that the example declines form-mode requests, matching the fuller comment in src/content/docs/agents/model-context-protocol/apis/client-api.mdx ("Form mode: collect the fields described by requestedSchema, or decline if your surface cannot prompt the user").

Conventions

No convention issues found.

Style Guide Review

Warnings (1)
File Issue
agents/model-context-protocol/apis/client-api.mdx line 437 Internal links must have a trailing slash — Internal link ](/agents/model-context-protocol/apis/agent-api/#elicitinputoptions-context) omits the trailing slash before the anchor. Fix: Change the link to ](/agents/model-context-protocol/apis/agent-api/#elicitinputoptions-context).
Suggestions (1)
File Issue
changelog/agents/2026-07-09-url-elicitation.mdx line 49 Passive voice — Line uses passive constructions: is now honored and is persisted. Fix: Rewrite in active voice, e.g., addMcpServer now honors an explicitly declared ....
Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.
/ignore-review-limit Permanently lifts the 2-review automatic limit for this PR. Future pushes will trigger reviews as normal.
/disable-auto-review Stops automatic reviews from triggering on future pushes to this PR. Codeowners can still run /review or /full-review manually.

@github-actions github-actions Bot added product:changelog product:agents Build and deploy AI-powered Agents on Cloudflare that can act autonomously. size/m labels Jul 9, 2026
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/changelog/ @cloudflare/pm-changelogs, @cloudflare/product-owners
/src/content/docs/agents/ @irvinebroque, @rita3ko, @elithrar, @thomasgauvin, @threepointone, @whoiskatrin, @cloudflare/product-owners, @cloudflare/ai-agents, @cloudflare/dev-plat-leads

@mattzcarey mattzcarey marked this pull request as draft July 9, 2026 17:02

@irvinebroque irvinebroque 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.

How about taking the mermaid diagram from here and using to convey this flow in changelog?

Image

https://modelcontextprotocol.io/specification/draft/client/elicitation

Stamp so you have it, see comments

@@ -0,0 +1,63 @@
---
title: URL elicitations are in the Agents SDK

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.

Suggested change
title: URL elicitations are in the Agents SDK
title: Respond to elicitation requests from MCP servers, using the Agents SDK

Suggest something in title that says MCP? And tries to convey what you can now do?


</TypeScriptExample>

The advertised modes are persisted with each MCP server, so connections restored after Durable Object hibernation advertise the same modes and the handlers reattach when `onStart()` runs. Agents without configured handlers advertise no elicitation capability, so servers use their non-elicitation fallbacks instead of sending requests the agent cannot answer.

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.

Suggested change
The advertised modes are persisted with each MCP server, so connections restored after Durable Object hibernation advertise the same modes and the handlers reattach when `onStart()` runs. Agents without configured handlers advertise no elicitation capability, so servers use their non-elicitation fallbacks instead of sending requests the agent cannot answer.
The Agents SDK automatically persists the modes that each MCP server advertises, so connections restored after Durable Object hibernation advertise the same modes and the handlers reattach when `onStart()` runs. Agents without configured handlers advertise no elicitation capability, so servers use their non-elicitation fallbacks instead of sending requests the agent cannot answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:agents Build and deploy AI-powered Agents on Cloudflare that can act autonomously. product:changelog size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants