Skip to content

Align draft schema with spec docs (subscriptionId, HeaderMismatch, notification directions)#2889

Open
pja-ant wants to merge 2 commits into
mainfrom
fix/draft-schema-consistency
Open

Align draft schema with spec docs (subscriptionId, HeaderMismatch, notification directions)#2889
pja-ant wants to merge 2 commits into
mainfrom
fix/draft-schema-consistency

Conversation

@pja-ant
Copy link
Copy Markdown
Contributor

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

What this does

Fixes a set of inconsistencies between schema/draft/schema.ts (the source of truth) and the draft specification prose, found during a pre-release consistency review.

Why now

The draft is heading to release; each of these is a place where an implementer reading the schema and one reading the prose would build incompatible behavior.

Changes

  • Declare the reserved io.modelcontextprotocol/subscriptionId _meta key in a new NotificationMetaObject type, and specify the derivation rule (decimal string of a numeric JSON-RPC ID, verbatim for a string ID). Previously the key existed only in prose and one example, and the docs showed numeric id 1 acknowledged as string "1" with no conversion rule — a strict comparison silently drops all subscription notifications on stdio.
  • Fix the three *ListChangedNotification doc comments that still said notifications "may be issued by servers without any previous subscription", contradicting the opt-in subscriptions model (servers MUST NOT send unrequested types).
  • Add HEADER_MISMATCH = -32001 and a HeaderMismatchError interface. The transport requires servers to emit this code, but the schema had no definition, so generated SDKs could not recognize it.
  • Align the cacheScope: "private" doc comment with caching.mdx's authorization-context model (the two previously described different cache-sharing rules — a security boundary).
  • Make CancelledNotificationParams.requestId required (the optionality was a leftover from removed task cancellation, and an id-less cancellation has no defined meaning).
  • Give ListRootsRequest minimal params instead of RequestParams, which forced servers to fabricate client-identifying _meta on a server-initiated input request.
  • Remove ProgressNotification from ClientNotification (clients no longer receive requests, so they have nothing to report progress on). CancelledNotification stays in ServerNotification but is now scoped: servers send it solely to terminate a subscriptions/listen stream on stdio, matching the teardown rule from (chore): sep-to-spec consistency pass #2863. cancellation.mdx and progress.mdx are rewritten to match the directional model.

Verification

npm run generate:schema artifacts committed; npm run prep and npm run check pass clean.

pja-ant added 2 commits June 7, 2026 13:57
- Declare the reserved io.modelcontextprotocol/subscriptionId _meta key
  via a new NotificationMetaObject type, including the rule for deriving
  the value from the subscriptions/listen request's JSON-RPC ID
- Rewrite the three list_changed notification doc comments to reflect
  the opt-in subscriptions model instead of unsolicited delivery
- Add the HEADER_MISMATCH (-32001) error code and HeaderMismatchError
  type required by the Streamable HTTP transport's header validation
- Update cacheScope JSDoc to the authorization-context caching model
  used by the caching utility doc
- Make CancelledNotificationParams.requestId required
- Describe cancellation as client-initiated, with one server-side use:
  on stdio a server sends notifications/cancelled solely to terminate a
  subscriptions/listen stream
- Give ListRootsRequest a minimal params shape instead of RequestParams,
  matching other server-initiated input requests
- Remove ProgressNotification from ClientNotification: only clients
  issue requests, so only servers report progress

Regenerated schema.json and schema.mdx.
- Cancellation: describe cancellation as client-to-server, with the
  server-side exception for subscriptions/listen stream teardown on
  stdio
- Progress: describe progress notifications as server-to-client only,
  and use Client/Server in the sequence diagram
- Subscriptions: state how io.modelcontextprotocol/subscriptionId is
  derived from the subscriptions/listen request's JSON-RPC ID (decimal
  string for numeric IDs, verbatim for string IDs)
@mintlify
Copy link
Copy Markdown

mintlify Bot commented Jun 7, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
mcp-staging 🟢 Ready View Preview Jun 7, 2026, 1:04 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@mintlify
Copy link
Copy Markdown

mintlify Bot commented Jun 7, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
mcp 🟢 Ready View Preview Jun 7, 2026, 1:04 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@pja-ant pja-ant marked this pull request as ready for review June 7, 2026 13:08
@pja-ant pja-ant requested a review from a team as a code owner June 7, 2026 13:08
@localden localden added spec rc-high-priority Related to an upcoming specification release and needs to be addressed with a high priority. labels Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rc-high-priority Related to an upcoming specification release and needs to be addressed with a high priority. spec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants