| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
🦋 Changeset detectedLatest commit: 0c20a9b 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 |
Sorry, something went wrong.
|
@modelcontextprotocol/client
npm i https://pkg.pr.new/@modelcontextprotocol/client@2170
npm i https://pkg.pr.new/@modelcontextprotocol/codemod@2170
npm i https://pkg.pr.new/@modelcontextprotocol/core@2170
npm i https://pkg.pr.new/@modelcontextprotocol/server@2170
npm i https://pkg.pr.new/@modelcontextprotocol/server-legacy@2170
npm i https://pkg.pr.new/@modelcontextprotocol/express@2170
npm i https://pkg.pr.new/@modelcontextprotocol/fastify@2170
npm i https://pkg.pr.new/@modelcontextprotocol/hono@2170
npm i https://pkg.pr.new/@modelcontextprotocol/node@2170 commit: 0c20a9b |
Sorry, something went wrong.
|
Heads up on the red test (22) check: the only failure is test/server/cloudflareWorkers.test.ts > should handle MCP requests, which fails with Network connection lost inside miniflare's local Workers sim. 422 of 423 tests pass, including the three new URI-template regression tests in this PR. Looks unrelated to the multi-variable regex change here — happy to re-run if a maintainer wants a fresh CI cycle. |
Sorry, something went wrong.
…extprotocol#2166) `UriTemplate.expand` already joins multi-name expansions with commas, but `match` only emitted one regex capture per part and assigned the whole captured run to the first name. Anything past the first variable silently never matched and resources registered against templates like `data://users/{userId,format}` were unreachable. Emit one capture per name with literal commas between them in `partToRegExp`, mirroring what `expandPart` produces, so round tripping through expand and match recovers the original variables. Path / label / fragment operators get their existing literal prefix on the first capture; the bare and reserved cases just sit at the current position.
|
Rebased onto 75dc7ea6. The conflict was purely the package move in #2354 — shared/uriTemplate.ts went from packages/core to packages/core-internal, and partToRegExp is unchanged there, so the fix reapplied as-is at the new path. The changeset now names core-internal and server (core-internal is private), and the two commits are squashed into one. The bug is still live on main: for the bare operator partToRegExp pushes a single capture named part.name, and its pattern ([^/,]+) excludes the comma that expand itself writes between multi-name values, so match returns null rather than a partial result.
Worth noting the reserved and fragment forms fail differently: (.+) is greedy, so they did match, but dumped the whole run into the first name — {+a,b} gave { a: 'x,y' } and {#a,b} gave { a: '#x,y' }, keeping the # in the value. Those are wrong values rather than a null, which is the quieter of the two failures. Single-name parts and the ?/& query forms are unaffected — those already emitted one capture per name, and that early return sits above the new branch. pnpm run check:all and pnpm run build:all are clean; pnpm -r --filter '!@modelcontextprotocol/test-e2e' test gives 4106 passing across 210 files on Node 24. I did not run the conformance, e2e or bun/deno legs locally, so I'm relying on CI for those. One thing worth flagging rather than leaving for you to find: #2216 and #2218 fix the same issue. #2218 is still against the old packages/core path. #2216 is rebased and current, but scopes its branch to case '':, so it fixes {a,b} and not {/a,b}, {.a,b} or {#a,b} — the {/userId,format} case in the table above is the difference. Happy to close this in favour of #2216 if you'd rather take the smaller diff; I'd just suggest the extra operators get covered somewhere, since expand comma-joins for all of them. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Closes #2166.
What's wrong
UriTemplate.expand already supports multi-variable expansions like {userId,format} and produces values joined by commas. UriTemplate.match only emitted a single regex capture per part and assigned the entire captured run to part.name, so everything past the first variable was silently dropped. Any resource registered with a template such as data://users/{userId,format} never routed because match() returned null.
Minimal repro:
The fix
packages/core/src/shared/uriTemplate.ts:
? and & (form-style query strings) were already handled by the earlier branch and are untouched.
Tests
packages/core/test/shared/uriTemplate.test.ts:
pnpm --filter @modelcontextprotocol/core lint and typecheck clean. Lefthook pre-push (typecheck, build, lint) all green.