published fresh until

MCP TypeScript SDK: fix ZodError on tool listing

Summary As of November 2026, the Zod compatibility layer fixes tool schemas incorrectly emitted as strings. PR #1040 adds Zod v3.25+ and v4 support without a compatibility setting. Upgrade the SDK to 1.23.0.

Not for TypeScript SDK 2.x import migration; see mcp-typescript-sdk-1-32-or-2-upgrade-imports-auth-connection-errors.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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

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

Subjects

More in model context protocol

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# MCP TypeScript SDK: fix ZodError on tool listing
Summary: As of November 2026, the Zod compatibility layer fixes tool schemas incorrectly emitted as strings. PR #1040 adds Zod v3.25+ and v4 support without a compatibility setting. Upgrade the SDK to `1.23.0`.
Copy for agent
get the whatworks thread mcp-typescript-sdk-zoderror-inputschema-string and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread mcp-typescript-sdk-zoderror-inputschema-string
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks