Uh oh!
There was an error while loading. Please reload this page.
feat(client): name AuthOptions; add iss/skipIssuerMetadataValidation and OAuthClientInformationContext - #2343
Conversation
🦋 Changeset detectedLatest commit: be75471 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
@modelcontextprotocol/client@modelcontextprotocol/codemod@modelcontextprotocol/server@modelcontextprotocol/server-legacy@modelcontextprotocol/express@modelcontextprotocol/fastify@modelcontextprotocol/hono@modelcontextprotocol/nodecommit: |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
0fdbe45 to
f6fb29cCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
f6fb29c to
d1ffd2fCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ec501fa to
874ca25CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…, authErrors module 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
874ca25 to
be75471CompareUh oh!
There was an error while loading. Please reload this page.
…and OAuthClientInformationContext (#2343)
d57c32e46Surface delta for the 2026-07-28 authorization requirements. Extracts the inline
auth()options object as the exportedAuthOptionstype and adds two fields:iss(the RFC 9207 callback parameter) andskipIssuerMetadataValidation(the RFC 8414 §3.3 opt-out).OAuthClientProvider.clientInformation()and.saveClientInformation()accept an optionalOAuthClientInformationContextcarrying the resolved authorization-server issuer so providers can key persisted credentials per AS.OAuthClientMetadataSchemagainsapplication_type?: 'native' | 'web';AuthorizationServerMetadatagainsauthorization_response_iss_parameter_supported?: boolean.Motivation and Context
This is the additive-only surface PR for the M13.1 auth bundle (SEP-2468 / SEP-2352 / SEP-2350 / SEP-837 / SEP-2207 — see docs/2026-06-19-m13-auth-bundle-prd.md). It introduces every public-API field and type the behavior PRs depend on so that each subsequent PR carries only behavior, and so that existing
OAuthClientProviderimplementers (Claude Code is the named consumer) can be reviewed against the final shape once.No spec MUST is implemented in this PR — all new fields are inert.
How Has This Been Tested?
pnpm typecheck:all,pnpm lint:all,pnpm --filter @modelcontextprotocol/client test. The barrelClean test confirms the new exports do not pull Node-only modules into the runtime-neutral entry. No behavior tests change.Breaking Changes
None. All new fields are optional; existing
OAuthClientProviderimplementations andauth()call sites compile unchanged.Types of changes
Checklist
Additional context
First PR in a 7-PR stack. The five behavior PRs that follow wire each field up; the closeout PR consolidates
migration.mdand the client guide. Reviewing the surface in isolation makes the additive-optional invariant (PRD §Implementation Decisions, "Surface delta") auditable independently of behavior.