Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 50e59af 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. |
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