Skip to content

Advertise scopes_supported separately from required_scopes #3778

Open

Description

@tlwns

Description

AuthSettings.required_scopes is used both to refuse tokens (RequireAuthMiddleware) and as scopes_supported in the protected resource metadata. So a server can't advertise a scope without requiring it on every request.

Our server's read tools need returns:read. One write tool also needs returns:write, which its handler checks with get_access_token(). We want read-only tokens to keep working, so we set required_scopes=["returns:read"]. But then the metadata lists only returns:read, and a client that takes its scopes from scopes_supported never asks for returns:write.

auth=AuthSettings(
    issuer_url=AnyHttpUrl("https://auth.example.com"),
    resource_server_url=AnyHttpUrl("http://127.0.0.1:8000/mcp"),
    required_scopes=["returns:read"],
)
# GET /.well-known/oauth-protected-resource/mcp
# -> "scopes_supported": ["returns:read"], with no way to also advertise "returns:write"

Proposal: an optional AuthSettings.scopes_supported, used for the metadata and defaulting to required_scopes. FastMCP's RemoteAuthProvider already separates these, and the TypeScript SDK's scoped-tools example advertises more scopes than it challenges for.

Our workaround is to insert our own route ahead of the SDK's at the same path. #3277 couples the challenge's scope to required_scopes in the same way.

Seen on mcp 2.3.0. I'm happy to open a PR if a maintainer assigns this.

This issue was written primarily by Claude Code. I hit this problem in our MCP server, and I've reviewed the issue.

References

Activity

  1. added
    enhancementRequest for a new feature that's not currently supported
    on Oct 28, 2026
  2. Ben-Home commented on Oct 29, 2026

    @Ben-Home
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementRequest for a new feature that's not currently supported

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions