Skip to content

feat(core,server,client): re-pin spec to f68d864a; wire SubscriptionsListenResult (#2953)#2371

Merged
felixweinberger merged 2 commits into
v2-2026-07-28from
fweinberger/spec-repin-f68d864a
Jun 25, 2026
Merged

feat(core,server,client): re-pin spec to f68d864a; wire SubscriptionsListenResult (#2953)#2371
felixweinberger merged 2 commits into
v2-2026-07-28from
fweinberger/spec-repin-f68d864a

Conversation

@felixweinberger

Copy link
Copy Markdown
Contributor

Re-pin the spec checkout to f68d864a (upstream main 2026-06-25) and wire SubscriptionsListenResult (#2953) — closing the Q8 spec-watch.

Motivation and Context

Spec PR #2953 gives subscriptions/listen a typed result: the server SHOULD send an empty SubscriptionsListenResult (carrying _meta.subscriptionId) on graceful teardown, then close the stream. Stream-close-without-result remains the unexpected-disconnect path. This was the standing Q8 spec-watch item.

How Has This Been Tested?

core 1288/1288 (parity green: 153 types, corpus 87/128), server 350, client 696, all middleware/legacy/integration suites, e2e 2629 + 155 xfail, all 6 conformance legs pass baseline.

Breaking Changes

McpSubscription.closed gains a 'graceful' value (additive on a public union — changeset + migration entry included).

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

Of the 11 spec commits in range, only #2953 is a schema change (#2954 keep-alive and #2955 discover wording are prose-only; the rest are docs/housekeeping). G-1 audit at logs/agent-reports/65-spec-repin-audit.md.

Intentionally NOT in this PR: dropping elicitationId / ElicitationCompleteNotification* from the neutral schemas.ts. The 2026-era is already anchor-exact via the wire/rev2026-07-28 fork; removing from neutral schemas breaks the deprecated-but-functional 2025-era Server.elicitInput URL-mode surface. That's a deprecate→remove migration, not a re-pin chore.

…ionsListenResult schema

Regenerates spec.types.2026-07-28.ts, schema-twins, and the spec example
corpus from upstream f68d864a (the only schema change since dc105208 is
spec PR #2953 — SubscriptionsListenResult).

- Neutral schemas + wire/rev2026-07-28: add SubscriptionsListenResultSchema
  and SubscriptionsListenResultMetaSchema; ServerResult union and the
  subscriptions/listen ResultTypeMap entry gain the new type.
- Parity test: type count 151→153, parity rows for the two new types,
  ServerResult union extended.
- Corpus: manifest pins 86/127→87/128; SubscriptionsListenResult example
  vendored.
- Regenerated: codemod specSchemaMap.

The graceful-close behaviour itself (server emits the result on close;
client surfaces it as 'graceful') lands in the next commit.
…; surface on McpSubscription.closed

Per spec PR #2953, server-side graceful close of a subscriptions/listen
stream now emits the empty subscriptions/listen JSON-RPC result (the new
SubscriptionsListenResult — _meta carries the subscriptionId stamp) before
closing the stream, on both the HTTP entry (createMcpHandler) and stdio
entry (serveStdio). This replaces the previous server-originated
notifications/cancelled on stdio teardown.

On the client, McpSubscription.closed gains a 'graceful' resolution for
this signal (alongside 'local' and 'remote'): receipt of any JSON-RPC
result for the listen id resolves 'graceful'; a stream close without a
result remains 'remote' (unexpected disconnect — re-listen candidate).
Receipt of the result before the ack rejects listen() with
ConnectionClosed (a server that answers before serving is shutting down).

Adds the e2e subscriptions:listen:graceful-close requirement and a
matching graceful-close paragraph to docs/migration/support-2026-07-28.md.
@felixweinberger felixweinberger requested a review from a team as a code owner June 25, 2026 13:10
@changeset-bot

changeset-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7d20173

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@modelcontextprotocol/core Minor
@modelcontextprotocol/server Minor
@modelcontextprotocol/client Minor
@modelcontextprotocol/express Major
@modelcontextprotocol/fastify Major
@modelcontextprotocol/hono Major
@modelcontextprotocol/node Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/client@2371

@modelcontextprotocol/codemod

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/codemod@2371

@modelcontextprotocol/server

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server@2371

@modelcontextprotocol/server-legacy

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server-legacy@2371

@modelcontextprotocol/express

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/express@2371

@modelcontextprotocol/fastify

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/fastify@2371

@modelcontextprotocol/hono

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/hono@2371

@modelcontextprotocol/node

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/node@2371

commit: 7d20173

Comment thread .changeset/subscriptions-listen-result.md
Comment thread packages/client/src/client/client.ts
@felixweinberger felixweinberger merged commit 846ff27 into v2-2026-07-28 Jun 25, 2026
19 checks passed
@felixweinberger felixweinberger deleted the fweinberger/spec-repin-f68d864a branch June 25, 2026 13:31
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