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
Describe the bug
Starting from version 13.0.1,
typescript-sdksupportsresourceMetadataUrl. This feature enables MCP Servers to include a specificresourceMetadataUrlin theWWW-Authenticateheader 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-resourcelocation.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
resourceMetadataUrlvalue as part of theWWW-Authenticateheader.Expected behavior
The MCP client should hit that location, instead of trying to fetch from
<serverUrl>/.well-known/oauth-protected-resource