You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When serverUrl = "https://mcp-oauth-ex2.val.run/mcp", this produced "https://mcp-oauth-ex2.val.run/.well-known/oauth-protected-resource" (dropping the /mcp path).
Solution
Changed all instances to use relative paths instead of absolute paths:
✅ Error handling with correct URLs in error messages
✅ Localhost URLs with ports and paths
✅ Edge cases: trailing slashes, query parameters
Key Test Cases:
Tests verify that https://mcp-oauth-ex2.val.run/mcp produces metadata URLs like https://mcp-oauth-ex2.val.run/mcp/.well-known/oauth-protected-resource (preserving the /mcp path)
Tests ensure the fix prevents dropping server URL paths in metadata discovery URLs
Coverage for both resource metadata and authorization server metadata URL construction
The tests validate that the previous fix correctly changed from absolute paths (/.well-known/...) to relative paths (.well-known/...) to preserve server URL path structure.
@olaservo Claude's solution here misses the mark. According to RFC 9728
If the resource identifier value contains a path or query component, any terminating slash (/) following the host component MUST be removed before inserting /.well-known/ and the well-known URI path suffix between the host component and the path and/or query components. The consumer of the metadata would make the following request when the resource identifier is https://resource.example.com/resource1 and the well-known URI path suffix is oauth-protected-resource to obtain the metadata, since the resource identifier contains a path component:
GET /.well-known/oauth-protected-resource/resource1 HTTP/1.1
Host: resource.example.com
Using path components enables supporting multiple resources per host. This is required in some multi-tenant hosting configurations. This use of .well-known is for supporting multiple resources per host; unlike its use in [[RFC8615](https://www.rfc-editor.org/rfc/rfc9728.html#RFC8615)], it does not provide general information about the host.
Like @ptc-ccrabb mentioned, the RFC9728 is pretty clear that the first request made should be to the resource itself, which will explain how it is protected. Then it should acquire the protected resource metadata based on the URI from the WWW-Authenticate. This makes so much more sense then doing string manipulations or having a set of hardcoded rules and trying out different URI permutations.
Thank you for reporting this, and apologies for the long wait for a response.
v1 will receive security fixes only — this issue describes a functionality, compatibility, or usability problem rather than a vulnerability, so it is being closed against v1. This is not a judgment on whether the problem is real — it's a consequence of the v1 line being frozen. This is happening as part of #1872.
If this still happens in v2, we'd genuinely like to know. v2 is a complete rewrite — three clients over a shared core — so many v1 behaviours no longer exist in the same form. Please open a fresh issue against v2 with steps to reproduce, and we'll look at it. Note that we accept external contributions as issues rather than pull requests; maintainers handle design and implementation through a prompt-driven workflow. See CONTRIBUTING.md.
Activity
olaservo commentedon Aug 23, 2025
@claude could you investigate this issue?
claude commentedon Aug 23, 2025
Claude finished @olaservo's task —— View job •
claude/issue-742-20250823-0401• Create PR ➔OAuth metadata URL path issue - Fixed! ✅
I've investigated and fixed the issue where the Inspector auth debug view was showing incorrect metadata URL paths.
Todo List:
Problem Analysis
The issue was in
client/src/components/OAuthFlowProgress.tsxwhere OAuth metadata source URLs were constructed incorrectly in four places using:When
serverUrl = "https://mcp-oauth-ex2.val.run/mcp", this produced"https://mcp-oauth-ex2.val.run/.well-known/oauth-protected-resource"(dropping the/mcppath).Solution
Changed all instances to use relative paths instead of absolute paths:
This now correctly produces
"https://mcp-oauth-ex2.val.run/mcp/.well-known/oauth-protected-resource".Changes Made
Fixed URL construction in
OAuthFlowProgress.tsxat:The fix preserves the server URL path structure while maintaining the correct well-known endpoint paths.
--- • Branch: claude/issue-742-20250823-0401
fix: preserve server URL path in OAuth metadata source display
olaservo commentedon Aug 23, 2025
@claude could you add tests to cover these scenarios?
claude commentedon Aug 23, 2025
Claude finished @olaservo's task —— View job •
claude/issue-742-20250823-0413• Create PR ➔OAuth metadata URL tests added! ✅
I've successfully added comprehensive tests to cover the OAuth metadata URL scenarios that were fixed in the previous work.
Todo List:
Tests Created
I've created a comprehensive test suite for
OAuthFlowProgressatclient/src/components/__tests__/OAuthFlowProgress.test.tsxthat covers:URL Construction Scenarios:
https://example.com)https://mcp-oauth-ex2.val.run/mcp)https://api.example.com/v1/mcp/server)Key Test Cases:
https://mcp-oauth-ex2.val.run/mcpproduces metadata URLs likehttps://mcp-oauth-ex2.val.run/mcp/.well-known/oauth-protected-resource(preserving the/mcppath)The tests validate that the previous fix correctly changed from absolute paths (
/.well-known/...) to relative paths (.well-known/...) to preserve server URL path structure.Test Coverage:
--- • Branch: claude/issue-742-20250823-0413
test: add comprehensive OAuth metadata URL construction tests
sxalexander commentedon Sep 5, 2025
@olaservo Claude's solution here misses the mark. According to RFC 9728
So for the original bug in #742 above:
Claude's fix incorrectly produces:
RFC 9728 requires discovery to check for any path or query component. So, for a Resource URI of
https://example.com/api/resourceThe resulting well-known URI path must be:
https://example.com/.well-known/oauth-protected-resource/api/resourceNot:
https://example.com/api/resource/.well-known/oauth-protected-resourcehalllo commentedon Sep 18, 2025
Seems related to #576.
Like @ptc-ccrabb mentioned, the RFC9728 is pretty clear that the first request made should be to the resource itself, which will explain how it is protected. Then it should acquire the protected resource metadata based on the URI from the WWW-Authenticate. This makes so much more sense then doing string manipulations or having a set of hardcoded rules and trying out different URI permutations.
@sxalexander Regardless if the protected resource metadata lives at
https://mcp-oauth-ex2.val.run/.well-known/oauth-protected-resource/mcp
or https://mcp-oauth-ex2.val.run/.well-known/oauth-protected-resource or https://mcp-oauth-ex2.val.run/mcp/.well-known/oauth-protected-resource, the client should try the location provided by the WWW-Authenticate first. Only if no location is provided or it does not work should it go through any insertions or permutations, etc.
cliffhall commentedon Aug 1, 2026
Closing: v1 is deprecated.
Thank you for reporting this, and apologies for the long wait for a response.
v1 will receive security fixes only — this issue describes a functionality, compatibility, or usability problem rather than a vulnerability, so it is being closed against v1. This is not a judgment on whether the problem is real — it's a consequence of the v1 line being frozen. This is happening as part of #1872.
If this still happens in v2, we'd genuinely like to know. v2 is a complete rewrite — three clients over a shared core — so many v1 behaviours no longer exist in the same form. Please open a fresh issue against v2 with steps to reproduce, and we'll look at it. Note that we accept external contributions as issues rather than pull requests; maintainers handle design and implementation through a prompt-driven workflow. See
CONTRIBUTING.md.Thanks for taking the time to report it.