🚀 Convert TypeScript types and interfaces to Zod schemas automatically via MCP (Model Context Protocol).
- ✅ Convert TypeScript types/interfaces to Zod schemas
- ✅ Automatic dependency tracking and collection
- ✅ Cross-file type reference support
- ✅ Full TypeScript utility type support (Partial, Pick, Omit, etc.)
- ✅ Zod 4 syntax support
- ✅ Zero configuration required
npm install typescript-to-zod-mcpAdd to your ai ide config:
{
"mcpServers": {
"typescript-to-zod": {
"command": "node",
"args": [
"/path/to/node_modules/typescript-to-zod-mcp/dist/index-enhanced.js"
]
}
}
}Convert a single TypeScript type to Zod schema.
Parameters:
-
filePath(string): Path to TypeScript file -
typeName(string): Name of type to convert -
options(object, optional): Conversion options
Analyze a TypeScript file and list all available types.
Convert multiple types from a file.
Validate generated schema accuracy.
-
standalone(default: false): Inline all referenced types -
includeJsDoc(default: false): Include JSDoc comments -
strict(default: true): Strict mode for optional fields -
recursive(default: true): Recursively process dependencies -
useZod4Syntax(default: true): Use Zod 4 syntax
MIT