Repository navigation
mcp: reject standalone elicitation and sampling on 2026-07-28 - #1554
Merged
guglielmo-san merged 2 commits intoDec 1, 2026
Conversation
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
guglielmo-san
approved these changes
Dec 1, 2026
Tangerg
added a commit
to Tangerg/go-sdk
that referenced
this pull request
Dec 2, 2026
Brings the fork up to upstream main at 723d70e, which is v1.9.0 plus fourteen later commits. Upstream changes: modelcontextprotocol#1238, modelcontextprotocol#1511, modelcontextprotocol#1515, modelcontextprotocol#1517, modelcontextprotocol#1521, modelcontextprotocol#1523, modelcontextprotocol#1524, modelcontextprotocol#1527, modelcontextprotocol#1533, modelcontextprotocol#1537, modelcontextprotocol#1539, modelcontextprotocol#1540, modelcontextprotocol#1544, modelcontextprotocol#1547, modelcontextprotocol#1549, modelcontextprotocol#1550, modelcontextprotocol#1553, modelcontextprotocol#1554, modelcontextprotocol#1558, modelcontextprotocol#1560, modelcontextprotocol#1561, modelcontextprotocol#1562. Fork-side adaptations: - internal/jsonrpc2: the -32600 reply to a duplicate in-flight ID (modelcontextprotocol#1550) is written off the read loop and holds its admission slot until written, like every other reply under MaxIncomingRequests. - mcp: ClientSession.initialize takes the session state lock that upstream added, and still projects the negotiated version to the connection. - mcp: the fork's copies of hintomitempty, nowrapinvalidparams and nomethodnotfoundcodeinerror go away with upstream's removal (modelcontextprotocol#1533). - extensions/skills: reads the protocol version from the fork's json.RawMessage Meta. - Tests: the duplicate-ID admission test drains the new reply, and the client cancellation test runs on 2025-11-25 only, because 2026-07-28 clients reject every standalone server request (modelcontextprotocol#1537, modelcontextprotocol#1540, modelcontextprotocol#1554).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.