Repository navigation
events/* requests must carry and validate Mcp-Name (SEP-3415 @ 2ec39b9c) #1567
Description
SEP-3415 moved after our last re-quote. Head 2ec39b9c (2026-10-16, "require Mcp-Name on events requests over Streamable HTTP") adds a section Streamable HTTP: Routing Headers and drops Open Question 8:
When
events/poll,events/stream,events/subscribeorevents/unsubscribeis sent over the Streamable HTTP transport, the client MUST set theMcp-Nameheader (defined by SEP-2243) to the value ofparams.name[…]
- An event name that cannot be safely represented as a plain ASCII header value MUST be carried in the Base64 sentinel format.
- […] A request whose
Mcp-Nameheader is missing, or does not matchparams.name, is rejected with HTTP status400 Bad RequestandHeaderMismatch(-32020).
events/listhas noparams.nameand carries noMcp-Nameheader.
mcpkit does neither half today:
- Client:
core.DeriveMcpName(core/sep2243.go) coverstools/call,prompts/get,resources/readandtasks/*. Anevents/*request goes out withMcp-Methodonly. - Server:
extractRoutingNameinserver/header_validation.govalidatesMcp-Namefortools/callandresources/readonly, so anevents/*request with a missing or wrong header is accepted.
Found via the rmcp implementers' comment on conformance PR 521 (modelcontextprotocol/conformance#521 (comment)), which also mentions a base64 interop issue with mcpkit. Not yet known whether that is this sentinel encoding.
Work
-
DeriveMcpName: map the fourevents/*methods toparams.name, with the Base64 sentinel for non-ASCII names (reuse whatevertools/calluses). -
extractRoutingName: the same four methods, so a missing or mismatched header gets 400 +-32020.events/liststays exempt. - Check the Go events client (
experimental/ext/events/clients/go) goes through the path that sets the header, includingevents/stream. - Check the stateless wire (
server/stateless/) applies the same validation. - Tests: header present, missing, mismatched and non-ASCII on each method, plus
events/listwithout a header. - Separately, in the conformance fork: re-quote
sep-3415.yamlat2ec39b9cand add server and client rows for this rule. The suite cannot grade it until then.
Done when
An events/* request from the mcpkit client carries Mcp-Name, and the mcpkit server answers 400 / -32020 to one that doesn't, on both wires.
Activity
feat(events): grade the Mcp-Name routing header on every events request
Merge pull request #1570 from panyam/feat/events-mcp-name-1567