-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
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.ts
export { 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.
mtch99, fa-lesley, Roshan-24, jhairau, brendo and 1 more
Metadata
Metadata
Assignees
Labels
No labels