[Bug] MCP OAuth discovery ignores path-scoped protected-resource metadata (Plane /http/mcp) #1574
misunders2d
started this conversation in
Bug reports
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
Prime Agent 0.7.4 completes the browser OAuth flow for Plane's hosted MCP, but obtains a token from the wrong authorization-server path. The browser reports Authentication successful, while the MCP endpoint then returns
401 invalid_token.This is a concrete reproduction of the RFC 9728 discovery problem previously documented in #766. That issue was closed during the move to discussion-first intake, but the behavior remains reproducible in 0.7.4.
Environment
Configuration
Reproduction
/mcp login plane.Authentication successful.Actual result:
No credentials or token values are included in this report.
Diagnosis
Plane publishes path-scoped protected-resource metadata correctly:
It identifies:
{ "resource": "https://mcp.plane.so/http/mcp", "authorization_servers": ["https://mcp.plane.so/http"] }The corresponding authorization-server metadata is available at:
and advertises
/http/authorize,/http/token, and/http/register.Prime's
discover()currently reduces the MCP URL tonew URL(url).originand probes only root authorization-server metadata. It therefore useshttps://mcp.plane.so/, which issues a token whose audience is the legacyhttps://mcp.plane.so/sseendpoint. Plane's/http/mcpresource correctly rejects that token.The same Plane configuration works in another MCP client that follows the protected-resource metadata.
Expected behavior
Prime should follow the MCP authorization discovery flow:
resource_metadatapointer from the endpoint'sWWW-Authenticateresponse when available.authorization_serversfrom that document.A regression test using Plane's
/http/mcp→/httpmetadata shape would cover this case.All reactions