mono-mcp
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

TypeScript to Zod MCP

🚀 Convert TypeScript types and interfaces to Zod schemas automatically via MCP (Model Context Protocol).

Features

  • ✅ 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

Installation

npm install typescript-to-zod-mcp

Usage

As MCP Server

Add to your ai ide config:

{
  "mcpServers": {
    "typescript-to-zod": {
      "command": "node",
      "args": [
        "/path/to/node_modules/typescript-to-zod-mcp/dist/index-enhanced.js"
      ]
    }
  }
}

MCP Tools

convertType

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

analyzeFile

Analyze a TypeScript file and list all available types.

batchConvert

Convert multiple types from a file.

validateSchema

Validate generated schema accuracy.

Options

  • 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

License

MIT