Skip to content

feat(sep-2243): add x-mcp-header static-reachability checks#352

Draft
pja-ant wants to merge 1 commit into
mainfrom
sep-2243-x-mcp-header-static-reach
Draft

feat(sep-2243): add x-mcp-header static-reachability checks#352
pja-ant wants to merge 1 commit into
mainfrom
sep-2243-x-mcp-header-static-reach

Conversation

@pja-ant

@pja-ant pja-ant commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Upstream spec PR modelcontextprotocol/modelcontextprotocol#2891 tightens the x-mcp-header placement rule for SEP-2243: the annotation MUST only appear on properties that are statically reachable from the inputSchema root via a chain of properties keys. The chain MUST NOT pass through items, oneOf/anyOf/allOf/not, if/then/else, or $ref. It also clarifies that header values are read at the annotated property's exact properties-path, and omitted when no value is present there.

This PR adds conformance coverage for both halves.

New check IDs

  • sep-2243-x-mcp-header-statically-reachablehttp-invalid-tool-headers now serves seven additional invalid tool definitions, each placing x-mcp-header under one of the disallowed keywords (items, oneOf, anyOf, allOf, not, then, $ref). Clients MUST exclude every one of them.
  • sep-2243-client-extract-nested-pathhttp-custom-headers now serves test_custom_headers_nested with x-mcp-header on properties.outer.properties.inner. The scenario asserts the client sends Mcp-Param-Nested when outer.inner is present and omits it when absent.

What changed

  • src/scenarios/client/http-custom-headers.ts — new tool fixtures, declared-ID lists, INVALID_TOOL_CONSTRAINT_IDS entries, and the nested-tool call handler.
  • src/scenarios/client/http-custom-headers.test.ts — extends the conforming-client path to call the nested tool (present + absent), and adds negative cases for nested-header-missing and invalid_under_items called.
  • src/seps/sep-2243.yaml — traceability rows for both new check IDs with verbatim spec text from #2891.

Verification

  • npx tsc --noEmit — clean
  • npm run lint — clean
  • npm test — 295 passed

https://claude.ai/code/session_01Gbqx5LodtAghT5fRYFxeja

Upstream spec PR modelcontextprotocol/modelcontextprotocol#2891 tightens
the x-mcp-header placement rule: the annotation MUST only appear on
properties statically reachable from the inputSchema root via a chain of
`properties` keys, never through `items`, `oneOf`/`anyOf`/`allOf`/`not`,
`if`/`then`/`else`, or `$ref`. It also clarifies that header values are
extracted at the annotated property's exact properties-path.

- http-invalid-tool-headers: serve seven new invalid tools (one per
  disallowed placement keyword) under new check ID
  `sep-2243-x-mcp-header-statically-reachable`; clients MUST reject each.
- http-custom-headers: add `test_custom_headers_nested` with x-mcp-header
  on `properties.outer.properties.inner` and assert under new check ID
  `sep-2243-client-extract-nested-path` that the client sends
  Mcp-Param-Nested when outer.inner is present and omits it when absent.
- sep-2243.yaml: add traceability rows for both new check IDs with
  verbatim spec text from #2891.
- tests: extend the conforming-client path to call the nested tool and
  add negative cases for nested-header-missing and
  invalid_under_items-called.

Claude-Session: https://claude.ai/code/session_01Gbqx5LodtAghT5fRYFxeja
@pkg-pr-new

pkg-pr-new Bot commented Jun 18, 2026

Copy link
Copy Markdown

Open in StackBlitz

npx https://pkg.pr.new/@modelcontextprotocol/conformance@352

commit: c4567cd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant