Skip to content

feat(sep-2127): Server Card conformance scenario - #605

Draft
Wolfe-Jam wants to merge 1 commit into
modelcontextprotocol:mainfrom
Wolfe-Jam:feat/sep-2127-server-card
Draft

Wolfe-Jam wants to merge 1 commit into
modelcontextprotocol:mainfrom
Wolfe-Jam:feat/sep-2127-server-card

Conversation

@Wolfe-Jam

Copy link
Copy Markdown

A giant turkey stopped the world turning, finally circled back, wrote a draft to keep things moving. Happy Thanksgiving, guys!

Closes #550. A draft until #550's three questions are answered (end).

Requirement

SEP-2127 is Extensions Track; its normative text lives in ext-server-card, and the SEP asks implementers to "follow the current, versioned extension specification rather than this historical snapshot". The scenario is pinned to ext-server-card@28db12c9, current main. Tested requirements quote the same sentences at the SEP's snapshot (526201bb); 28db12c9 adds Remote.extensionsInfo (ext-server-card#55). The repo README still labels it experimental.

MCP Servers MAY host their Server Card at GET <streamable-http-url>/server-card, …

What changes

sep-2127-server-card: the 16 checks from #550, plus a preflight check (#550's correction), registered under io.modelcontextprotocol/server-card, the Extension Identifier in SEP-2127's header.

  • Gating. #550 left statuses other than 2xx, 404 and 405 open. This PR settles them: only a 2xx is a hosted card and is graded, so an HTML page fails card-schema-valid; any other status (404, 405, 3xx, 401, 5xx) skips every check. No answer at all fails card-schema-valid. Missing prerequisites use untestableCheck() (#248).
  • Placement. pending, beside Tasks and Skills: the extension is optional, so a default run should not grade it.
  • Changed from #550. cache-control requires a Cache-Control header and does not grade public or max-age=3600, which the spec shows in a code block under that SHOULD. Say if those directives should be graded.
Check Keyword Severity Observed
card-schema-valid MUST FAILURE body validates against the vendored v1 schema
version-semver SHOULD WARNING version is SemVer 2.0.0
card-media-type SHOULD WARNING Content-Type: application/mcp-server-card+json
cors-allow-origin MUST FAILURE GET: Access-Control-Allow-Origin: *
cors-expose-headers MUST FAILURE GET: Access-Control-Expose-Headers includes ETag
cors-preflight MUST FAILURE OPTIONS is 2xx with Allow-Origin * or the origin
cors-allow-methods MUST FAILURE OPTIONS: Access-Control-Allow-Methods includes GET
cors-allow-headers MUST FAILURE OPTIONS: Access-Control-Allow-Headers includes Content-Type, If-None-Match
cache-control SHOULD WARNING a Cache-Control header
etag SHOULD WARNING an ETag header
if-none-match SHOULD WARNING GET with that ETag gets 304
consistent-transport SHOULD NOT WARNING the card's remote for this URL says streamable-http
consistent-protocol-version SHOULD NOT WARNING its supportedProtocolVersions ⊆ server/discover supportedVersions
consistent-version SHOULD NOT WARNING version vs serverInfo.version
consistent-name SHOULD NOT WARNING name vs serverInfo.name, when that is reverse-DNS
consistent-title SHOULD NOT WARNING title vs serverInfo.title
consistent-description SHOULD NOT WARNING description vs serverInfo.description

(IDs drop the sep-2127- prefix here.)

  • Schema severity. The only MUST on the card's shape is the $schema URL form; name, version and description are schema-required. A card failing the v1 schema is graded FAILURE; say if a failure other than $schema should be WARNING.
  • CORS reads the spec's four headers the way Fetch does: Allow-Origin and Expose-Headers on the GET, Allow-Methods and Allow-Headers on the preflight, plus a 2xx preflight.
  • Not tested (rows in src/seps/sep-2127.yaml): HTTPS in production, rate limiting, client requirements, the disclosure MUST NOT, icons. AI Catalog discovery is out of scope.
  • The v1 schema is vendored with a SOURCE file, as src/spec-types/ is. The everything-server hosts a card. traceability.json picks up the new row on its weekly refresh.

Prove it passes and fails

examples/servers/typescript/sep-2127-server-card-fixture.ts, asserted in negative.test.ts:

  • /good/mcp: all 17 SUCCESS, with and without a trailing slash on the URL.
  • /html/mcp: card-schema-valid and all five CORS checks FAILURE; nothing skipped.
  • /contradict/mcp: a correctly served card contradicting server/discover; all six consistency checks WARNING.
  • /none/mcp (404), /auth/mcp (401): all 17 SKIPPED.
  • Nothing listening: card-schema-valid FAILURE, naming the cause.

Forcing every graded check to SUCCESS (skips left as skips) turns three of the six cases red. Everything-server: Passed: 15/15. npm run build, npm run check and npm test (647/647) pass.

SDKs

Target Result Failing
typescript-sdk main (5ee54ee3) 17 SKIPPED (no card) none
python-sdk#2951 (576f76e6) 16/16 none
typescript-sdk#2527 (c6032245, draft, last updated 2026-08-18) 14/15 cors-expose-headers
go-sdk#1024 (11eac37e) 13/16 cors-expose-headers, cors-allow-headers, cors-preflight (on the Fetch reading)

python-sdk#3139 (draft) not run. Output and curl confirmation in the first comment.

Open questions from #550

  1. pending as here, active, or a suite of its own for extensions?
  2. Plain HTTP beside the MCP connection, through undici as dns-rebinding.ts does: the right shape?
  3. Only a 2xx is a hosted card; anything else, 5xx included, skips. The right reading of the MAY under #248, or should a 5xx fail?

—
Drafted and coded by Claude · Edited, Reviewed and Approved by James Wolfe

17 checks on the card a server hosts at <url>/server-card, pinned to
ext-server-card@28db12c9: schema, CORS (preflight read from OPTIONS),
caching, consistency with server/discover. Only 2xx is graded. Refs modelcontextprotocol#550.
@Wolfe-Jam
Wolfe-Jam marked this pull request as draft November 26, 2026 15:58
@Wolfe-Jam

Copy link
Copy Markdown
Author

SDK runs, for the table above. typescript-sdk#2527 ran its example unmodified. Python and Go ran a local wrapper around their documented example, with the remote moved to localhost (Python drops its AI Catalog and host allow-list; Go adds the /mcp endpoint). Totals include the runner's own wire-schema-valid, which passed in every PR run; skips are not counted. Blocks show the non-SUCCESS lines.

typescript-sdk main (5ee54ee3): /mcp/server-card answers 404, so all 17 SKIPPED.

python-sdk#2951 (576f76e6), docs_src/server_cards/tutorial001.py: Passed: 16/16, 0 failed, 0 warnings. consistent-protocol-version and consistent-name skip (no versions listed; serverInfo.name is not reverse-DNS).

typescript-sdk#2527 (c6032245), examples/server-card-discovery/server.ts:

[sep-2127-cors-expose-headers        ] FAILURE
[sep-2127-consistent-protocol-version] SKIPPED
[sep-2127-consistent-title           ] SKIPPED
[sep-2127-consistent-description     ] SKIPPED
Passed: 14/15, 1 failed, 0 warnings

curl: the GET sends Access-Control-Allow-Origin: * and an ETag, but no Access-Control-Expose-Headers, so browser script cannot read the ETag.

go-sdk#1024 (11eac37e), the servercard package doc example, servercard.Handler(card):

[sep-2127-cors-expose-headers        ] FAILURE
[sep-2127-cors-preflight             ] FAILURE
[sep-2127-cors-allow-headers         ] FAILURE
[sep-2127-consistent-protocol-version] SKIPPED
[sep-2127-consistent-description     ] SKIPPED
Passed: 13/16, 3 failed, 0 warnings

curl: no Access-Control-Expose-Headers; Access-Control-Allow-Headers: Content-Type without If-None-Match; OPTIONS answers 405 (Allow: GET, HEAD). The handler sets its CORS headers on every response, 405 included, so cors-preflight fails on the 405 alone; that one depends on the Fetch reading in the description, the other two don't. These match the review requests on go-sdk#1024 (r4565192578, r4565548429).

—
Drafted by Claude · Approved by James Wolfe

This branch has not been deployed

No deployments
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.

Proposal: SEP-2127 Server Card scenario

1 participant