Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 4d091aa The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@modelcontextprotocol/client
@modelcontextprotocol/codemod
@modelcontextprotocol/core
@modelcontextprotocol/server
@modelcontextprotocol/server-legacy
@modelcontextprotocol/express
@modelcontextprotocol/fastify
@modelcontextprotocol/hono
@modelcontextprotocol/node
commit: |
|
Read the diff (didn't run the suite). Keeping the trailing slash on non-root paths matches RFC 9728 section 3.1 as I read it: only the slash right after the host is dropped before The risk is the one the changeset already names: a server that only serves the stripped |
What's the concern here -- if a server has a resource of |
|
Yes, that is the case I meant, and I agree with you that strict is right. RFC 9728 §3.1 builds the metadata URL by inserting the well-known segment between host and path and keeping the path as written, so If a transitional fallback is added anyway, I would put it after the exact URL and before the root document, and pin that order in a test. Falling through to root is the worse outcome because root may describe a different resource. The fallback result could also be checked against the §3.3 Do you know whether the existing OAuth conformance servers publish under a trailing-slash path, or only the stripped form? |
|
Let's see what the maintainer(s) say, but I'm glad we're agreed that transitional support for buggy MCP servers is a waste of everyone's time. FYI: §3.3 validation is mandatory -- it's "must be checked" rather than "could be checked". The SDK is currently more permissive than this but IMO that should be a separate change (and probably requires some discussion / alignment first!). The current conformance metadata-discovery scenarios use /mcp without a trailing slash so this case doesn't apply. |
JosephDoUrden
left a comment
There was a problem hiding this comment.
ran client auth.test (278/278), server oauthMetadata.test (19/19), authUtils (12/12). also ran the client against our own oauthMetadataResponse with /mcp, /mcp/ and ?query on both sides, first probe hits every time. merges clean with #3042. small thing: server oauthMetadata.ts:102 still strips the slash when building the PRM path, so client and server disagree now. follow-up, lgtm
e81b65a to
4d091aa
Compare
|
@JosephDoUrden 👋 Hey - picking this up on Ben's behalf. Thank you for taking the time to review; I've adjusted the PR to fix that small point. Is there anything else you'd like to see for us to get this merged? Thanks! |
Motivation and Context
When requesting
server.com/resource/, the SDK usesserver.com/.well-known/oauth-protected-resource/resourcefor the OAuth Protected Resource metadata. This is a bug -- RFC 9728 §3.1 requires removal of a "terminating slash (/) following the host component" but not following the path. This PR fixes the bug.How Has This Been Tested?
I created new unit tests to test this.
Breaking Changes
None.
Types of changes
Checklist