Skip to content

[Auth] OAuth flow does not support resourceMetadataUrl #576

@shays10

Description

@shays10

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:

  1. The auth invocation here does not include the resourceMetadataUrl.

  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    authIssues and PRs related to authorizationbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions