You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Surface delta for the 2026-07-28 authorization requirements. All additive;
existing OAuthClientProvider implementers compile unchanged. The new fields
are inert until the behavior changes that follow wire them up.
- Extract the inline auth() options object as exported AuthOptions and add
iss (RFC 9207 callback parameter) and skipIssuerMetadataValidation
(RFC 8414 §3.3 opt-out). JSDoc is non-assertive — validation lands in
the follow-up commit.
- OAuthClientProvider.clientInformation/saveClientInformation/tokens/
saveTokens accept an optional OAuthClientInformationContext carrying the
resolved authorization-server issuer so providers can key persisted
credentials per AS.
- OAuthTokens and OAuthClientInformation gain an optional issuer stamp
field (core/shared/auth.ts) — the slot the SDK writes before persistence
so stored credentials are bound to the AS that issued them.
- New packages/client/src/client/authErrors.ts with the OAuthClientFlowError
base class; the flow-specific error classes from later commits land here.
Claude-Session: https://claude.ai/code/session_01XBib5gRe8AMPPJhySCz3EJ
Add the public surface for the 2026-07-28 authorization requirements. New `AuthOptions` type names the `auth()` options object and adds `iss` and `skipIssuerMetadataValidation` fields. `OAuthClientProvider.clientInformation()` / `.saveClientInformation()` / `.tokens()` / `.saveTokens()` accept an optional `OAuthClientInformationContext` carrying the authorization server's `issuer` so providers can key persisted credentials per authorization server. `OAuthTokens` and `OAuthClientInformation` gain an optional `issuer` stamp field. New `OAuthClientFlowError` base class in `authErrors.ts` for the flow-specific error classes that follow. All changes are additive — existing `OAuthClientProvider` implementations compile unchanged; the new fields are inert until the behavior changes that follow wire them up.
Copy file name to clipboardExpand all lines: docs/migration.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1474,6 +1474,27 @@ The following APIs are unchanged between v1 and v2 (only the import paths change
1474
1474
`Session not found` — unchanged from v1. Note that this use of `-32001` is an SDK convention, not a spec-assigned error code, and it is expected to be re-derived as error handling for the 2026 protocol revision (`2026-07-28`) is adopted. Avoid hard-coding the `-32001` code in
1475
1475
client logic; key off the HTTP `404` status instead.
1476
1476
1477
+
## Authorization (2026-07-28 spec)
1478
+
1479
+
The 2026-07-28 protocol revision adds client-side authorization requirements (RFC 9207 `iss` validation, RFC 8414 §3.3 issuer-echo, per-authorization-server credential isolation, scope step-up, DCR `application_type`, and refresh-token guidance). The SDK adds the public surface for these now and will implement the parts that land in SDK code (defaulting them on) as the SEP-2468/2352/2350/837/2207 behavior changes land; the parts that live in your `OAuthClientProvider` implementation, your `clientMetadata`, or your host UI are listed under [Conformance obligations for `OAuthClientProvider` implementers](#conformance-obligations-for-oauthclientprovider-implementers).
1480
+
1481
+
### `auth()` options are now `AuthOptions`
1482
+
1483
+
The inline options object on `auth()` is now the named `AuthOptions` type, exported from `@modelcontextprotocol/client`. Existing call sites need no change. New fields (both currently inert — the validation behavior they feed lands in the follow-up changes tracked by SEP-2468):
1484
+
1485
+
-`iss?: string` — the form-urldecoded `iss` query parameter from the authorization callback. Pass it alongside `authorizationCode`; it is forwarded to RFC 9207 issuer validation once that lands.
1486
+
-`skipIssuerMetadataValidation?: boolean` — opt-out for the RFC 8414 §3.3 issuer-echo check during discovery. **Security-weakening**; use only with authorization servers known to publish a mismatched `issuer`.
1487
+
1488
+
### `OAuthClientProvider` credential methods receive an `issuer` context
1489
+
1490
+
`clientInformation(ctx?)`, `saveClientInformation(info, ctx?)`, `tokens(ctx?)`, and `saveTokens(tokens, ctx?)` now receive an optional `OAuthClientInformationContext` parameter carrying `{ issuer: string }` — the authorization server's `issuer` identifier. Providers that persist credentials should key storage by this value so that credentials registered with one authorization server are never sent to another. Providers with a single credential set may ignore the parameter; existing implementations compile unchanged. The SDK does not yet pass this argument; it begins doing so when the SEP-2352 behavior change lands.
1491
+
1492
+
`OAuthTokens` and `OAuthClientInformation` also gain an optional `issuer?: string` field. Once the SEP-2352 behavior change lands the SDK will stamp this onto credentials before calling `saveTokens` / `saveClientInformation`; provider implementations should round-trip it unchanged. The field is currently inert.
1493
+
1494
+
### Conformance obligations for `OAuthClientProvider` implementers
1495
+
1496
+
<!-- Filled in as the SEP-2468/2352/2350/837/2207 behavior PRs land. -->
1497
+
1477
1498
## Using an LLM to migrate your code
1478
1499
1479
1500
An LLM-optimized version of this guide is available at [`docs/migration-SKILL.md`](migration-SKILL.md). It contains dense mapping tables designed for tools like Claude Code to mechanically apply all the changes described above. You can paste it into your LLM context or load it as
0 commit comments