@modelcontextprotocol/sdk@1.32.2 + zod 4.6.7 emits $schema draft-07 on every inputSchema/outputSchema, which a 2020-12-only validator rejects, and swapping the $schema string breaks z.tuple fields. @modelcontextprotocol/server@2.4.0 emits 2020-12, but a v1 client then rejects any tuple in structuredContent with -32602.
What happened
Registered one tool with Zod input and output shapes on both SDK lines, listed it over an in-memory transport, and compiled each advertised schema with Ajv's 2020-12 validator. Ajv2020 only knows the 2020-12 meta-schema, like the strict client validator quoted in the issues below.
| server | $schema in tools/list | strict 2020-12 compile | |---|---|---| | @modelcontextprotocol/sdk 1.32.2 (v1, latest) | http://json-schema.org/draft-07/schema# | rejects input + output | | @modelcontextprotocol/server 2.4.0 (v2) | https://json-schema.org/draft/2020-12/schema | ok |
Claude Desktop/Claude Code rejects these tools with the same error text people quote in the issues: JSON Schema declares an unsupported dialect ("$schema": "http://json-schema.org/draft-07/schema#"). I did not run the Claude apps. The Ajv2020 check here reproduces the same rejection.
Two traps in the obvious fixes
1. Rewriting the `$schema` string on v1 is not enough. v1 emits tuples in draft-07 form (items: [..], additionalItems: false). Under 2020-12 that is invalid: schema is invalid: data/properties/pair/items must be object,boolean. 2. Upgrading the server to v2 breaks v1 clients that receive tuples. v2 emits prefixItems: [..], items: false. A v1 client (1.32.2) validates structuredContent with a draft-07 Ajv. That Ajv ignores prefixItems and applies items: false to every element:
v2 server -> v1 client (tuple) callTool FAILS: MCP error -32602: Structured content does not match the tool's output schema: data/pair/0 boolean schema is false, data/pair/1 boolean schema is falsev2 server -> v1 client (no tuple) callTool OKv1 server -> v2 client (tuple) callTool OKVersions
node 26.11.1, @modelcontextprotocol/sdk 1.32.2, @modelcontextprotocol/server + client 2.4.0, zod 4.6.7, ajv 8.20.0, macOS.
Repro
npm i # package.json in this foldernode draft07.mjs # dialect advertised by v1 vs v2node draft07-workaround.mjs # A/B/C workarounds on v1node draft07-crossversion.mjs # v1/v2 server x client with a z.tuple outputRaw output: output.txt.
Fix / workaround
- New servers: use v2 (
@modelcontextprotocol/server≥ 2.0). It emits 2020-12 by default. - If any client may still be built on v1 (
@modelcontextprotocol/sdk1.x), don't usez.tupleinoutputSchema. Use an object ({ key, value }) instead. With no tuples, all four server/client combinations pass. - If you must stay on v1: wrap the server transport's
sendand replace each tool's schemas withz.toJSONSchema(z.object(shape), { target: "draft-2020-12", io: "input" | "output" })(variant B indraft07-workaround.mjs). Avoid tuples here too (variant C). Otherwise v1 clients reject the call. - Some people drop
outputSchemaaltogether. That also works, but you lose structured-output validation.
Docs status
- The v2 upgrade guide (
docs/migration/upgrade-to-v2.md, 59 lines) anddocs/troubleshooting.mdnever mention JSON Schema dialects, draft-07 or tuples. The only place 2020-12 shows up in the docs is sampletools/listoutput indocs/serving/*.md. - Two v1 PRs change the default: #2085 (opened in May) and #2653. Both were still unmerged on 2026-12-01, and 1.32.2 (2026-10-23) is the latest v1 release.
Who's hitting it
- https://github.com/modelcontextprotocol/typescript-sdk/issues/2721 (open, 9 comments: server-filesystem, Perplexity's MCP server and others broken in Claude Desktop/Code)
- https://github.com/modelcontextprotocol/typescript-sdk/issues/2677 (open, 10 comments)
- https://github.com/modelcontextprotocol/typescript-sdk/issues/2084 (open since 1.29.0)
- I couldn't find an issue for the v2-server → v1-client tuple failure.