Skip to content

Commit 0de8fe9

Browse files
test(server): align era-gating test title with its initialize body
The legacy-era-untouched test title said it posts a 2025-era tools/list without standard headers, but the body POSTs initialize (the 2025 handshake, which is the right body for era-gating). Aligned the title to match the body.
1 parent b805bc4 commit 0de8fe9

2 files changed

Lines changed: 17 additions & 18 deletions

File tree

packages/core/src/shared/inboundClassification.ts

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ export type InboundValidationRung =
169169
| 'envelope'
170170
| 'method-registry'
171171
| 'request-params'
172-
| 'client-capabilities'
173172
| 'standard-header-validation'
173+
| 'client-capabilities'
174174
| 'param-header-validation';
175175

176176
/** A ladder rejection: the JSON-RPC error to emit and the HTTP status to emit it with. */
@@ -314,9 +314,23 @@ export const INBOUND_VALIDATION_LADDER: readonly InboundValidationRungDescriptor
314314
rationale: 'Per-method params validation; emitted in-band by the dispatch layer (HTTP 200), never via the ladder status table.'
315315
},
316316
{
317-
rung: 'client-capabilities',
317+
rung: 'standard-header-validation',
318318
order: 7,
319319
evaluatedAt: 'pre-dispatch',
320+
codes: [HEADER_MISMATCH_ERROR_CODE],
321+
conformance: ['http-header-validation'],
322+
rationale:
323+
'SEP-2243 standard `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check ' +
324+
'— are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before ' +
325+
'dispatch. The classifier’s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge ' +
326+
'`era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half. Evaluated before the ' +
327+
'capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by ' +
328+
'the standard-header rung first.'
329+
},
330+
{
331+
rung: 'client-capabilities',
332+
order: 8,
333+
evaluatedAt: 'pre-dispatch',
320334
codes: [ProtocolErrorCode.MissingRequiredClientCapability],
321335
conformance: ['server-stateless'],
322336
rationale:
@@ -327,21 +341,6 @@ export const INBOUND_VALIDATION_LADDER: readonly InboundValidationRungDescriptor
327341
'missing the capability and would also fail a dispatch rung is answered by this gate first, so the entry must ' +
328342
'consult the method registry before the gate if the documented precedence is to stay observable.'
329343
},
330-
{
331-
rung: 'standard-header-validation',
332-
order: 8,
333-
evaluatedAt: 'pre-dispatch',
334-
codes: [HEADER_MISMATCH_ERROR_CODE],
335-
conformance: ['http-header-validation'],
336-
rationale:
337-
'SEP-2243 standard `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check ' +
338-
'— are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before ' +
339-
'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. 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.'
344-
},
345344
{
346345
rung: 'param-header-validation',
347346
order: 9,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ describe('SEP-2243 standard-header validation (createMcpHandler, modern era)', (
149149
});
150150

151151
describe('SEP-2243 standard-header validation is era-gated', () => {
152-
it('legacy traffic is byte-untouched: a 2025-era tools/list without standard headers still serves', async () => {
152+
it('legacy traffic is byte-untouched: a 2025-era initialize without standard headers still serves', async () => {
153153
const handler = createMcpHandler(makeFactory());
154154
const response = await handler.fetch(
155155
new Request('http://localhost/mcp', {

0 commit comments

Comments
 (0)