Repository navigation
test(mcp, cloudflare): test against the 2026-07-28 protocol only - #2552
Conversation
More templates
@orpc/ai-sdk
@orpc/arktype
@orpc/bun
@orpc/client
@orpc/cloudflare
@orpc/contract
@orpc/effect
@orpc/evlog
@orpc/hibernation
@orpc/json-schema
@orpc/experimental-lock
@orpc/mcp
@orpc/msw
@orpc/nest
@orpc/next
@orpc/node
@orpc/openapi
@orpc/experimental-openapi-inference
@orpc/opentelemetry
@orpc/pinia-colada
@orpc/pino
@orpc/publisher
@orpc/ratelimit
@orpc/server
@orpc/shared
@orpc/swr
@orpc/tanstack-query
@orpc/trpc
@orpc/valibot
@orpc/zod
commit: |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
orpc | afc11b6 | Commit Preview URL Branch Preview URL |
Nov 25 2026, 06:07 AM |
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
There was a problem hiding this comment.
✅ No new issues found.
Approach: sound — the tests pin the era-dependent MCP SDK projection at the exact seam (tools/list schema wrapping and tools/call structuredContent wrapping) rather than duplicating registrar logic.
Reviewed changes
- Non-object output matrix — an
it.eachtable covers string, number, boolean,null, and array outputs against bothPROTOCOL_ERAS, asserting the typed tool's advertised schema (wrapped as{ type: 'object', properties: { result: … }, required: ['result'] }onlegacy, unwrapped onmodern), the untyped tool's absentoutputSchema, and the unchangedtextblock plus era-dependentstructuredContent. - Non-object schema root — covers a union-root output schema (
z.union([planetSchema, z.array(planetSchema)])) where the value is an object but the schema root is not, exercising the SDK'sadvertisedOutputSchema-driven wrapping path rather than the value-driven one.
I verified the assertions against @modelcontextprotocol/server@2.4.0: isNonObjectJsonSchemaRoot is type !== 'object', and the 2025 codec wraps when either the value or the schema root is non-object. pnpm exec vitest run packages/mcp/src/registrar.test.ts passes (76 tests) and npx oxlint packages/mcp/src/registrar.test.ts is clean.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
There was a problem hiding this comment.
ℹ️ No critical issues — one coverage note inline.
Approach: sound — narrowing the suite to the 2026-07-28 protocol removes the per-era branching and lets the assertions pin one shape; the registrar itself is era-agnostic, so the test helper now drives it through the real modern serving path (createMcpHandler with legacy: 'reject').
Reviewed changes
- Era matrix collapsed —
describe.each(PROTOCOL_ERAS)became a single suite, and everyera === 'legacy'conditional (schema wrapping,resultnesting) was reduced to the 2026-07-28 shape. - Helper simplified —
createTestClientalways serves fresh servers overStreamableHTTPClientTransportwith a client pinned to2026-07-28; theInMemoryTransportlegacy branch is gone. - Cloudflare request made modern — the lazy-router test now sends
mcp-protocol-version/mcp-method/mcp-nameheaders plusparams._metaand parses a plain JSON response instead of an SSE frame. - Non-object outputs covered — an
it.eachover string/number/boolean/null/array plus a union-root output schema pin the advertised schema, thetextblock, andstructuredContent. - Modern result shape pinned — assertions now account for the
_metaevery 2026-07-28 result carries and forFilevalues serializing to{}over HTTP.
I verified the delta locally: registrar.test.ts (62 tests) and the @orpc/cloudflare suite (92 tests, workerd) pass, oxlint and tsc --noEmit on packages/mcp are clean.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No new issues in the two follow-up commits — the docs statement checks out and the test cleanup removes real duplication.
Reviewed changes
- Protocol scope documented —
mcp.mdxnow states that only the 2026-07-28 revision is supported and showscreateMcpHandler(factory, { legacy: 'reject' })as the way to reject older clients; I confirmed the spec link resolves and thatlegacy: 'reject'really drops the legacy serving path in@modelcontextprotocol/server2.4.0. - Duplicated output tests removed — the standalone
planet_listandplanet_describeoutput tests are gone; theit.eachtable already asserts the sametextandstructuredContentfor array and string outputs on both typed and untyped tools. - Duplicate suite merged — the second
describe('mcpRegistrar')block was folded into the first, so the file no longer has two sibling suites with the same name.
packages/mcp/src/registrar.test.ts passes (60 tests).
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the one-line change since the prior pullfrog review (6f31736), which switches the shared test client to versionNegotiation: { mode: 'auto' }.
- Negotiation path covered again —
connectTestClientnow lets every test client probeserver/discoverand negotiate against thelegacy: 'reject'handler instead of pinning2026-07-28, which retires the earlier coverage note; the handler still rejects the legacyinitializefallback, so a run can only pass on a mutually negotiated modern revision (2026-07-28is the only modern revision in SDK 2.4.0).
Verified locally: pnpm exec vitest run packages/mcp/src — 95 passed (60 in registrar.test.ts).
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

@orpc/mcptargets the 2026-07-28 MCP protocol only, so the tests no longer run against the 2025-era protocol.createMcpHandlerwithlegacy: 'reject', so every test runs on 2026-07-28. The in-memory legacy path and the per-era test matrix are gone, and the per-request context test reuses the helpers instead of building its own client.resultnesting the MCP SDK applies for older clients, are reduced to the 2026-07-28 shape, and tests the new cases duplicate are removed.tools/callrequest instead of a legacy one.null, and array outputs with and without an output schema, and an object output whose output schema has no object root (a union).registrar.tsandutils.tsthat only restate what a test already asserts. Public JSDoc is unchanged.No behavior change.