Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 5632f56 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: |
094ffba to
ef21c1f
Compare
There was a problem hiding this comment.
Assisted by AI for SDK testing and review drafting.
I built 313abe6 and its upstream parent 919bb8e and ran both through the real SDK Client.listResourceTemplates() and Client.readResource() with an in-memory transport. The omitted, partial, and reordered query cases all work on this PR.
I found a routing regression with two resource templates registered on the same path:
mem://library/document/{id}{?summary}
mem://library/document/{id}{?revision}
On the parent, ?summary=compact and ?revision=42 each reach the callback that declares that key. On this head, both reads go to the first registered callback. For example, with the summary template registered first, a read with ?revision=42 returns summary content and the callback only receives id. Reversing registration order reverses which read goes to the wrong callback.
Could we preserve that distinction while allowing callers to omit or reorder the declared keys? A paired resources/read test would cover the difference that the single-template unit tests miss.
|
@ychampion Thanks for testing both registration orders. The query matcher now checks each key against the ones declared by its template, so reads with |
Summary
UriTemplate.match()so{?a,b}query operators match when query params are omitted, partial, or supplied out of declaration orderdom://{pageId}{?...}matchingFixes #1079
Validation
npx --yes [email protected] --filter @modelcontextprotocol/core-internal test -- uriTemplatenpx --yes [email protected] --filter @modelcontextprotocol/core-internal typechecknpx --yes [email protected] --filter @modelcontextprotocol/core-internal lintNote: local
git pushwas run with--no-verifybecause the repo pre-push hook invokes the system Corepack installation, which fails before running checks withCannot find matching keyidfor pnpm. The same package checks above were run explicitly with[email protected]vianpxand passed.