Problem
apps/mcp-server/src/index.ts (lines 43-141) contains a hand-rolled zodToJsonSchema converter (~100 lines). It handles basic types but misses unions, transforms, pipes, branded types, and other Zod features. This is a maintenance burden and potential source of bugs.
Solution
Replace with the zod-to-json-schema npm package:
import { zodToJsonSchema } from 'zod-to-json-schema';
// In tool list handler:
const jsonSchema = zodToJsonSchema(tool.inputSchema, { target: 'openApi3' });
Remove the ~100 lines of hand-rolled conversion code.
Files
apps/mcp-server/src/index.ts — replace converter
apps/mcp-server/package.json — add zod-to-json-schema dependency
Problem
apps/mcp-server/src/index.ts(lines 43-141) contains a hand-rolledzodToJsonSchemaconverter (~100 lines). It handles basic types but misses unions, transforms, pipes, branded types, and other Zod features. This is a maintenance burden and potential source of bugs.Solution
Replace with the
zod-to-json-schemanpm package:Remove the ~100 lines of hand-rolled conversion code.
Files
apps/mcp-server/src/index.ts— replace converterapps/mcp-server/package.json— addzod-to-json-schemadependency