From 855c55d9c4d7a81a94d61d341ac50aa4ff7894ea Mon Sep 17 00:00:00 2001 From: Felix Weinberger Date: Tue, 30 Jun 2026 21:03:12 +0000 Subject: [PATCH 1/3] chore: enter beta prerelease mode --- .changeset/beta-release.md | 16 ++++++++++++++++ .changeset/pre.json | 32 ++++++++++++++++---------------- 2 files changed, 32 insertions(+), 16 deletions(-) create mode 100644 .changeset/beta-release.md diff --git a/.changeset/beta-release.md b/.changeset/beta-release.md new file mode 100644 index 0000000000..26c711a910 --- /dev/null +++ b/.changeset/beta-release.md @@ -0,0 +1,16 @@ +--- +'@modelcontextprotocol/server': patch +'@modelcontextprotocol/client': patch +'@modelcontextprotocol/core': patch +'@modelcontextprotocol/server-legacy': patch +'@modelcontextprotocol/codemod': patch +'@modelcontextprotocol/express': patch +'@modelcontextprotocol/hono': patch +'@modelcontextprotocol/fastify': patch +'@modelcontextprotocol/node': patch +--- + +First beta release of SDK v2 with support for the MCP 2026-07-28 specification +revision. See the migration guides for upgrading from v1 +(`docs/migration/upgrade-to-v2.md`) and adopting the 2026-07-28 revision +(`docs/migration/support-2026-07-28.md`). diff --git a/.changeset/pre.json b/.changeset/pre.json index 6beaa26bec..d5343b66c8 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -1,28 +1,28 @@ { "mode": "pre", - "tag": "alpha", + "tag": "beta", "initialVersions": { "@modelcontextprotocol/eslint-config": "2.0.0", "@modelcontextprotocol/tsconfig": "2.0.0", "@modelcontextprotocol/vitest-config": "2.0.0", "@modelcontextprotocol/examples": "2.0.0-alpha.0", - "@modelcontextprotocol/client": "2.0.0-alpha.0", - "@modelcontextprotocol/core-internal": "2.0.0-alpha.0", - "@modelcontextprotocol/express": "2.0.0-alpha.0", - "@modelcontextprotocol/fastify": "2.0.0-alpha.0", - "@modelcontextprotocol/hono": "2.0.0-alpha.0", - "@modelcontextprotocol/node": "2.0.0-alpha.0", - "@modelcontextprotocol/server": "2.0.0-alpha.0", - "@modelcontextprotocol/server-legacy": "2.0.0-alpha.0", - "@modelcontextprotocol/core": "2.0.0-alpha.0", - "@modelcontextprotocol/codemod": "2.0.0-alpha.0", - "@modelcontextprotocol/test-conformance": "2.0.0-alpha.0", - "@modelcontextprotocol/test-helpers": "2.0.0-alpha.0", - "@modelcontextprotocol/test-integration": "2.0.0-alpha.0", - "@modelcontextprotocol/test-e2e": "2.0.0-alpha.0", "@mcp-examples/client-quickstart": "2.0.0-alpha.0", "@mcp-examples/server-quickstart": "2.0.0-alpha.0", - "@mcp-examples/shared": "2.0.0-alpha.0" + "@mcp-examples/shared": "2.0.0-alpha.0", + "@modelcontextprotocol/client": "2.0.0-alpha.4", + "@modelcontextprotocol/codemod": "2.0.0-alpha.2", + "@modelcontextprotocol/core": "2.0.0-alpha.2", + "@modelcontextprotocol/core-internal": "2.0.0-alpha.3", + "@modelcontextprotocol/express": "2.0.0-alpha.4", + "@modelcontextprotocol/fastify": "2.0.0-alpha.4", + "@modelcontextprotocol/hono": "2.0.0-alpha.4", + "@modelcontextprotocol/node": "2.0.0-alpha.4", + "@modelcontextprotocol/server": "2.0.0-alpha.4", + "@modelcontextprotocol/server-legacy": "2.0.0-alpha.4", + "@modelcontextprotocol/test-conformance": "2.0.0-alpha.1", + "@modelcontextprotocol/test-e2e": "2.0.0-alpha.1", + "@modelcontextprotocol/test-helpers": "2.0.0-alpha.0", + "@modelcontextprotocol/test-integration": "2.0.0-alpha.1" }, "changesets": [ "abort-handlers-on-close", From bf0a68dcd903a397238caec3e19340c99580af3d Mon Sep 17 00:00:00 2001 From: Felix Weinberger Date: Tue, 30 Jun 2026 21:32:36 +0000 Subject: [PATCH 2/3] chore: reset prerelease versions to beta.0; sweep published alpha references to beta --- docs/migration/index.md | 2 +- docs/migration/support-2026-07-28.md | 6 +++--- docs/migration/upgrade-to-v2.md | 13 ++++++------- examples/client-quickstart/package.json | 2 +- examples/server-quickstart/package.json | 2 +- examples/shared/package.json | 2 +- packages/client/README.md | 4 ++-- packages/client/package.json | 2 +- packages/codemod/README.md | 4 ++-- packages/codemod/package.json | 2 +- packages/core-internal/package.json | 2 +- packages/core/package.json | 2 +- packages/middleware/express/package.json | 2 +- packages/middleware/fastify/package.json | 2 +- packages/middleware/hono/package.json | 2 +- packages/middleware/node/package.json | 2 +- packages/server-legacy/package.json | 2 +- packages/server/README.md | 4 ++-- packages/server/package.json | 2 +- test/conformance/package.json | 2 +- test/e2e/package.json | 2 +- test/helpers/package.json | 2 +- test/integration/package.json | 2 +- 23 files changed, 33 insertions(+), 34 deletions(-) diff --git a/docs/migration/index.md b/docs/migration/index.md index 18daf3c43a..95444e11b4 100644 --- a/docs/migration/index.md +++ b/docs/migration/index.md @@ -19,7 +19,7 @@ v2 packages (`@modelcontextprotocol/client`, `@modelcontextprotocol/server`, … Start by running the codemod: ```bash -npx @modelcontextprotocol/codemod@alpha v1-to-v2 . +npx @modelcontextprotocol/codemod@beta v1-to-v2 . ``` Run it at the package root (`.`) — real projects import the SDK from `test/`, diff --git a/docs/migration/support-2026-07-28.md b/docs/migration/support-2026-07-28.md index 4b83844ba0..107e170757 100644 --- a/docs/migration/support-2026-07-28.md +++ b/docs/migration/support-2026-07-28.md @@ -614,9 +614,9 @@ Task methods are excluded from the typed method maps: `RequestMethod` / `Request `ctx.mcpReq.send()`, `setRequestHandler()`, `setNotificationHandler()` reject task methods at compile time. `ResultTypeMap['tools/call']` is plain `CallToolResult` (no `| CreateTaskResult`); same for `sampling/createMessage` and `elicitation/create`. -(The published `2.0.0-alpha.3` typings predate this exclusion — there the typed maps -still carry the `tasks/*` entries and the `CreateTaskResult` unions; narrow with the -`isCallToolResult` guard until the next published alpha.) Where +(Typings published before `2.0.0-beta.1` — the alphas — predate this exclusion: +there the typed maps still carry the `tasks/*` entries and the `CreateTaskResult` +unions; narrow with the `isCallToolResult` guard if you are pinned to an alpha.) Where task interop is genuinely required, use the explicit-schema custom-method form (`request({ method: 'tasks/get', params }, GetTaskResultSchema)`). Inbound `tasks/*` requests → `-32601`. diff --git a/docs/migration/upgrade-to-v2.md b/docs/migration/upgrade-to-v2.md index e428c7505d..d6a13bab97 100644 --- a/docs/migration/upgrade-to-v2.md +++ b/docs/migration/upgrade-to-v2.md @@ -19,7 +19,7 @@ If you are already on v2 and want to adopt the **2026-07-28 protocol revision**, only; CommonJS callers must use dynamic `import()`. 2. **Run the codemod.** ```bash - npx @modelcontextprotocol/codemod@alpha v1-to-v2 . + npx @modelcontextprotocol/codemod@beta v1-to-v2 . ``` Run it at the **package root** (`.`), not `./src` — it also rewrites `package.json`, and real projects import the SDK from `test/`, `scripts/`, and fixtures too. @@ -233,15 +233,14 @@ for the literal instead; and the emitted quote style differs from v1, so a quote-anchored pattern misses silently — match either quote. v2 also ships ESM only: `/dist/cjs/` ↔ `/dist/esm/` flavor-pair path swaps have no equivalent. -#### Registry availability during the alpha +#### Registry availability during the beta -All v2 packages are published on the public npm registry. Two notes for the alpha +All v2 packages are published on the public npm registry. Two notes for the beta window: -- The packages do not share one version number — at the time of writing - `@modelcontextprotocol/core` rides a lower prerelease than its siblings. The - codemod writes ranges that match what is published, so prefer its manifest output - over hand-pinning every package to the same tag. +- As of `2.0.0-beta.1` all v2 packages share one version number (earlier alphas + did not). The codemod writes ranges that match what is published, so prefer its + manifest output over hand-pinning every package. - Environments that resolve through a corporate or private registry mirror may not have synced the newer scoped packages yet (the symptom is "not found" for a package that exists on npmjs.org). Point the install at the public registry diff --git a/examples/client-quickstart/package.json b/examples/client-quickstart/package.json index 5b73c5c0d0..f4402cdf80 100644 --- a/examples/client-quickstart/package.json +++ b/examples/client-quickstart/package.json @@ -1,7 +1,7 @@ { "name": "@mcp-examples/client-quickstart", "private": true, - "version": "2.0.0-alpha.0", + "version": "2.0.0-beta.0", "type": "module", "scripts": { "build": "tsc", diff --git a/examples/server-quickstart/package.json b/examples/server-quickstart/package.json index e3b7960fb2..cee092a5d0 100644 --- a/examples/server-quickstart/package.json +++ b/examples/server-quickstart/package.json @@ -1,7 +1,7 @@ { "name": "@mcp-examples/server-quickstart", "private": true, - "version": "2.0.0-alpha.0", + "version": "2.0.0-beta.0", "type": "module", "scripts": { "build": "tsc", diff --git a/examples/shared/package.json b/examples/shared/package.json index 084daf3052..71bc9c34a1 100644 --- a/examples/shared/package.json +++ b/examples/shared/package.json @@ -1,7 +1,7 @@ { "name": "@mcp-examples/shared", "private": true, - "version": "2.0.0-alpha.0", + "version": "2.0.0-beta.0", "description": "Model Context Protocol implementation for TypeScript", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", diff --git a/packages/client/README.md b/packages/client/README.md index 580c631b4b..c9cbc1bcf8 100644 --- a/packages/client/README.md +++ b/packages/client/README.md @@ -4,7 +4,7 @@ The MCP (Model Context Protocol) TypeScript client SDK. Build MCP clients that c > [!WARNING] -> **This is an alpha release.** Expect breaking changes until v2 stabilizes. We're publishing early to gather feedback — please try it and open issues — but we can't guarantee API stability yet. We'll aim to minimize disruption between alphas. +> **This is a beta release.** The API surface is settling but breaking changes remain possible until v2 stabilizes. Please try it and open issues — feedback during the beta directly shapes the stable release. > [!NOTE] @@ -13,7 +13,7 @@ The MCP (Model Context Protocol) TypeScript client SDK. Build MCP clients that c ## Install ```bash -npm install @modelcontextprotocol/client@alpha +npm install @modelcontextprotocol/client@beta ``` TypeScript ≥6.0 no longer auto-includes `@types/*` — add `"types": ["node"]` to your `tsconfig.json` `compilerOptions` (the published `.d.mts` references `Buffer`). diff --git a/packages/client/package.json b/packages/client/package.json index 8e8092573a..949532af37 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@modelcontextprotocol/client", - "version": "2.0.0-alpha.4", + "version": "2.0.0-beta.0", "description": "Model Context Protocol implementation for TypeScript - Client package", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", diff --git a/packages/codemod/README.md b/packages/codemod/README.md index 66d13de7d9..2c89d2de24 100644 --- a/packages/codemod/README.md +++ b/packages/codemod/README.md @@ -5,10 +5,10 @@ Codemods for migrating MCP TypeScript SDK code between major versions. ## Usage ```bash -npx @modelcontextprotocol/codemod@alpha v1-to-v2 . +npx @modelcontextprotocol/codemod@beta v1-to-v2 . # or a single source file (manifest changes are reported, not applied) -npx @modelcontextprotocol/codemod@alpha v1-to-v2 src/server.ts +npx @modelcontextprotocol/codemod@beta v1-to-v2 src/server.ts ``` The codemod rewrites TypeScript and JavaScript source files diff --git a/packages/codemod/package.json b/packages/codemod/package.json index 9c340fa1cf..331a30c777 100644 --- a/packages/codemod/package.json +++ b/packages/codemod/package.json @@ -1,6 +1,6 @@ { "name": "@modelcontextprotocol/codemod", - "version": "2.0.0-alpha.2", + "version": "2.0.0-beta.0", "description": "Codemod to migrate MCP TypeScript SDK code from v1 to v2", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", diff --git a/packages/core-internal/package.json b/packages/core-internal/package.json index 29618121cf..0239af7cb2 100644 --- a/packages/core-internal/package.json +++ b/packages/core-internal/package.json @@ -1,7 +1,7 @@ { "name": "@modelcontextprotocol/core-internal", "private": true, - "version": "2.0.0-alpha.3", + "version": "2.0.0-beta.0", "description": "Model Context Protocol implementation for TypeScript - Core package", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", diff --git a/packages/core/package.json b/packages/core/package.json index 2b0aea43c0..86c8836a5a 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@modelcontextprotocol/core", - "version": "2.0.0-alpha.2", + "version": "2.0.0-beta.0", "description": "Model Context Protocol for TypeScript — public Zod schemas (spec + OAuth/OpenID)", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", diff --git a/packages/middleware/express/package.json b/packages/middleware/express/package.json index 7c8791762d..71415870c0 100644 --- a/packages/middleware/express/package.json +++ b/packages/middleware/express/package.json @@ -1,7 +1,7 @@ { "name": "@modelcontextprotocol/express", "private": false, - "version": "2.0.0-alpha.4", + "version": "2.0.0-beta.0", "description": "Express adapters for the Model Context Protocol TypeScript server SDK - Express middleware", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", diff --git a/packages/middleware/fastify/package.json b/packages/middleware/fastify/package.json index 38ab8dc15d..7562ce9870 100644 --- a/packages/middleware/fastify/package.json +++ b/packages/middleware/fastify/package.json @@ -1,7 +1,7 @@ { "name": "@modelcontextprotocol/fastify", "private": false, - "version": "2.0.0-alpha.4", + "version": "2.0.0-beta.0", "description": "Fastify adapters for the Model Context Protocol TypeScript server SDK - Fastify middleware", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", diff --git a/packages/middleware/hono/package.json b/packages/middleware/hono/package.json index 1639bf39c7..57fff85220 100644 --- a/packages/middleware/hono/package.json +++ b/packages/middleware/hono/package.json @@ -1,7 +1,7 @@ { "name": "@modelcontextprotocol/hono", "private": false, - "version": "2.0.0-alpha.4", + "version": "2.0.0-beta.0", "description": "Hono adapters for the Model Context Protocol TypeScript server SDK - Hono middleware", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", diff --git a/packages/middleware/node/package.json b/packages/middleware/node/package.json index 4562d40723..f03da7b755 100644 --- a/packages/middleware/node/package.json +++ b/packages/middleware/node/package.json @@ -1,6 +1,6 @@ { "name": "@modelcontextprotocol/node", - "version": "2.0.0-alpha.4", + "version": "2.0.0-beta.0", "description": "Model Context Protocol implementation for TypeScript - Node.js middleware", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", diff --git a/packages/server-legacy/package.json b/packages/server-legacy/package.json index 6aee294b29..a5ec1979d2 100644 --- a/packages/server-legacy/package.json +++ b/packages/server-legacy/package.json @@ -1,7 +1,7 @@ { "name": "@modelcontextprotocol/server-legacy", "private": false, - "version": "2.0.0-alpha.4", + "version": "2.0.0-beta.0", "description": "Frozen v1 SSE transport and OAuth Authorization Server helpers for the Model Context Protocol TypeScript SDK. Deprecated; use StreamableHTTP and a dedicated OAuth server in production.", "deprecated": "This package is a frozen copy of v1's SSE transport and OAuth Authorization Server helpers for migration purposes only. Use StreamableHTTP from @modelcontextprotocol/server and a dedicated OAuth server in production. Will not receive new features.", "license": "MIT", diff --git a/packages/server/README.md b/packages/server/README.md index 62386bdcce..1d5aefb73f 100644 --- a/packages/server/README.md +++ b/packages/server/README.md @@ -4,7 +4,7 @@ The MCP (Model Context Protocol) TypeScript server SDK. Build MCP servers that e > [!WARNING] -> **This is an alpha release.** Expect breaking changes until v2 stabilizes. We're publishing early to gather feedback — please try it and open issues — but we can't guarantee API stability yet. We'll aim to minimize disruption between alphas. +> **This is a beta release.** The API surface is settling but breaking changes remain possible until v2 stabilizes. Please try it and open issues — feedback during the beta directly shapes the stable release. > [!NOTE] @@ -13,7 +13,7 @@ The MCP (Model Context Protocol) TypeScript server SDK. Build MCP servers that e ## Install ```bash -npm install @modelcontextprotocol/server@alpha +npm install @modelcontextprotocol/server@beta ``` TypeScript ≥6.0 no longer auto-includes `@types/*` — add `"types": ["node"]` to your `tsconfig.json` `compilerOptions` (the published `.d.mts` references `Buffer`). diff --git a/packages/server/package.json b/packages/server/package.json index b21f18b127..874bc002d7 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "@modelcontextprotocol/server", - "version": "2.0.0-alpha.4", + "version": "2.0.0-beta.0", "description": "Model Context Protocol implementation for TypeScript - Server package", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", diff --git a/test/conformance/package.json b/test/conformance/package.json index 6c2c654663..f3e8fcd3e4 100644 --- a/test/conformance/package.json +++ b/test/conformance/package.json @@ -1,7 +1,7 @@ { "name": "@modelcontextprotocol/test-conformance", "private": true, - "version": "2.0.0-alpha.1", + "version": "2.0.0-beta.0", "description": "Model Context Protocol implementation for TypeScript", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", diff --git a/test/e2e/package.json b/test/e2e/package.json index 6dfa6a781f..017ffb93b1 100644 --- a/test/e2e/package.json +++ b/test/e2e/package.json @@ -1,7 +1,7 @@ { "name": "@modelcontextprotocol/test-e2e", "private": true, - "version": "2.0.0-alpha.1", + "version": "2.0.0-beta.0", "description": "Model Context Protocol implementation for TypeScript", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", diff --git a/test/helpers/package.json b/test/helpers/package.json index 3b7e49950e..01d369d7cd 100644 --- a/test/helpers/package.json +++ b/test/helpers/package.json @@ -1,7 +1,7 @@ { "name": "@modelcontextprotocol/test-helpers", "private": true, - "version": "2.0.0-alpha.0", + "version": "2.0.0-beta.0", "description": "Model Context Protocol implementation for TypeScript", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", diff --git a/test/integration/package.json b/test/integration/package.json index 10997c5be3..07f94eccc7 100644 --- a/test/integration/package.json +++ b/test/integration/package.json @@ -1,7 +1,7 @@ { "name": "@modelcontextprotocol/test-integration", "private": true, - "version": "2.0.0-alpha.1", + "version": "2.0.0-beta.0", "description": "Model Context Protocol implementation for TypeScript", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", From d954357ce18c682f220621a49c683c7c5f32525d Mon Sep 17 00:00:00 2001 From: Felix Weinberger Date: Tue, 30 Jun 2026 21:48:51 +0000 Subject: [PATCH 3/3] docs: fix remaining forward-looking alpha references; align alpha.4 typing claims; examples version --- docs/migration/support-2026-07-28.md | 7 ++++--- docs/migration/upgrade-to-v2.md | 17 +++++++++-------- examples/package.json | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/docs/migration/support-2026-07-28.md b/docs/migration/support-2026-07-28.md index 107e170757..28e5e5c1ea 100644 --- a/docs/migration/support-2026-07-28.md +++ b/docs/migration/support-2026-07-28.md @@ -614,9 +614,10 @@ Task methods are excluded from the typed method maps: `RequestMethod` / `Request `ctx.mcpReq.send()`, `setRequestHandler()`, `setNotificationHandler()` reject task methods at compile time. `ResultTypeMap['tools/call']` is plain `CallToolResult` (no `| CreateTaskResult`); same for `sampling/createMessage` and `elicitation/create`. -(Typings published before `2.0.0-beta.1` — the alphas — predate this exclusion: -there the typed maps still carry the `tasks/*` entries and the `CreateTaskResult` -unions; narrow with the `isCallToolResult` guard if you are pinned to an alpha.) Where +(Typings published before `2.0.0-alpha.4` predate this exclusion: there the typed +maps still carry the `tasks/*` entries and the `CreateTaskResult` unions; narrow with +the `isCallToolResult` guard if you are pinned to one of those alphas. `2.0.0-alpha.4` +and later include the exclusion.) Where task interop is genuinely required, use the explicit-schema custom-method form (`request({ method: 'tasks/get', params }, GetTaskResultSchema)`). Inbound `tasks/*` requests → `-32601`. diff --git a/docs/migration/upgrade-to-v2.md b/docs/migration/upgrade-to-v2.md index d6a13bab97..453eb53dcc 100644 --- a/docs/migration/upgrade-to-v2.md +++ b/docs/migration/upgrade-to-v2.md @@ -999,8 +999,9 @@ the third argument — `new SdkHttpError(SdkErrorCode.ClientHttpNotImplemented, (carries `data.requiredCapabilities`) are new typed `ProtocolError` subclasses. `resources/read` for an unknown URI now answers `-32602` on every protocol revision (v1.x already emitted `-32602`; an interim `-32002` from earlier v2 alphas is mapped at -the encode seam — published `2.0.0-alpha.3` predates the mapping and still emits -`-32002` on the wire, so accept both until the next published alpha). The encode-seam mapping applies to **your own throws too**: a handler +the encode seam — `2.0.0-alpha.3` and earlier predate the mapping and still emit +`-32002` on the wire, so accept both if peers may run those alphas; `2.0.0-alpha.4` +and later emit `-32602`). The encode-seam mapping applies to **your own throws too**: a handler that deliberately throws `ProtocolError(ProtocolErrorCode.ResourceNotFound, …)` reaches peers as `-32602` — a server can no longer emit `-32002` on the wire. `ProtocolErrorCode.ResourceNotFound` (`-32002`) stays importable as @@ -1372,12 +1373,12 @@ The role-aggregate unions (`ClientRequest`, `ServerResult`, `ServerRequest`, (`RequestMethod`, `RequestTypeMap`, `ResultTypeMap`, `NotificationTypeMap`) no longer include task vocabulary; the deprecated `Task*` types remain importable on their own. (One published-alpha qualification, like the `-32002` note in [Errors](#errors): the -`2.0.0-alpha.3` typings predate this — the typed maps there still carry the `tasks/*` -entries, and `ResultTypeMap['tools/call']` still unions `CreateTaskResult`, so a -`client.request({ method: 'tools/call', … })` result does not assign to -`Promise`. Narrow with the `isCallToolResult` guard until the next -published alpha — the guard is the recommended discrimination tool anyway, per the next -paragraph.) +`2.0.0-alpha.3` and earlier typings predate this — the typed maps there still carry the +`tasks/*` entries, and `ResultTypeMap['tools/call']` still unions `CreateTaskResult`, so +a `client.request({ method: 'tools/call', … })` result does not assign to +`Promise`. If pinned to those alphas, narrow with the +`isCallToolResult` guard — the recommended discrimination tool anyway, per the next +paragraph; `2.0.0-alpha.4` and later are unaffected.) **Discriminating result shapes: use guards, not the `in` operator.** The v2 zod-inferred result types are passthrough objects — every union member carries an index diff --git a/examples/package.json b/examples/package.json index 56f8779e8b..07788657ad 100644 --- a/examples/package.json +++ b/examples/package.json @@ -1,7 +1,7 @@ { "name": "@modelcontextprotocol/examples", "private": true, - "version": "2.0.0-alpha.0", + "version": "2.0.0-beta.0", "description": "Runnable MCP TypeScript SDK examples — one story per directory, each a self-verifying client/server pair", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)",