Model Context Protocol · sdk · fg-0525

MCP server on SDK v2 starts fine but tools/list fails because package.json still allows Zod 3

If you see client.listTools() returns an error pointing at fromJsonSchema() while the server keeps running, the cause and the fix for Model Context Protocol are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
client.listTools() returns an error pointing at fromJsonSchema() while the server keeps runningTypecheck and startup pass, and the failure appears only on the first tools/list
Cause
SDK v2 supports only Zod 4, and Zod 4.2 or later converts itself to JSON Schema. A Zod 3 range that satisfied the v1 peer installs and typechecks under v2, then registration skips the schema without throwing.
Fix
Declare zod ^4.2.0 in package.json, reinstall, and confirm a single copy with npm ls zod.
Apply
"dependencies": { "@modelcontextprotocol/server": "^2.3.0", "zod": "^4.2.0" } // then: npm install && npm ls zod
Affected
@modelcontextprotocol/server 2.x; Zod 3 unsupported, Zod 4.0 to 4.1 lack self-conversion; as of 2026-10
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun