Support RFC 9207 issuer identification (iss parameter) - #4
Merged
Conversation
Port of the server-side parts of SEP-2468 (MCP 2026-07-28) from modelcontextprotocol/typescript-sdk#2357. Authorization responses now carry iss on both success and error redirects, and the metadata advertises authorization_response_iss_parameter_supported. BREAKING CHANGE: issuerUrl moved from mcpAuthRouter options to OAuthServer options, which is now the single source of truth for the issuer identifier.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports the server-side authorization changes from SEP-2468 (MCP 2026-07-28 spec revision) in the MCP SDK: modelcontextprotocol/typescript-sdk#2357, landed upstream via #2286.
RFC 9207 defends against authorization server mix-up attacks: the AS appends
iss=<issuer identifier>to every authorization response redirect, and clients validate it against the discovered issuer before redeeming the code. Updated MCP SDK clients now perform this validation, so servers should emitissand advertise support.Changes
OAuthServergains anissuerUrloption — the single source of truth for the authorization server's issuer identifier (used as the RFC 8414 metadataissuerand the RFC 9207issvalue).OAuthServer.authenticate()appendsissto the success redirect back to the client'sredirect_uri.authorizationHandlerandauthenticateHandlerappendissto error redirects (RFC 9207 §2 requires it on error responses too).authorization_response_iss_parameter_supported: true; the field is added toOAuthMetadataSchema.BREAKING CHANGE
mcpAuthRouterno longer acceptsissuerUrl— it reads the issuer from the provider and throws at construction if unset:const oauthServer = new OAuthServer({ + issuerUrl: new URL('https://auth.example.com'), authorizationUrl: new URL('https://auth.example.com/consent'), ... }); app.use(mcpAuthRouter({ provider: oauthServer, - issuerUrl: new URL('https://auth.example.com'), }));Caveat
Since the metadata now claims
isssupport, a custom consent flow that issues the callback redirect itself (bypassingauthenticateHandler/OAuthServer.authenticate()) must appendiss(available asprovider.issuerUrl) — SEP-2468 clients reject callbacks that omit it when support is advertised.Tests
issasserted on success redirects (authenticate()) and error redirects (authorize handler), plus absent-when-unconfigured.authorization_response_iss_parameter_supportedand the new missing-issuerUrlthrow.iss.