Skip to content

Commit f65e68b

Browse files
Version Packages (beta)
1 parent e2aeac2 commit f65e68b

15 files changed

Lines changed: 197 additions & 8 deletions

File tree

.changeset/pre.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,16 @@
2626
},
2727
"changesets": [
2828
"beta-release",
29+
"cjs-ajv-validator-subpath",
2930
"cjs-support-v2-packages",
3031
"codemod-iterations-5",
31-
"post-dispatch-32021-http-400"
32+
"codemod-versions-from-manifests",
33+
"content-type-media-type-validation",
34+
"cross-bundle-error-instanceof",
35+
"examples-protected-wiring",
36+
"post-dispatch-32021-http-400",
37+
"silent-validators-wave",
38+
"web-standard-bearer-auth",
39+
"web-standard-oauth-metadata"
3240
]
3341
}

packages/client/CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
# @modelcontextprotocol/client
22

3+
## 2.0.0-beta.3
4+
5+
### Patch Changes
6+
7+
- [#2431](https://github.com/modelcontextprotocol/typescript-sdk/pull/2431) [`1b90c96`](https://github.com/modelcontextprotocol/typescript-sdk/commit/1b90c96d11fd17016d2977cae9dd661de3fb84df) Thanks [@morluto](https://github.com/morluto)! - Fix the CommonJS `validators/ajv` subpath so reading the exported `Ajv` class no longer throws `ReferenceError: import_ajv is not defined`. The subpath now re-exports the bundled provider's concrete `Ajv` value in CJS output, matching the existing ESM behavior.
8+
9+
- [#2441](https://github.com/modelcontextprotocol/typescript-sdk/pull/2441) [`561c6d8`](https://github.com/modelcontextprotocol/typescript-sdk/commit/561c6d83456ef98d6c713bbda9837e64337f22c9) Thanks [@felixweinberger](https://github.com/felixweinberger)! - POSTs whose `Content-Type` media type is not `application/json` are now
10+
rejected with `415 Unsupported Media Type`; the header is parsed instead of
11+
substring-matched. Previously any value merely containing the substring
12+
passed the check (for example `text/plain; a=application/json`), case
13+
variants were wrongly rejected, and the 2026-07-28 entry did not inspect
14+
`Content-Type` at all — requests with a missing or non-JSON header that used
15+
to be served on that path now also answer 415. Values with parameters
16+
(`application/json; charset=utf-8`, including malformed parameter sections
17+
like `application/json;`) continue to work. SDK clients always send the
18+
correct header and are unaffected.
19+
20+
The new `isJsonContentType(header)` helper is exported for transport and
21+
framework-adapter authors — custom entries composing the exported building
22+
blocks (`classifyInboundRequest`, `PerRequestHTTPServerTransport`) must apply
23+
it themselves. The hono adapter's JSON body pre-parse and the client's
24+
response dispatch now use the same parsed-media-type comparison.
25+
26+
- [#2384](https://github.com/modelcontextprotocol/typescript-sdk/pull/2384) [`ce2f65d`](https://github.com/modelcontextprotocol/typescript-sdk/commit/ce2f65db0e019506f4d2526466ec8cc7106de98e) Thanks [@felixweinberger](https://github.com/felixweinberger)! - `instanceof` on the SDK error classes (`ProtocolError` and its typed subclasses, `SdkError`/`SdkHttpError`, `OAuthError`, and the client's `SseError`, `UnauthorizedError`, and OAuth-client-flow error family — `OAuthClientFlowError` and its subclasses) now works across separately bundled copies of the SDK. The classes match by a stable brand (via `Symbol.hasInstance` and a registry symbol) instead of prototype identity, so a process that uses both `@modelcontextprotocol/client` and `@modelcontextprotocol/server` - a gateway, host, or in-process test - can check errors constructed by either package against the class re-exported by the other. Ordinary prototype-based `instanceof` is preserved as a fallback; user-defined subclasses keep plain prototype semantics. Notes: cross-bundle matching requires both copies to be at or after this release; brands assert identity, not field shape, across versions - keep reading fields defensively. As a side effect, a foreign-bundle `SdkError` used as an abort reason is now rethrown as-is instead of being wrapped as a `RequestTimeout`. Branded hierarchies additionally expose an explicit static guard, `X.isInstance(value)`, that reads the same brand and narrows in TypeScript — an alternative for codebases that prefer predicate-style checks over `instanceof`. Also: `UnauthorizedError` now sets `error.name` to `'UnauthorizedError'` (previously `'Error'`), and per-package conformance tests enforce that every exported error class participates in branding. Version-negotiation probing now recognizes `UnauthorizedError` (previously a dead name-string check) and propagates it unchanged, so `connect()` on an auth-gated server rejects with the original `UnauthorizedError` (previously wrapped as the `cause` of an `SdkError(EraNegotiationFailed)`) — run `finishAuth()` and reconnect, and the retry probes with the token.
27+
28+
- [#2425](https://github.com/modelcontextprotocol/typescript-sdk/pull/2425) [`e8de519`](https://github.com/modelcontextprotocol/typescript-sdk/commit/e8de519d3129f46b7528d2999b7641f55be1f091) Thanks [@Sehlani042](https://github.com/Sehlani042)! - Stop advertising validator provider classes from the root client/server type declarations. The provider classes remain available from the explicit validator subpaths.
29+
330
## 2.0.0-beta.2
431

532
### Patch Changes

packages/client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@modelcontextprotocol/client",
3-
"version": "2.0.0-beta.2",
3+
"version": "2.0.0-beta.3",
44
"description": "Model Context Protocol implementation for TypeScript - Client package",
55
"license": "MIT",
66
"author": "Anthropic, PBC (https://anthropic.com)",

packages/codemod/CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# @modelcontextprotocol/codemod
22

3+
## 2.0.0-beta.3
4+
5+
### Patch Changes
6+
7+
- [#2419](https://github.com/modelcontextprotocol/typescript-sdk/pull/2419) [`79dc162`](https://github.com/modelcontextprotocol/typescript-sdk/commit/79dc162efcb4e1f7b820bfb6068906483cf71ec7) Thanks [@felixweinberger](https://github.com/felixweinberger)! - Read the v2 package versions the codemod writes into migrated `package.json` files directly from the workspace manifests at build time, replacing the committed generated `versions.ts` (which went stale after every release and made source builds write outdated versions).
8+
9+
- [#2420](https://github.com/modelcontextprotocol/typescript-sdk/pull/2420) [`7635115`](https://github.com/modelcontextprotocol/typescript-sdk/commit/7635115d0112c3f980b45a9773a4770660af8aae) Thanks [@felixweinberger](https://github.com/felixweinberger)! - Add runtime-neutral Bearer authentication to `@modelcontextprotocol/server`:
10+
`requireBearerAuth` gates web-standard `fetch(request)` hosts (Cloudflare
11+
Workers, Deno, Bun, Hono), built on the exported `verifyBearerToken` and
12+
`bearerAuthChallengeResponse` pieces, with `OAuthTokenVerifier` now defined
13+
here. The Express middleware adapts the same core and is unchanged in
14+
behavior, except that `WWW-Authenticate` challenge values are now RFC 7235
15+
quoted-string sanitized (quotes and backslashes escaped, control and
16+
non-ASCII characters replaced); `@modelcontextprotocol/express` re-exports
17+
`OAuthTokenVerifier` as before.
18+
319
## 2.0.0-beta.2
420

521
### Patch Changes

packages/codemod/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@modelcontextprotocol/codemod",
3-
"version": "2.0.0-beta.2",
3+
"version": "2.0.0-beta.3",
44
"description": "Codemod to migrate MCP TypeScript SDK code from v1 to v2",
55
"license": "MIT",
66
"author": "Anthropic, PBC (https://anthropic.com)",

packages/middleware/express/CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# @modelcontextprotocol/express
22

3+
## 2.0.0-beta.3
4+
5+
### Patch Changes
6+
7+
- [#2420](https://github.com/modelcontextprotocol/typescript-sdk/pull/2420) [`7635115`](https://github.com/modelcontextprotocol/typescript-sdk/commit/7635115d0112c3f980b45a9773a4770660af8aae) Thanks [@felixweinberger](https://github.com/felixweinberger)! - Add runtime-neutral Bearer authentication to `@modelcontextprotocol/server`:
8+
`requireBearerAuth` gates web-standard `fetch(request)` hosts (Cloudflare
9+
Workers, Deno, Bun, Hono), built on the exported `verifyBearerToken` and
10+
`bearerAuthChallengeResponse` pieces, with `OAuthTokenVerifier` now defined
11+
here. The Express middleware adapts the same core and is unchanged in
12+
behavior, except that `WWW-Authenticate` challenge values are now RFC 7235
13+
quoted-string sanitized (quotes and backslashes escaped, control and
14+
non-ASCII characters replaced); `@modelcontextprotocol/express` re-exports
15+
`OAuthTokenVerifier` as before.
16+
17+
- [#2422](https://github.com/modelcontextprotocol/typescript-sdk/pull/2422) [`61866d7`](https://github.com/modelcontextprotocol/typescript-sdk/commit/61866d7a5ff4475663ceb525c88447c497c1b92a) Thanks [@felixweinberger](https://github.com/felixweinberger)! - Add runtime-neutral OAuth discovery serving to `@modelcontextprotocol/server`:
18+
`oauthMetadataResponse` serves the RFC 9728 Protected Resource Metadata and
19+
RFC 8414 Authorization Server metadata documents from web-standard
20+
`fetch(request)` hosts, built on the exported
21+
`buildOAuthProtectedResourceMetadata`, with
22+
`getOAuthProtectedResourceMetadataUrl` now defined here. The Express metadata
23+
router adapts the same core and is unchanged in behavior; the insecure-issuer
24+
escape hatch is an explicit `dangerouslyAllowInsecureIssuerUrl` option in the
25+
neutral core instead of a module-scope environment read. The web-standard
26+
matcher validates lazily so unmatched traffic always falls through, tolerates
27+
a trailing slash, supports HEAD, and marks reflected CORS preflights with
28+
`Vary`.
29+
- Updated dependencies [[`1b90c96`](https://github.com/modelcontextprotocol/typescript-sdk/commit/1b90c96d11fd17016d2977cae9dd661de3fb84df), [`561c6d8`](https://github.com/modelcontextprotocol/typescript-sdk/commit/561c6d83456ef98d6c713bbda9837e64337f22c9), [`ce2f65d`](https://github.com/modelcontextprotocol/typescript-sdk/commit/ce2f65db0e019506f4d2526466ec8cc7106de98e), [`e8de519`](https://github.com/modelcontextprotocol/typescript-sdk/commit/e8de519d3129f46b7528d2999b7641f55be1f091), [`7635115`](https://github.com/modelcontextprotocol/typescript-sdk/commit/7635115d0112c3f980b45a9773a4770660af8aae), [`61866d7`](https://github.com/modelcontextprotocol/typescript-sdk/commit/61866d7a5ff4475663ceb525c88447c497c1b92a)]:
30+
- @modelcontextprotocol/server@2.0.0-beta.3
31+
332
## 2.0.0-beta.2
433

534
### Patch Changes

packages/middleware/express/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@modelcontextprotocol/express",
33
"private": false,
4-
"version": "2.0.0-beta.2",
4+
"version": "2.0.0-beta.3",
55
"description": "Express adapters for the Model Context Protocol TypeScript server SDK - Express middleware",
66
"license": "MIT",
77
"author": "Anthropic, PBC (https://anthropic.com)",

packages/middleware/fastify/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @modelcontextprotocol/fastify
22

3+
## 2.0.0-beta.3
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [[`1b90c96`](https://github.com/modelcontextprotocol/typescript-sdk/commit/1b90c96d11fd17016d2977cae9dd661de3fb84df), [`561c6d8`](https://github.com/modelcontextprotocol/typescript-sdk/commit/561c6d83456ef98d6c713bbda9837e64337f22c9), [`ce2f65d`](https://github.com/modelcontextprotocol/typescript-sdk/commit/ce2f65db0e019506f4d2526466ec8cc7106de98e), [`e8de519`](https://github.com/modelcontextprotocol/typescript-sdk/commit/e8de519d3129f46b7528d2999b7641f55be1f091), [`7635115`](https://github.com/modelcontextprotocol/typescript-sdk/commit/7635115d0112c3f980b45a9773a4770660af8aae), [`61866d7`](https://github.com/modelcontextprotocol/typescript-sdk/commit/61866d7a5ff4475663ceb525c88447c497c1b92a)]:
8+
- @modelcontextprotocol/server@2.0.0-beta.3
9+
310
## 2.0.0-beta.2
411

512
### Patch Changes

packages/middleware/fastify/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@modelcontextprotocol/fastify",
33
"private": false,
4-
"version": "2.0.0-beta.2",
4+
"version": "2.0.0-beta.3",
55
"description": "Fastify adapters for the Model Context Protocol TypeScript server SDK - Fastify middleware",
66
"license": "MIT",
77
"author": "Anthropic, PBC (https://anthropic.com)",

packages/middleware/hono/CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# @modelcontextprotocol/hono
22

3+
## 2.0.0-beta.3
4+
5+
### Patch Changes
6+
7+
- [#2441](https://github.com/modelcontextprotocol/typescript-sdk/pull/2441) [`561c6d8`](https://github.com/modelcontextprotocol/typescript-sdk/commit/561c6d83456ef98d6c713bbda9837e64337f22c9) Thanks [@felixweinberger](https://github.com/felixweinberger)! - POSTs whose `Content-Type` media type is not `application/json` are now
8+
rejected with `415 Unsupported Media Type`; the header is parsed instead of
9+
substring-matched. Previously any value merely containing the substring
10+
passed the check (for example `text/plain; a=application/json`), case
11+
variants were wrongly rejected, and the 2026-07-28 entry did not inspect
12+
`Content-Type` at all — requests with a missing or non-JSON header that used
13+
to be served on that path now also answer 415. Values with parameters
14+
(`application/json; charset=utf-8`, including malformed parameter sections
15+
like `application/json;`) continue to work. SDK clients always send the
16+
correct header and are unaffected.
17+
18+
The new `isJsonContentType(header)` helper is exported for transport and
19+
framework-adapter authors — custom entries composing the exported building
20+
blocks (`classifyInboundRequest`, `PerRequestHTTPServerTransport`) must apply
21+
it themselves. The hono adapter's JSON body pre-parse and the client's
22+
response dispatch now use the same parsed-media-type comparison.
23+
24+
- Updated dependencies [[`1b90c96`](https://github.com/modelcontextprotocol/typescript-sdk/commit/1b90c96d11fd17016d2977cae9dd661de3fb84df), [`561c6d8`](https://github.com/modelcontextprotocol/typescript-sdk/commit/561c6d83456ef98d6c713bbda9837e64337f22c9), [`ce2f65d`](https://github.com/modelcontextprotocol/typescript-sdk/commit/ce2f65db0e019506f4d2526466ec8cc7106de98e), [`e8de519`](https://github.com/modelcontextprotocol/typescript-sdk/commit/e8de519d3129f46b7528d2999b7641f55be1f091), [`7635115`](https://github.com/modelcontextprotocol/typescript-sdk/commit/7635115d0112c3f980b45a9773a4770660af8aae), [`61866d7`](https://github.com/modelcontextprotocol/typescript-sdk/commit/61866d7a5ff4475663ceb525c88447c497c1b92a)]:
25+
- @modelcontextprotocol/server@2.0.0-beta.3
26+
327
## 2.0.0-beta.2
428

529
### Patch Changes

0 commit comments

Comments
 (0)