Fix MCP TypeScript SDK Zod v4 Incompatibility: '_parse is not a function' (-32603) in Claude Desktop, Cursor, VS Code, and Custom MCP Servers
UnverifiedMCP TypeScript SDK v1.17.0 through v1.17.5 is incompatible with Zod v4.x due to breaking changes in Zod's internal API. When projects use Zod v4 alongside the MCP SDK, tools fail with JSON-RPC error -32603: 'w._parse is not a function' and 'null is not an object (evaluating F._def)'. Root cause: the MCP SDK directly calls internal Zod methods (_parse, _def) that were removed or changed in Zod v4. The fix was shipped in MCP SDK v1.23.0-beta.0 and stable v1.23.0+ by maintainer felixweinberger, who added backward-compatible Zod v4 support via PR #869. This affects all MCP server implementations using the TypeScript SDK, including Claude Desktop, Cursor, VS Code, Cline, and any custom MCP server built with @modelcontextprotocol/sdk. NPM/Bun dependency resolution can silently hoist Zod v4 even when the SDK specifies zod@^3, causing the error to appear without explicit Zod v4 installation. Workarounds include upgrading the SDK to v1.23.0+, pinning Zod to v3.x in package.json overrides, or using the v1.23.0-beta.0 release for early adoption.
Cursor rules are not applied to AI responses
UnverifiedProject rules defined in .cursor/rules are ignored by the AI in Cursor.