Skip to content

Commit 937b25d

Browse files
committed
rename check ids to sep-2243-* prefix; kebab-case throughout
Aligns with the sep-2243.yaml traceability ids and the repo convention (sep-2164-*, sep-2207-*). Variant suffixes are kept (per-method, per-tool) so per-case visibility isn't lost; the YAML's row id is a prefix of the emitted ids, which is fine — extra ids not in the YAML are allowed. Also fixes the mixed hyphen/underscore in reject-invalid-tool ids (toolName has underscores; replace to hyphens).
1 parent 006330f commit 937b25d

4 files changed

Lines changed: 35 additions & 35 deletions

File tree

src/scenarios/client/http-custom-headers.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ export class HttpCustomHeadersScenario extends BaseHttpScenario {
323323
getChecks(): ConformanceCheck[] {
324324
if (!this.toolCallReceived) {
325325
this.checks.push({
326-
id: 'client-custom-header-tool-call',
326+
id: 'sep-2243-param-header-tool-call-gate',
327327
name: 'ClientCustomHeaderToolCall',
328328
description: 'Client calls the tool with x-mcp-header annotations',
329329
status: 'FAILURE',
@@ -335,7 +335,7 @@ export class HttpCustomHeadersScenario extends BaseHttpScenario {
335335
}
336336
if (!this.nullToolCallReceived) {
337337
this.checks.push({
338-
id: 'client-custom-header-omit-null',
338+
id: 'sep-2243-client-omit-null',
339339
name: 'ClientCustomHeaderOmitNull',
340340
description:
341341
'Client MUST omit Mcp-Param header when parameter value is null or not provided',
@@ -628,7 +628,7 @@ export class HttpCustomHeadersScenario extends BaseHttpScenario {
628628
// Check that 'query' (no x-mcp-header) is NOT mirrored
629629
const queryHeader = req.headers['mcp-param-query'] as string | undefined;
630630
this.checks.push({
631-
id: 'client-custom-header-no-mirror-unannotated',
631+
id: 'sep-2243-no-mirror-unannotated',
632632
name: 'ClientCustomHeaderNoMirrorUnannotated',
633633
description:
634634
'Client MUST NOT add Mcp-Param headers for parameters without x-mcp-header',
@@ -648,7 +648,7 @@ export class HttpCustomHeadersScenario extends BaseHttpScenario {
648648
| string
649649
| undefined;
650650
this.checks.push({
651-
id: 'client-custom-header-omit-null',
651+
id: 'sep-2243-client-omit-null',
652652
name: 'ClientCustomHeaderOmitNull',
653653
description:
654654
'Client MUST omit Mcp-Param header when parameter value is null or not provided',
@@ -716,7 +716,7 @@ export class HttpCustomHeadersScenario extends BaseHttpScenario {
716716
}
717717

718718
this.checks.push({
719-
id: `client-custom-header-${headerName.toLowerCase()}`,
719+
id: `sep-2243-param-header-${headerName.toLowerCase()}`,
720720
name: `ClientCustomHeader_${headerName}`,
721721
description: `Client sends correct Mcp-Param-${headerName} header (${valueType} value)`,
722722
status: errors.length === 0 ? 'SUCCESS' : 'FAILURE',
@@ -753,7 +753,7 @@ export class HttpInvalidToolHeadersScenario extends BaseHttpScenario {
753753
getChecks(): ConformanceCheck[] {
754754
if (!this.toolsListSent) {
755755
this.checks.push({
756-
id: 'client-invalid-tool-headers-tools-list',
756+
id: 'sep-2243-invalid-tool-tools-list-gate',
757757
name: 'ClientInvalidToolHeadersToolsList',
758758
description: 'Client requests tools/list',
759759
status: 'FAILURE',
@@ -766,7 +766,7 @@ export class HttpInvalidToolHeadersScenario extends BaseHttpScenario {
766766
// Check that valid_tool WAS called — proves client kept valid tools
767767
const validToolCalled = this.calledTools.has('valid_tool');
768768
this.checks.push({
769-
id: 'client-keeps-valid-tool',
769+
id: 'sep-2243-keep-valid-tool',
770770
name: 'ClientKeepsValidTool',
771771
description: 'Client MUST keep valid tools while excluding invalid ones',
772772
status: validToolCalled ? 'SUCCESS' : 'FAILURE',
@@ -794,7 +794,7 @@ export class HttpInvalidToolHeadersScenario extends BaseHttpScenario {
794794
for (const toolName of invalidTools) {
795795
const called = this.calledTools.has(toolName);
796796
this.checks.push({
797-
id: `client-rejects-invalid-tool-${toolName}`,
797+
id: `sep-2243-reject-invalid-tool-${toolName.replace(/_/g, '-')}`,
798798
name: `ClientRejectsInvalidTool_${toolName}`,
799799
description: `Client MUST NOT call tool '${toolName}' with invalid x-mcp-header`,
800800
status: called ? 'FAILURE' : 'SUCCESS',

src/scenarios/client/http-standard-headers.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,29 @@ describe('HttpStandardHeadersScenario (SEP-2243) — negative', () => {
3131
});
3232
}
3333

34-
it('FAILs client-mcp-method-header-initialize when Mcp-Method is missing', async () => {
34+
it('FAILs sep-2243-mcp-method-header-initialize when Mcp-Method is missing', async () => {
3535
const scenario = new HttpStandardHeadersScenario();
3636
const { serverUrl } = await scenario.start();
3737
try {
3838
await postInitialize(serverUrl, {}); // no Mcp-Method header
3939
const checks = scenario.getChecks();
4040
const check = checks.find(
41-
(c) => c.id === 'client-mcp-method-header-initialize'
41+
(c) => c.id === 'sep-2243-mcp-method-header-initialize'
4242
);
4343
expect(check?.status).toBe('FAILURE');
4444
} finally {
4545
await scenario.stop();
4646
}
4747
});
4848

49-
it('SUCCEEDs client-mcp-method-header-initialize when Mcp-Method matches', async () => {
49+
it('SUCCEEDs sep-2243-mcp-method-header-initialize when Mcp-Method matches', async () => {
5050
const scenario = new HttpStandardHeadersScenario();
5151
const { serverUrl } = await scenario.start();
5252
try {
5353
await postInitialize(serverUrl, { 'Mcp-Method': 'initialize' });
5454
const checks = scenario.getChecks();
5555
const check = checks.find(
56-
(c) => c.id === 'client-mcp-method-header-initialize'
56+
(c) => c.id === 'sep-2243-mcp-method-header-initialize'
5757
);
5858
expect(check?.status).toBe('SUCCESS');
5959
} finally {

src/scenarios/client/http-standard-headers.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export class HttpStandardHeadersScenario implements Scenario {
102102
for (const method of expectedMethods) {
103103
if (!this.methodHeaderChecks.has(method)) {
104104
result.push({
105-
id: `client-mcp-method-header-${method.replace(/\//g, '-')}`,
105+
id: `sep-2243-mcp-method-header-${method.replace(/\//g, '-')}`,
106106
name: `ClientMcpMethodHeader_${method.replace(/\//g, '_')}`,
107107
description: `Client sends correct Mcp-Method header on ${method} request`,
108108
status: 'SKIPPED',
@@ -117,7 +117,7 @@ export class HttpStandardHeadersScenario implements Scenario {
117117
for (const method of expectedNameMethods) {
118118
if (!this.nameHeaderChecks.has(method)) {
119119
result.push({
120-
id: `client-mcp-name-header-${method.replace(/\//g, '-')}`,
120+
id: `sep-2243-mcp-name-header-${method.replace(/\//g, '-')}`,
121121
name: `ClientMcpNameHeader_${method.replace(/\//g, '_')}`,
122122
description: `Client sends correct Mcp-Name header on ${method} request`,
123123
status: 'SKIPPED',
@@ -244,7 +244,7 @@ export class HttpStandardHeadersScenario implements Scenario {
244244
this.methodHeaderChecks.set(method, errors.length === 0);
245245

246246
this.checks.push({
247-
id: `client-mcp-method-header-${method.replace(/\//g, '-')}`,
247+
id: `sep-2243-mcp-method-header-${method.replace(/\//g, '-')}`,
248248
name: `ClientMcpMethodHeader_${method.replace(/\//g, '_')}`,
249249
description: `Client sends correct Mcp-Method header on ${method} request`,
250250
status: errors.length === 0 ? 'SUCCESS' : 'FAILURE',
@@ -289,7 +289,7 @@ export class HttpStandardHeadersScenario implements Scenario {
289289
this.nameHeaderChecks.set(method, errors.length === 0);
290290

291291
this.checks.push({
292-
id: `client-mcp-name-header-${method.replace(/\//g, '-')}`,
292+
id: `sep-2243-mcp-name-header-${method.replace(/\//g, '-')}`,
293293
name: `ClientMcpNameHeader_${method.replace(/\//g, '_')}`,
294294
description: `Client sends correct Mcp-Name header on ${method} request`,
295295
status: errors.length === 0 ? 'SUCCESS' : 'FAILURE',

src/scenarios/server/http-standard-headers.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ export class HttpHeaderValidationScenario implements ClientScenario {
289289
baseHeaders,
290290
nextId,
291291
'reject',
292-
'server-rejects-mismatched-method-header',
292+
'sep-2243-server-rejects-mismatched-method-header',
293293
'ServerRejectsMismatchedMethodHeader',
294294
'Server rejects requests where Mcp-Method header does not match body method',
295295
{ jsonrpc: '2.0', id: 0, method: 'tools/list' },
@@ -304,7 +304,7 @@ export class HttpHeaderValidationScenario implements ClientScenario {
304304
baseHeaders,
305305
nextId,
306306
'reject',
307-
'server-rejects-missing-method-header',
307+
'sep-2243-server-rejects-missing-method-header',
308308
'ServerRejectsMissingMethodHeader',
309309
'Server rejects requests with missing Mcp-Method header',
310310
{ jsonrpc: '2.0', id: 0, method: 'tools/list' },
@@ -322,7 +322,7 @@ export class HttpHeaderValidationScenario implements ClientScenario {
322322
baseHeaders,
323323
nextId,
324324
'reject',
325-
'server-rejects-mismatched-name-header',
325+
'sep-2243-server-rejects-mismatched-name-header',
326326
'ServerRejectsMismatchedNameHeader',
327327
'Server rejects tools/call where Mcp-Name does not match body params.name',
328328
{
@@ -344,7 +344,7 @@ export class HttpHeaderValidationScenario implements ClientScenario {
344344
baseHeaders,
345345
nextId,
346346
'accept',
347-
'server-accepts-whitespace-header-value',
347+
'sep-2243-server-accepts-whitespace-header-value',
348348
'ServerAcceptsWhitespaceHeaderValue',
349349
'Server MUST accept leading/trailing whitespace in Mcp-Name value (RFC 9110 §5.5: field parsing MUST exclude OWS before evaluating)',
350350
{
@@ -373,7 +373,7 @@ export class HttpHeaderValidationScenario implements ClientScenario {
373373
baseHeaders,
374374
nextId,
375375
'reject',
376-
'server-rejects-missing-name-header',
376+
'sep-2243-server-rejects-missing-name-header',
377377
'ServerRejectsMissingNameHeader',
378378
'Server MUST reject tools/call with missing Mcp-Name header when body has params.name',
379379
{
@@ -401,7 +401,7 @@ export class HttpHeaderValidationScenario implements ClientScenario {
401401
baseHeaders,
402402
nextId,
403403
'accept',
404-
'server-accepts-lowercase-header-name',
404+
'sep-2243-server-accepts-lowercase-header-name',
405405
'ServerAcceptsLowercaseHeaderName',
406406
'Server MUST accept lowercase header name (mcp-method)',
407407
{ jsonrpc: '2.0', id: 0, method: 'tools/list' },
@@ -416,7 +416,7 @@ export class HttpHeaderValidationScenario implements ClientScenario {
416416
baseHeaders,
417417
nextId,
418418
'accept',
419-
'server-accepts-uppercase-header-name',
419+
'sep-2243-server-accepts-uppercase-header-name',
420420
'ServerAcceptsUppercaseHeaderName',
421421
'Server MUST accept uppercase header name (MCP-METHOD)',
422422
{ jsonrpc: '2.0', id: 0, method: 'tools/list' },
@@ -431,7 +431,7 @@ export class HttpHeaderValidationScenario implements ClientScenario {
431431
baseHeaders,
432432
nextId,
433433
'reject',
434-
'server-rejects-case-mismatch-value',
434+
'sep-2243-server-rejects-case-mismatch-value',
435435
'ServerRejectsCaseMismatchValue',
436436
'Server MUST reject uppercase method value (TOOLS/LIST) since values are case-sensitive',
437437
{ jsonrpc: '2.0', id: 0, method: 'tools/list' },
@@ -441,7 +441,7 @@ export class HttpHeaderValidationScenario implements ClientScenario {
441441
);
442442
} catch (error) {
443443
checks.push({
444-
id: 'http-header-validation-setup',
444+
id: 'sep-2243-server-standard-setup',
445445
name: 'HttpHeaderValidationSetup',
446446
description: 'Setup for header validation tests',
447447
status: 'FAILURE',
@@ -548,7 +548,7 @@ export class HttpCustomHeaderServerValidationScenario implements ClientScenario
548548

549549
if (!xMcpTool) {
550550
checks.push({
551-
id: 'http-custom-header-server-no-tool',
551+
id: 'sep-2243-server-no-xmcp-tool',
552552
name: 'HttpCustomHeaderServerNoTool',
553553
description:
554554
'Server has no tools with x-mcp-header annotations to test',
@@ -610,7 +610,7 @@ export class HttpCustomHeaderServerValidationScenario implements ClientScenario
610610
);
611611
if (!annotatedEntry) {
612612
checks.push({
613-
id: 'http-custom-header-server-no-string-param',
613+
id: 'sep-2243-server-no-string-param',
614614
name: 'HttpCustomHeaderServerNoStringParam',
615615
description:
616616
'Server has no string-typed x-mcp-header parameter to test',
@@ -664,7 +664,7 @@ export class HttpCustomHeaderServerValidationScenario implements ClientScenario
664664
baseHeaders,
665665
nextId,
666666
'accept',
667-
'server-accepts-valid-base64',
667+
'sep-2243-server-accepts-valid-base64',
668668
'ServerAcceptsValidBase64',
669669
'Server decodes valid Base64 header value and validates against body',
670670
xMcpTool.name,
@@ -688,7 +688,7 @@ export class HttpCustomHeaderServerValidationScenario implements ClientScenario
688688
baseHeaders,
689689
nextId,
690690
'reject-info',
691-
'server-rejects-invalid-base64-padding',
691+
'sep-2243-server-rejects-invalid-base64-padding',
692692
'ServerRejectsInvalidBase64Padding',
693693
'Records whether server rejects unpadded Base64 in Mcp-Param value (informational — spec does not mandate strict decoding)',
694694
xMcpTool.name,
@@ -707,7 +707,7 @@ export class HttpCustomHeaderServerValidationScenario implements ClientScenario
707707
baseHeaders,
708708
nextId,
709709
'reject-info',
710-
'server-rejects-invalid-base64-chars',
710+
'sep-2243-server-rejects-invalid-base64-chars',
711711
'ServerRejectsInvalidBase64Chars',
712712
'Records whether server rejects non-alphabet chars in Base64 Mcp-Param value (informational — spec does not mandate strict decoding)',
713713
xMcpTool.name,
@@ -726,7 +726,7 @@ export class HttpCustomHeaderServerValidationScenario implements ClientScenario
726726
baseHeaders,
727727
nextId,
728728
'accept',
729-
'server-literal-missing-base64-prefix',
729+
'sep-2243-server-literal-missing-base64-prefix',
730730
'ServerLiteralMissingBase64Prefix',
731731
'Server treats value without =?base64? prefix as literal (not Base64)',
732732
xMcpTool.name,
@@ -745,7 +745,7 @@ export class HttpCustomHeaderServerValidationScenario implements ClientScenario
745745
baseHeaders,
746746
nextId,
747747
'accept',
748-
'server-literal-missing-base64-suffix',
748+
'sep-2243-server-literal-missing-base64-suffix',
749749
'ServerLiteralMissingBase64Suffix',
750750
'Server treats value without ?= suffix as literal (not Base64)',
751751
xMcpTool.name,
@@ -772,7 +772,7 @@ export class HttpCustomHeaderServerValidationScenario implements ClientScenario
772772
);
773773
} catch (error) {
774774
checks.push({
775-
id: 'http-custom-header-server-validation-setup',
775+
id: 'sep-2243-server-custom-setup',
776776
name: 'HttpCustomHeaderServerValidationSetup',
777777
description: 'Setup for custom header server validation tests',
778778
status: 'FAILURE',
@@ -908,7 +908,7 @@ export class HttpCustomHeaderServerValidationScenario implements ClientScenario
908908
// Custom-header rejection: both 400 and -32001 are MUST.
909909
checks.push(
910910
...createRejectionChecks(
911-
'server-rejects-missing-custom-header',
911+
'sep-2243-server-rejects-missing-custom-header',
912912
'ServerRejectsMissingCustomHeader',
913913
'Server MUST reject request where custom header is omitted but value is present in body',
914914
response,
@@ -925,7 +925,7 @@ export class HttpCustomHeaderServerValidationScenario implements ClientScenario
925925
);
926926
} catch (error) {
927927
checks.push({
928-
id: 'server-rejects-missing-custom-header',
928+
id: 'sep-2243-server-rejects-missing-custom-header',
929929
name: 'ServerRejectsMissingCustomHeader',
930930
description:
931931
'Server MUST reject request where custom header is omitted but value is present in body',

0 commit comments

Comments
 (0)