Skip to content

/.well-known/oauth-protected-resource returns 404 while /.well-known/oauth-protected-resource/mcp returns 200 #2077

@xanoysky

Description

@xanoysky

Description

When deployed, the OAuth protected-resource discovery endpoint is sometimes only exposed under the MCP mount prefix (e.g. /mcp/.well-known/oauth-protected-resource) while the standard root path /.well-known/oauth-protected-resource returns 404. This breaks VS Code and other OAuth clients that expect the standard discovery URL.

Example logs:

INFO: xx.xxx.xx.xx:YYYYY - "GET /.well-known/oauth-protected-resource HTTP/1.1" 404 Not Found
INFO: xx.xxx.xx.xxx:YYYYY - "GET /.well-known/oauth-protected-resource/mcp HTTP/1.1" 200 OK

Example Code

Version Information

FastMCP version:                                                                        2.12.4
MCP version:                                                                            1.13.1
Python version:                                                                         3.11.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    authRelated to authentication (Bearer, JWT, OAuth, WorkOS) for client or server.bugSomething isn't working. Reports of errors, unexpected behavior, or broken functionality.httpRelated to HTTP transport, networking, or web server functionality.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions