Repository navigation
Commit 7863a78
committed
fix: upgrade MCP SDK to fix Zod 4 tool schema serialization
The bundled dist/index.js contained two Zod copies because MCP SDK
1.22.0 declared `zod: ^3.23.8` (Zod 3 only), while claudish uses
Zod 4. Bun resolved them separately, inlining both into the bundle
as exports_external (v3) and exports_external2 (v4).
This caused MCP tool schemas to serialize as empty `{"type":"object",
"properties":{}}` because the SDK wrapped Zod 4 raw shapes with Zod
3's z.object(), then zodToJsonSchema (which reads _def.typeName,
absent in Zod 4) produced no output.
MCP SDK ≥1.27.0 declares `zod: ^3.25 || ^4.0`, allowing bun to
resolve a single [email protected] for the entire dependency tree. The SDK
also ships zod-json-schema-compat.js which uses Zod 4's native
toJSONSchema() for serialization.
Also moves bundled dependencies to devDependencies since bun build
inlines everything into dist/index.js — npm installing them as
runtime dependencies is redundant.
Refs: modelcontextprotocol/typescript-sdk#16431 parent df24c7d commit 7863a78
3 files changed
Lines changed: 64 additions & 68 deletions
0 commit comments