Add conformance tests for SEP-2575 to validate the stateless-MCP behavior. This includes conformance tests for both MCP server and client.
Server
- Per-request _meta
- Rejects request with missing _meta → -32602 Invalid params.
- Rejects request with _meta missing io.modelcontextprotocol/protocolVersion.
- Rejects request with _meta missing io.modelcontextprotocol/clientInfo.
- Rejects request with _meta missing io.modelcontextprotocol/clientCapabilities.
- server/discover
- Responds to server/discover
- Response includes required fields: supportedVersions (non-empty), capabilities, serverInfo
- capabilities matches what the server honors on real RPC calls
- Version negotiation
- For a _meta.protocolVersion the server does not support, returns UnsupportedProtocolVersionError (not Invalid params and not silent rejection).
- UnsupportedProtocolVersionError carries non-empty data.supportedVersions matching the set advertised by server/discover (no drift).
- server/discover's supportedVersions matches the set the server actually accepts on real RPC calls (no drift).
- Returns the error even when the unsupported version is on the server/discover request itself (and still advertises supportedVersions so the client can recover).
- [HTTP] UnsupportedProtocolVersionError → HTTP 400 Bad Request.
- [HTTP] Rejects request when MCP-Protocol-Version header is absent or does not match _meta.protocolVersion (HTTP 400).
- Errors
- MissingRequiredClientCapabilityError (-32003) carries data.requiredCapabilities listing missing keys.
- All error responses carry the request's JSON-RPC id.
- Removed RPCs
- ping → -32601.
- logging/setLevel → -32601.
- resources/subscribe → -32601.
- resources/unsubscribe → -32601.
- HTTP transport
- Unknown method → HTTP 404 Not Found + JSON-RPC -32601.
- MissingRequiredClientCapabilityError → HTTP 400 Bad Request.
Client
- Per-request _meta
- Populates _meta on every request with all three required fields.
- Accurately reports clientCapabilities per request (does not claim unsupported features).
- server/discover
- Version negotiation
- Does version negotiation correctly
- Includes io.modelcontextprotocol/protocolVersion in _meta on every request.
- Sends a consistent protocolVersion once chosen (does not flip between versions request-to-request).
- [HTTP] Sends MCP-Protocol-Version header on every request, equal to _meta.protocolVersion.
- Cancellation
- [HTTP] Cancels by closing the stream (request).
- [STDIO] Cancels by sending notifications/cancelled with the request id.
Add conformance tests for SEP-2575 to validate the stateless-MCP behavior. This includes conformance tests for both MCP server and client.
Server
Client