Skip to content

Re-vendor 2026-07-28 schema at spec ead35b59 (SubscriptionsListenResult)#3006

Open
maxisbey wants to merge 1 commit into
mainfrom
schema-revendor
Open

Re-vendor 2026-07-28 schema at spec ead35b59 (SubscriptionsListenResult)#3006
maxisbey wants to merge 1 commit into
mainfrom
schema-revendor

Conversation

@maxisbey

Copy link
Copy Markdown
Contributor

Re-vendors schema/draft/schema.json at spec commit ead35b59 to pick up modelcontextprotocol/modelcontextprotocol#2953, the only schema/draft/ change since the previous vendor pin (2852f30e, set by #2912). Spec main is 20 commits past 2ffc3fa2 (#2953's merge) with no further schema/draft/ changes, so this brings the vendored schema fully up to date.

The schema diff is purely additive: SubscriptionsListenResult and SubscriptionsListenResultMeta are added to $defs, and SubscriptionsListenResult joins the ServerResult union.

Motivation and Context

Part of #2901. The subscriptions/listen runtime work needs the result type to exist before it can land; today the lowlevel on_subscriptions_listen slot is typed to return EmptyResult, which is no longer the spec-correct shape post-#2953.

How Has This Been Tested?

gen_surface_types.py --check, pyright, ruff, and ./scripts/test (full suite, 100% coverage, strict-no-cover clean).

Breaking Changes

None for users — SubscriptionsListenResult is a new type and nothing previously consumed subscriptions/listen results. The lowlevel on_subscriptions_listen callback's return type changes from EmptyResult to SubscriptionsListenResult, but per the design that handler is registered by the entry-side router rather than user code, and there is no runtime caller yet.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

  • SubscriptionsListenResultMeta is added to OPEN_CLASSES so the generated wire model preserves arbitrary _meta keys, matching NotificationMetaObject (both are MetaObject extensions; neither carries additionalProperties in the upstream JSON Schema, so the codegen default would have closed them).
  • In the monolith the new result follows the existing pattern: _meta stays the lenient dict[str, Any] inherited from Result (so SubscriptionsListenResultMeta is SKIP-listed in tests/types/test_parity.py alongside the other *MetaObject types), and the class sits in the ServerResult union immediately before InputRequiredResult, which must remain last.
  • Conformance gap: the conformance suite at b18aa918 (this repo's pin and conformance main HEAD) is itself pinned to spec f817239f — pre-fix: normalize OAuth redirect URI URL subtypes #2953 — and has no scenario asserting the subscriptions/listen result body. Its existing subscriptions/listen checks in server/stateless.ts only inspect notification frames on the stream. I'll raise a conformance issue to bump the spec-types pin and add a result-shape check; this PR does not change conformance behaviour either way (the new type is not yet emitted by any runtime path).

Picks up modelcontextprotocol/modelcontextprotocol#2953, the only schema/draft
change since the previous vendor pin (2852f30e). The diff is purely additive:
SubscriptionsListenResult and SubscriptionsListenResultMeta are added to
$defs, and SubscriptionsListenResult joins the ServerResult union.

- schema/2026-07-28.json + PINNED.json bumped; v2026_07_28/__init__.py
  regenerated. SubscriptionsListenResultMeta added to OPEN_CLASSES so it
  preserves arbitrary _meta keys, matching NotificationMetaObject.
- mcp_types: SubscriptionsListenResult added to the monolith and ServerResult
  union (before InputRequiredResult, which must stay last); subscriptions/listen
  rows in methods.py now point to it instead of EmptyResult.
- lowlevel server: on_subscriptions_listen return type follows the new result.
- tests/types: fixtures and EMPTY_SERVER_RESPONSE_METHODS updated;
  SubscriptionsListenResultMeta skipped in parity (modelled as Meta dict in
  the monolith, same as the other *MetaObject types).
@maxisbey maxisbey marked this pull request as ready for review June 26, 2026 21:32
@maxisbey maxisbey enabled auto-merge (squash) June 26, 2026 21:37

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 10 files

Re-trigger cubic

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't find any bugs — the regenerated wire models, method maps, and test updates all follow the established re-vendor pattern from #2912 — but since this changes protocol type definitions (ServerResult union, subscriptions/listen result mapping, the on_subscriptions_listen handler signature) and bumps the vendored spec pin, it's worth a maintainer's confirmation that the vendored schema matches upstream ead35b59.

Extended reasoning...

Overview

This PR re-vendors the 2026-07-28 draft schema at spec commit ead35b59, adding SubscriptionsListenResult / SubscriptionsListenResultMeta to the vendored JSON schema, the generated v2026_07_28 wire models, and the monolith types. It also rewires subscriptions/listen result mappings in methods.py (surface and monolith maps) from EmptyResult to the new type, updates the lowlevel on_subscriptions_listen callback annotation, adds SubscriptionsListenResultMeta to OPEN_CLASSES in the codegen script, and updates the methods/parity tests accordingly. Ten files changed, but most of the diff is generated or follows the prior re-vendor pattern.

Security risks

None apparent. The change is additive type plumbing: no auth, crypto, transport, or input-handling logic is touched, and there is no runtime caller of the new result type yet. The only slightly sensitive knob is marking SubscriptionsListenResultMeta as an open (extra="allow") class, which matches how the other *MetaObject classes are treated and is consistent with the spec's MetaObject semantics.

Level of scrutiny

Moderate. The hand-written pieces (union ordering with InputRequiredResult kept last, methods-map rows, OPEN_CLASSES entry, test fixtures) are internally consistent and verified by gen_surface_types.py --check plus the methods/parity test suites. However, this is a protocol-type definition change for the SDK and includes a vendored-schema pin bump whose fidelity to the upstream spec commit can't be verified from the diff alone — that spec-alignment judgment is best left to a maintainer. The on_subscriptions_listen return-type change is technically a signature change on a public constructor parameter, though the author notes there is no runtime caller yet.

Other factors

The bug-hunting pass found no issues, test coverage of the new type is thorough (result fixtures, required-field rejection, parity skip-list), and the PR description is detailed about the conformance-suite gap. There are no prior reviews or outstanding comments on this PR.

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