Preserve paths when building PRM URL, per specification.#722
Closed
jaredhanson wants to merge 2 commits intomodelcontextprotocol:mainfrom
Closed
Preserve paths when building PRM URL, per specification.#722jaredhanson wants to merge 2 commits intomodelcontextprotocol:mainfrom
jaredhanson wants to merge 2 commits intomodelcontextprotocol:mainfrom
Conversation
Contributor
|
Hey @jaredhanson, thanks for sending this! I think this is now superseded by #756, but happy to reopen if not :-) |
Pizzaface
pushed a commit
to RewstApp/mcp-inspector
that referenced
this pull request
Aug 20, 2025
…h-flows Align Quick OAuth Flow and Simple Connect Flow with Guided OAuth Flow behavior
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Preserves paths and query parameters when making Protected Resource Metdata requests, per section 3.1 of RFC 9728.
Motivation and Context
This is important for security hardening of MCP, ensuring that clients can validate that the resource metadata they are using correlates with the resource they are accessing.
How Has This Been Tested?
We (@keycardlabs) are building an identity and access system for agents, and ensuring that SDKs are implementing the relevant OAuth bits in accordance with specifications.
Unit tests have been supplied.
Breaking Changes
This returns PRM URLs that include path components, whereas before the
getOAuthProtectedResourceMetadataUrl()function did not. This may be considered a breaking change, but also brings it inline with the specifications.Types of changes
Either a bug fix or a breaking change (or both), depending on perspective.
Checklist
Additional context
There's a discussion about expected behavior on the OAuth mailing list.
As far as I can see, proper validation of resource indicators is very lax in the MCP specification and implementations. This is leading to a number of security vulnerabilities. I've outlined this here, and there's a related issue in the MCP specification.
I'm trying to work with both the specification authors and SDK implementers to improve the security posture of MCP. This PR is part of that effort :).