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
{{ message }}
Repository navigation
Commit c5e3f6f
Browse filesBrowse the repository at this point in the historyBrowse files
fix(http): preserve feature query across OAuth resource metadata
Review on #3146 identified that a query-bearing MCP server URL breaks
OAuth protected-resource metadata discovery: go-sdk v1.7.0 validates
metadata.resource with exact string equality against the full server
URL, but BuildResourceMetadataURL and buildResourceURL dropped the
request's RawQuery, so clients connecting to e.g.
/mcp/x/issues?features=issue_dependencies
received challenge and metadata URLs without the query and could reject
the metadata as belonging to a different resource (RFC 9728).
- Preserve r.URL.RawQuery in both the advertised resource_metadata URL
and the metadata document's resource via a shared AppendQuery helper.
- Make feature selection presence-based: the features query parameter
and the X-MCP-Features header are separate channels that are never
combined; query wins when both are present.
- Extend TestOAuthChallengeMetadataRouteContracts with a query-bearing
MCP URL round-trip (challenge URL + metadata.resource exact match).
- Add TestWithRequestConfigFeatureSelection covering all four channel
combinations, plus unit tests for query preservation in
TestBuildResourceMetadataURL.
0 commit comments