You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building MCP tools, consumers need zod for input schemas but get type errors due to version mismatches with the SDK's internal zod dependency.
Problem:
import{z}from'zod';// Consumer's version (3.23.8)server.registerTool('tool',{inputSchema: z.string()// Type error - incompatible with SDK's zod 3.25.76});
Error:Type 'ZodString' is missing properties "~standard", "~validate"
Solutions
Option 1: Re-export from main index
// src/index.tsexport{z}from'zod';
Usage: import { z } from '@modelcontextprotocol/sdk'
Option 2: Move zod to peerDependencies
Force consumers to install compatible zod version themselves.
Recommendation: Option 1 - simpler, no breaking changes, consumers get exact same zod version as SDK.