feat(server): runtime-neutral OAuth discovery serving for web-standard hosts (#2422)
This commit is contained in:
parent
ce2f65db0e
commit
61866d7a5f
1 changed files with 465 additions and 76 deletions
17
.changeset/web-standard-oauth-metadata.md
Normal file
17
.changeset/web-standard-oauth-metadata.md
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
'@modelcontextprotocol/server': minor
|
||||
'@modelcontextprotocol/express': patch
|
||||
---
|
||||
|
||||
Add runtime-neutral OAuth discovery serving to `@modelcontextprotocol/server`:
|
||||
`oauthMetadataResponse` serves the RFC 9728 Protected Resource Metadata and
|
||||
RFC 8414 Authorization Server metadata documents from web-standard
|
||||
`fetch(request)` hosts, built on the exported
|
||||
`buildOAuthProtectedResourceMetadata`, with
|
||||
`getOAuthProtectedResourceMetadataUrl` now defined here. The Express metadata
|
||||
router adapts the same core and is unchanged in behavior; the insecure-issuer
|
||||
escape hatch is an explicit `dangerouslyAllowInsecureIssuerUrl` option in the
|
||||
neutral core instead of a module-scope environment read. The web-standard
|
||||
matcher validates lazily so unmatched traffic always falls through, tolerates
|
||||
a trailing slash, supports HEAD, and marks reflected CORS preflights with
|
||||
`Vary`.
|
||||
Loading…
Reference in a new issue