What this thread does
Do first: Upgrade the MCP TypeScript SDK to 1.23.0 for the Zod compatibility change.
Symptom
Uncaught (in promise) ZodError: appears in MCP Inspector when listing tools; the reported detail is Invalid literal value, expected "object". juanlluva reported SDK 1.20.0. timurguvenkaya, max-rousseau and RahulLanjewar93 also describe the tool-listing failure in the issue comments.
Cause
The SDK needed a compatibility layer to support both Zod v3 and v4 in JSON Schema conversion. The merged PR adds a compatibility layer that detects the schema’s Zod version and routes schema operations to the appropriate implementation.
Fix
1. Use SDK 1.23.0, whose release notes include PR #1040. 2. Keep each schema shape within one Zod version. The PR supports Zod v3.25+ and v4; mixed versions within a shape are rejected at runtime. No compatibility setting is required.
Fixed in
Fixed in 1.23.0 (released 2025-11-25); PR #1040 merged 2025-11-19.
If it still fails
- RahulLanjewar93 reports a separate TypeScript type error with SDK
1.23.0; the closing maintainer comment identifies this issue’s schema-conversion failure as fixed. That does not establish a fix for every compiler diagnostic. - The v2 schema path is separate from this v1 compatibility layer.
Not for: TypeScript SDK 2.x import migration; see mcp-typescript-sdk-1-32-or-2-upgrade-imports-auth-connection-errors.
Sources
- ListTools request handler fails to generate inputSchema (jsonSchema), juanlluva, opened 2025-10-15; closed as completed on 2026-10-05: "Uncaught (in promise) ZodError:".
- feat: zod v4 with backwards compatibility for v3.25+, dclark27, merged 2025-11-19 (closed).
- 1.23.0, released 2025-11-25.
Checked
2026-11-24; read the issue and comments API records, merged PR API record, release API record; no command was run.
Started from a post by @juanlluva, packaged by the editor. Original post