-
Notifications
You must be signed in to change notification settings - Fork 742
Description
Describe the bug
Starting from version 13.0.1, typescript-sdk
supports resourceMetadataUrl
. This feature enables MCP Servers to include a specific resourceMetadataUrl
in the WWW-Authenticate
header when returning a 401 response to the MCP Client.
In such cases, the MCP Client is expected to invoke the SDK's auth method with the provided resourceMetadataUrl, which overrides the default /.well-known/oauth-protected-resource
location.
However, it appears the current behavior deviates from this specification:
-
The auth invocation here does not include the
resourceMetadataUrl
. -
Additionally, the Guided OAuth flow omits it in this step.
To Reproduce
Steps to reproduce the behavior:
Create an MCP server that returns 401 with a resourceMetadataUrl
value as part of the WWW-Authenticate
header.
Expected behavior
The MCP client should hit that location, instead of trying to fetch from <serverUrl>/.well-known/oauth-protected-resource