apps/mcp/src/tools/README-ZOD-V3.md
xsschema to convert schemas → outputs JSON Schema Draft 2020-12All MCP tool files import from zod/v3 instead of zod:
import { z } from 'zod/v3'; // ✅ Draft-07 compatible
// NOT: import { z } from 'zod'; // ❌ Would use Draft 2020-12
zod/v3zod/v3 (apps/mcp & mcp-server/src/tools)zod (Zod v4)This workaround can be removed when either:
FastMCP adds JSON Schema version configuration
new FastMCP({ jsonSchema: { target: 'draft-07' } })MCP spec adds Draft 2020-12 support
xsschema adds version targeting
When adding new MCP tools:
// ✅ CORRECT
import { z } from 'zod/v3';
export function registerMyTool(server: FastMCP) {
server.addTool({
name: 'my_tool',
parameters: z.object({ ... }), // Will use Draft-07
execute: async (args, context) => { ... }
});
}
// ❌ WRONG - Will break MCP client compatibility
import { z } from 'zod'; // Don't do this in apps/mcp/src/tools/
Last Updated: 2025-10-18
Affects: All files in apps/mcp/src/tools/
See Also: mcp-server/src/tools/README-ZOD-V3.md (same workaround)