Repository navigation
Conversation
🦋 Changeset detectedLatest commit: c91c251 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: |
…r.md using the repository generator. Reproduced the failure before fixing; repository-wide snippet verification and git diff --check now pass. Full check:all was not run because this worktree lacks project dependencies, including tsx
koriyoshi2041
left a comment
There was a problem hiding this comment.
Reviewed exact head c91c2518 across both supported protocol revisions. The focused raw-params suite passes 22/22, and core-internal/server typechecks, formatting, and diff hygiene are clean.
The coverage exercises the important opt-in boundary: default/explicit-false omit rawParams, unknown top-level siblings survive separately, malformed known fields still fail identically, stdio metadata normalization is not overstated as raw-wire preservation, and task/input-response lifting remains independent. I found no validation bypass or default-behavior regression in the changed path.
Related: #3008
TL;DR
Add
includeRawRequestParams, an opt-in context field for applications that need unknown request-param siblings before handler schema parsing strips them. Default behavior stays unchanged.What Problem This Solves
In both supported protocol eras, loose
tools/callfields such asresource_typeandrecord_iddisappear before an application's compatibility normalizer can read them.Why This Change Was Made
ctx.mcpReq.rawParamsexposes params after transport parsing and before handler parsing. Applications can validate the extension fields they need while using the parsed request for known fields.User Impact
The option defaults to false. Raw values remain untrusted and must not be merged over validated fields or treated as CRM attributes.
This is deliberately a post-transport boundary. For example, stdio parsing removes
extensionfrom_meta['io.modelcontextprotocol/related-task'] = { taskId: 't', extension: 'sentinel' }before capture. Unknown sibling params survive; nested schema-parsed metadata is not guaranteed unchanged. Broader pre-transport preservation would need a separate design decision.Evidence
packages/server:../../node_modules/.bin/vitest run test/server/rawRequestParams.test.ts --reporter=verbose— 22 cases passed across2025-11-25and2026-07-28, including real stdio metadata normalization.c91c25189996e9fa3b19a2e3017f1b2c2d6b7736, including the corrected generated documentation snippet.