Skip to content

mcp: infer URL mode and reject incomplete input in URLElicitationRequiredError - #1501

Closed
QuentinBisson wants to merge 1 commit into
modelcontextprotocol:mainfrom
QuentinBisson:fix/url-elicitation-required-error-inference
Closed

QuentinBisson wants to merge 1 commit into
modelcontextprotocol:mainfrom
QuentinBisson:fix/url-elicitation-required-error-inference

Conversation

@QuentinBisson

Copy link
Copy Markdown
Contributor

URLElicitationRequiredError panicked on an empty mode that ServerSession.Elicit infers as "url", and accepted elicitations without a URL or elicitation ID, so a server could build a -32042 that ParseURLElicitationRequiredError rejects. It now infers the mode like Elicit and marshals the inferred copies. An empty list, a nil elicitation, or a missing URL or elicitation ID returns a plain error instead of a panic, since those values are usually computed at runtime and a handler panic is not recovered. An explicit non-URL mode still panics.

Fixes #1500

AI assistance: used to draft the code, tests and this description; I reviewed every line.

…iredError

URLElicitationRequiredError panicked on an empty mode that Elicit infers
as "url", and accepted elicitations without a URL or elicitation ID,
building a -32042 that ParseURLElicitationRequiredError rejects. It now
infers the mode like Elicit and returns a plain error for an empty list,
a nil elicitation, or a missing URL or elicitation ID.

Fixes modelcontextprotocol#1500
@github-actions github-actions Bot added the missing-issue-link Auto-closed: PR needs a linked issue assigned to its author (see CONTRIBUTING.md) label Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

This PR has been closed automatically. It's still a draft, but we close those early so you don't put in more time only to have it closed the moment you mark it ready.

This repo only keeps pull requests open when they come from a maintainer, or from a contributor a maintainer has assigned to the linked issue, and you aren't currently assigned to #1500.

You're welcome to keep pushing commits here (just avoid force-pushing, since GitHub can't reopen a rewritten branch), but that on its own won't get the PR reviewed or the issue assigned. There's no need to open a new PR either way.

Maintainers: reopen, remove missing-issue-link, or add bypass-issue-check to override.

@github-actions github-actions Bot closed this Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-issue-link Auto-closed: PR needs a linked issue assigned to its author (see CONTRIBUTING.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcp: URLElicitationRequiredError disagrees with Elicit and ParseURLElicitationRequiredError

1 participant