Skip to content

fix(schema): align reserved _meta prefix rule with spec docs#2758

Merged
kurtisvg merged 1 commit into
modelcontextprotocol:mainfrom
pja-ant:worktree-meta-prefix-reservation-fix
May 21, 2026
Merged

fix(schema): align reserved _meta prefix rule with spec docs#2758
kurtisvg merged 1 commit into
modelcontextprotocol:mainfrom
pja-ant:worktree-meta-prefix-reservation-fix

Conversation

@pja-ant

@pja-ant pja-ant commented May 21, 2026

Copy link
Copy Markdown
Contributor

Problem

The reserved-_meta-prefix rules in the schema and the basic specification were structurally different and classified the same prefixes oppositely.

  • schema/draft/schema.ts (source of truth): "Any prefix consisting of zero or more labels, followed by modelcontextprotocol or mcp, followed by any label, is reserved." Examples were forward-DNS: modelcontextprotocol.io/, mcp.dev/, api.modelcontextprotocol.org/, tools.mcp.com/.
  • docs/specification/draft/basic/index.mdx (docs): "Any prefix where the second label is modelcontextprotocol or mcp is reserved." Examples were reverse-DNS: io.modelcontextprotocol/, dev.mcp/, org.modelcontextprotocol.api/, com.mcp.tools/.

Because the schema rule required a trailing label after the keyword, io.modelcontextprotocol/ was not reserved under the source of truth — yet that is the prefix used for every mandatory per-request field (io.modelcontextprotocol/protocolVersion, /clientInfo, /clientCapabilities, /logLevel, /subscriptionId). The protocol's own namespace was left open to third-party squatting/collision. Conversely, modelcontextprotocol.io/ and mcp.dev/ were reserved only by the schema, and dev.mcp/ only by the docs. Two implementers building a _meta-key validator from the two documents would produce incompatible, mutually-rejecting validators, and neither would protect the spec's own keys.

Fix

The schema is brought in line with the docs. The MetaObject JSDoc now uses the docs' rule and example set:

  • Adds the reverse-DNS recommendation line already present in the docs.
  • Replaces the reservation rule with the "second label" form and reverse-DNS examples (io.modelcontextprotocol/, dev.mcp/, org.modelcontextprotocol.api/, com.mcp.tools/), including the com.example.mcp/-is-NOT-reserved clarification.

schema.json and schema.mdx were regenerated via npm run generate:schema. All three documents now state one identical rule with one identical example set, and the protocol's own io.modelcontextprotocol/ namespace is reserved.

Validation

  • npm run generate:schema — regenerated JSON + MDX.
  • npm run check:schema — passes for the changed files. (One pre-existing, unrelated failure remains in draft: ReadResourceResult/file-resource-contents.json is missing cacheScope/ttlMs; not touched by this PR.)
  • npm run format — no further changes.

The MetaObject JSDoc (the schema source of truth) and the basic
specification described structurally different rules for which `_meta`
key prefixes are reserved for MCP, and classified the same prefixes
oppositely.

schema.ts required a trailing label after the keyword ("zero or more
labels, followed by modelcontextprotocol or mcp, followed by any
label"), so `io.modelcontextprotocol/` — the prefix used for every
mandatory per-request field (protocolVersion, clientInfo,
clientCapabilities, logLevel, subscriptionId) — was NOT reserved under
the source of truth, leaving the protocol's own namespace open to
collision. The docs used a reverse-DNS "second label" rule that did
reserve it.

Adopt the docs' rule and example set verbatim in the JSDoc (and the
reverse-DNS recommendation), then regenerate schema.json and
schema.mdx so all three documents state one identical rule with one
identical example set.
@pja-ant pja-ant marked this pull request as ready for review May 21, 2026 12:15
@pja-ant pja-ant requested a review from a team as a code owner May 21, 2026 12:15
@kurtisvg kurtisvg merged commit 96083c8 into modelcontextprotocol:main May 21, 2026
5 checks passed
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.

2 participants