Skip to content

/.well-known/openid-configuration/mcp serves guessed endpoints and hard-coded scopes #263

Closed

Description

@mcollina

GET /.well-known/openid-configuration/mcp (src/routes/well-known.ts) builds authorization-server metadata out of the configured authorizationServers[0]:

  • token_endpoint and token_introspection_endpoint are guessed by appending fixed paths (/oauth/token, …) to the issuer;
  • scopes_supported is hard-coded to ['read','write','mcp:resources','mcp:prompts','mcp:tools'], regardless of requiredScopes.

Authorization-server metadata belongs to the authorization server; MCP clients discover it from the authorization_servers listed in the protected-resource metadata (spec: Authorization Server Discovery). A client that lands on this route gets wrong endpoints and scopes. The route is not documented in the README.

Repro

authorizationServers: ['https://login.example.com/tenant1'], requiredScopes: ['files:read'] → token_endpoint: https://login.example.com/tenant1/oauth/token, scopes_supported without files:read.

Suggested fix

Remove the route, or make it opt-in and populated only from configured values. Maintainer decision.

Found during the round-7 review of #170; also on main.

🤖 Generated with Claude Code

Activity

  1. added a commit that references this issue on Oct 14, 2026
    645d773
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions