Skip to content

Commit ea9fe3a

Browse files
docs(core): name standard-header-validation rung at call site + test header; add precedence caveat
The serveModern call-site comment and the server stdHeaderValidation test header still attributed the presence/Mcp-Name rejections to the edge era-classification rung after 5779aab re-stamped them onto the dedicated standard-header-validation rung. Both now name the rung explicitly (and note the classifier's mismatch cells stay on era-classification). The new rung's documented order (8) is also not the observed precedence — serveModern evaluates it immediately after the supported-revision gate, before the dispatch rungs (5-6) and the capability gate (7). Rather than renumber (wider blast across the ladder table and the param-header rung), add a precedence caveat to its rationale, mirroring the client-capabilities entry's caveat.
1 parent 5779aab commit ea9fe3a

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

packages/core/src/shared/inboundClassification.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,10 @@ export const INBOUND_VALIDATION_LADDER: readonly InboundValidationRungDescriptor
337337
'SEP-2243 standard `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check ' +
338338
'— are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before ' +
339339
'dispatch. The classifier’s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge ' +
340-
'`era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half.'
340+
'`era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half. The documented order ' +
341+
'(after method resolution, params validation, and the capability gate) is not the observed precedence: serveModern ' +
342+
'evaluates this rung immediately after the supported-revision gate, so a request that fails several rungs is ' +
343+
'answered by this gate before the dispatch rungs (5–6) and the capability gate (7) are consulted.'
341344
},
342345
{
343346
rung: 'param-header-validation',

packages/server/src/server/createMcpHandler.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,9 +647,10 @@ export function createMcpHandler(factory: McpServerFactory, options: CreateMcpHa
647647
}
648648

649649
// SEP-2243 standard-header presence and `Mcp-Name` cross-check
650-
// (`era-classification` rung; the `MCP-Protocol-Version` and
650+
// (`standard-header-validation` rung; the `MCP-Protocol-Version` and
651651
// `Mcp-Method` *mismatch* cells are already answered inside
652-
// `classifyInboundRequest`). Evaluated after the supported-revision
652+
// `classifyInboundRequest` on the edge `era-classification` rung).
653+
// Evaluated after the supported-revision
653654
// gate so an envelope naming a revision this endpoint does not serve
654655
// is still answered with `-32004` (the supported list is the more
655656
// useful answer to a client speaking the wrong revision); evaluated

packages/server/test/server/stdHeaderValidation.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
* header, a missing `Mcp-Name` header on a `tools/call` / `prompts/get` /
99
* `resources/read` request, an `Mcp-Name` value disagreeing with
1010
* `params.name` / `params.uri`, and an invalid `Mcp-Name` Base64 sentinel are
11-
* all rejected `400` / `-32001` (`HeaderMismatch`) — the same shape and rung
12-
* the classifier already emits for the `MCP-Protocol-Version` and
13-
* `Mcp-Method` mismatch cells. Legacy-era traffic is byte-unchanged.
11+
* all rejected `400` / `-32001` (`HeaderMismatch`) on the
12+
* `standard-header-validation` rung — the same shape the classifier already
13+
* emits for the `MCP-Protocol-Version` and `Mcp-Method` mismatch cells on the
14+
* edge `era-classification` rung. Legacy-era traffic is byte-unchanged.
1415
*/
1516
import {
1617
CLIENT_CAPABILITIES_META_KEY,

0 commit comments

Comments
 (0)