Skip to content

Commit 76b7016

Browse files
committed
Arm the Mcp-Param server-validation conformance checks with an x-mcp-header fixture tool
All five SEP-2243 Mcp-Param-* server-validation checks in http-custom-header-server-validation skipped silently because no everything-server tool carried an x-mcp-header annotation — the scenario printed a green 0-passed/0-failed in every leg that selected it. Add a test_x_mcp_header tool whose region parameter carries the annotation via json_schema_extra (mirroring the typescript-sdk fixture). The checks now execute: the accept-path checks pass and the reject-path checks fail because server-side Mcp-Param validation is not implemented yet, so the scenario is baselined in both expected-failures files. The stale-entry rule forces the entries out when validation lands.
1 parent d372c07 commit 76b7016

3 files changed

Lines changed: 30 additions & 2 deletions

File tree

.github/actions/conformance/expected-failures.2026-07-28.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,7 @@
2222

2323
client: []
2424

25-
server: []
25+
server:
26+
# SEP-2243 Mcp-Param-* server-side validation is not implemented yet; see
27+
# the matching entry in expected-failures.yml for the full rationale.
28+
- http-custom-header-server-validation

.github/actions/conformance/expected-failures.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
client: []
1414

1515
server:
16+
# SEP-2243 Mcp-Param-* server-side validation is not implemented yet. The
17+
# everything-server's `test_x_mcp_header` tool arms these checks (without an
18+
# x-mcp-header-annotated tool the harness skips all of them silently); the
19+
# accept-path checks pass, the reject-path checks fail until the server
20+
# validates Mcp-Param headers against body params. Read by the draft leg and
21+
# the bare `--suite all` leg; the 2026-07-28 leg carries its own entry.
22+
- http-custom-header-server-validation
1623
# SEP-2663 (io.modelcontextprotocol/tasks): the SDK does not implement the
1724
# tasks extension yet. These extension-tagged scenarios are selected only by
1825
# the bare `--suite all` leg — extension scenarios never match a

examples/servers/everything-server/mcp_everything_server/server.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import hmac
1212
import json
1313
import logging
14-
from typing import Any
14+
from typing import Annotated, Any
1515

1616
import click
1717
from mcp.server import ServerRequestContext
@@ -327,6 +327,24 @@ def test_error_handling() -> str:
327327
raise RuntimeError("This tool intentionally returns an error for testing")
328328

329329

330+
@mcp.tool()
331+
def test_x_mcp_header(
332+
region: Annotated[
333+
str,
334+
Field(
335+
description="Mirrored into the Mcp-Param-Region header",
336+
json_schema_extra={"x-mcp-header": "Region"},
337+
),
338+
] = "<none>",
339+
) -> str:
340+
"""Tests SEP-2243 Mcp-Param-* server-side validation.
341+
342+
Arms the http-custom-header-server-validation conformance scenario, which
343+
skips when no tool with an `x-mcp-header` annotation is found.
344+
"""
345+
return f"region={region}"
346+
347+
330348
@mcp.tool()
331349
async def test_missing_capability(ctx: Context) -> str:
332350
"""Tests that a handler-raised MISSING_REQUIRED_CLIENT_CAPABILITY surfaces as a top-level JSON-RPC error.

0 commit comments

Comments
 (0)