Skip to content

mcp: reject standalone elicitation and sampling on 2026-07-28 - #1554

Closed
luiacuaniello wants to merge 1 commit into
modelcontextprotocol:mainfrom
luiacuaniello:fix-client-reject-standalone-elicit-sampling
Closed

luiacuaniello wants to merge 1 commit into
modelcontextprotocol:mainfrom
luiacuaniello:fix-client-reject-standalone-elicit-sampling

Conversation

@luiacuaniello

Copy link
Copy Markdown
Contributor

Fixes #1552.

Same treatment as ping and roots/list in #1537 and #1540: on 2026-07-28 the client now answers a standalone elicitation/create or sampling/createMessage with -32601 instead of calling the handler. MRTR input requests go through fulfillInputRequest, not handle, so they still work, and older protocol versions are unchanged. I also added a line to the sampling and elicitation sections of the client docs, like the one for roots/list.

TestClientRejectsStandaloneElicitationAndSamplingOnNewProtocol is based on the roots/list test and fails without the change.

go test ./..., -race on mcp and auth, vet, staticcheck v0.8.2 and the conformance suites pass, with the same conformance numbers as main.

Found and written with help from Claude Code.

On protocol version 2026-07-28, servers send elicitation and sampling
requests only as multi round-trip input requests. The client already
rejects a standalone ping or roots/list from a non-conforming server
with MethodNotFound (modelcontextprotocol#1537, modelcontextprotocol#1540), but it still ran ElicitationHandler
and CreateMessageHandler for a standalone elicitation/create or
sampling/createMessage.

Reject those two the same way. Multi round-trip input requests do not
pass through ClientSession.handle, so they are unaffected.

Fixes modelcontextprotocol#1552
@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 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR has been closed automatically. 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 #1552.

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 27, 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: 2026-07-28 client runs elicitation and sampling handlers for standalone server requests

1 participant