[Server] Close the conformance gaps in the modern lifecycle (#447)
* [Server] Let the client gateway see modern-era capabilities The six supports*() probes read session state only InitializeHandler wrote, so every request served statelessly reported no client capabilities at all — a tool guarding on them took the unsupported branch without a signal. StatelessProtocol now writes the request's declaration under the same keys. * [Server] Reject the RPCs 2026-07-28 removed resources/subscribe and resources/unsubscribe were still dispatched and answered 200 OK, recording subscriptions the modern era never reads. They join initialize, ping and logging/setLevel in the era guard; the handlers stay registered because the handshake era still serves them. * [Server] Decode a wrapped Mcp-Name before comparing it The Base64 sentinel was only unwrapped for Mcp-Param-*, so any resource URI or tool name outside the header-safe ASCII set — which the spec explicitly tells clients to wrap — was compared encoded and refused with -32020. * [Server] Require the MCP-Protocol-Version header It was only checked for contradicting the body, so omitting it entirely passed — leaving the value intermediaries route on unenforced. Tied to the header validator's presence, since that is what a header-bearing transport installs and stdio carries its metadata inline. * [Server] Read the modern-era request body whole A single read() takes whatever the stream cares to give — 64 bytes from a chunked transfer is legal — so an oversized-but-valid POST came back as a parse error. Shares the legacy transport's incremental read as a trait. * [Schema][Server] Answer a notification with a status, not a response A body with no id was dispatched as a request and came back as a JSON-RPC error carrying "id": "" — an id nobody issued, and on a path a client uses to tell a modern server from a legacy one. Notifications now get 202 and no body, and Error omits an id it could not read instead of emptying it. * [Server] Stop emitting the error codes 2026-07-28 reserved resources/read answered -32002, which this revision forbids; prompts/get and completion/complete answered it for an unknown *name*, which it never meant; tools/call answered -32601, which belongs to an unknown method. Only the resources/read code is revision-gated — older peers expect -32002 there, and nowhere else. Also routes the -32021 capability exception out of the prompt and resource handlers, which were swallowing it into -32603.
This commit is contained in:
parent
ef0c1c2808
commit
5e73683079
1 changed files with 855 additions and 106 deletions
|
|
@ -22,16 +22,6 @@ server:
|
|||
# chunks will need — rather than anything specific to progress.
|
||||
- tools-call-with-progress:tools-call-with-progress
|
||||
|
||||
# --- SHOULD-level warnings -------------------------------------------------
|
||||
# These report WARNING rather than FAILURE (the severity follows the spec
|
||||
# keyword), so the run summary counts them as passed — but the baseline
|
||||
# evaluator still wants them declared, and declaring them is right: each is a
|
||||
# SHOULD the SDK does not yet honour. Both concern the resources/read
|
||||
# not-found shape: SEP-2164 moved it to -32602 with the uri in error.data,
|
||||
# and the SDK still answers with the older -32002 and no data.
|
||||
- sep-2164-resource-not-found:sep-2164-data-uri
|
||||
- sep-2164-resource-not-found:sep-2164-error-code
|
||||
|
||||
# --- Pre-existing, not lifecycle-specific ----------------------------------
|
||||
# Neither is caused by (or fixable in) the modern lifecycle; both reproduce
|
||||
# on the handshake endpoint. Listed so the draft run is honest.
|
||||
|
|
|
|||
Loading…
Reference in a new issue