Skip to content

feat(scenarios/server): cover the two untested SEP-2243 server param-presence requirements#325

Open
rinaldofesta wants to merge 1 commit into
modelcontextprotocol:mainfrom
rinaldofesta:feat/sep-2243-server-param-presence
Open

feat(scenarios/server): cover the two untested SEP-2243 server param-presence requirements#325
rinaldofesta wants to merge 1 commit into
modelcontextprotocol:mainfrom
rinaldofesta:feat/sep-2243-server-param-presence

Conversation

@rinaldofesta
Copy link
Copy Markdown

@rinaldofesta rinaldofesta commented Jun 1, 2026

Description

The SEP traceability manifest reported exactly two declared-but-untested requirements across the whole repo, both in SEP-2243 (custom Mcp-Param-* headers):

  • sep-2243-server-not-expect-null"Parameter value is null or omitted: Server MUST NOT expect the header."
  • sep-2243-server-reject-missing-required"Required parameter is omitted: Server MUST reject with JSON-RPC error."

This PR implements both as server checks in HttpCustomHeaderServerValidationScenario:

  • not-expect-null (acceptance): with an optional x-mcp-header parameter absent from the body, a conformant client omits the corresponding Mcp-Param-* header, so the server must accept the request rather than requiring the header. Skips (still emitting the ID) when the server under test exposes no optional annotated parameter.
  • reject-missing-required (rejection): omitting a required parameter entirely (body + header) must make the server reject with a JSON-RPC error (or HTTP ≥ 400). Skips when the tool has no required parameters.

Both IDs are added to CUSTOM_HEADER_SERVER_DECLARED_CHECK_IDS, so they are also emitted (SKIPPED) on the no-x-mcp-header-tool path, keeping the emitted-ID set stable for the manifest.

Traceability

src/seps/traceability.json is regenerated against the recorded source (typescript-sdk@258f1a04a5d3): the two rows flip untested → tested (SEP-2243 summary 18→20 tested, 2→0 untested) and no other rows change. After this PR the manifest reports 0 untested requirements across all SEPs.

Validation

  • npm run check (tsgo typecheck + eslint + prettier) clean; npx vitest run src/traceability src/scenarios/server/all-scenarios.test.ts → 56 passing.
  • Confirmed the scenario emits both new check IDs.
  • npm run traceability -- --check reports the on-disk manifest up to date.

Coverage note

Like the four existing custom-header checks, these two exercise their full request/response logic only against a server that exposes an x-mcp-header tool. The current reference server (everythingServer at typescript-sdk@258f1a04a5d3) exposes none, so all six custom-header checks — including these two — are emitted as SKIPPED against it (verified). They flip the manifest rows to tested via emission (the manifest joins on emitted IDs regardless of status), exactly as the existing checks do. The acceptance/rejection logic runs against servers that do define x-mcp-header tools, and falls back to SKIPPED when a tool lacks an optional (resp. required) parameter.


Drafted with the help of a coding agent (Claude Code) and reviewed by the author locally.

…presence requirements

The traceability manifest reported exactly two declared-but-untested SEP-2243 requirements: sep-2243-server-not-expect-null and sep-2243-server-reject-missing-required. This adds both to HttpCustomHeaderServerValidationScenario.

- not-expect-null: with an optional x-mcp-header parameter absent from the body, a conformant client omits its Mcp-Param header, so the server MUST accept the request (it must not require the header).

- reject-missing-required: omitting a required parameter entirely MUST make the server reject with a JSON-RPC error.

Both IDs are also added to the declared-check set so they are emitted (SKIPPED) when the server under test exposes no x-mcp-header tool, keeping the emitted-ID set stable for the manifest.

Regenerates src/seps/traceability.json against the recorded source (typescript-sdk@258f1a04a5d3): the two requirements flip untested -> tested (sep-2243 summary 18->20 tested, 2->0 untested); no other rows change. typecheck + eslint + unit tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rinaldofesta rinaldofesta marked this pull request as ready for review June 1, 2026 07:09
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