MCP server for deterministic mock generation and API contract scaffolding using Zod schemas
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
๐ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
An MCP server that turns Zod schemas into mocks, violations, and contract tests โ so your AI agent can reason about API contracts without manually crafting payloads.
Zod schemas are runtime code. An AI agent cannot execute them, introspect their constraints, or generate valid/invalid payloads without this layer. The agent also cannot detect when the schema and the OpenAPI docs silently diverged, or whether a schema change breaks existing test fixtures.
| Tool | Arguments | What it returns |
|---|---|---|
generate_valid_mock | schema_code, count? | Valid mock data matching the schema |
generate_mock_variants | schema_code, count?, seed? | N structurally valid but value-diverse mocks โ for property-based testing |
| Tool | Arguments | What it returns |
|---|---|---|
generate_boundary_violations | schema_code | Invalid payloads for each constraint: missing fields, type mismatches, min/max, email/uuid/url |
generate_exhaustive_union_violations | schema_code | Per-variant violations for every branch of a z.union() or z.discriminatedUnion() |
| Tool | Arguments | What it returns |
|---|---|---|
introspect_schema | schema_code | JSON Schema representation โ for LLM understanding of the contract |
read_schema_from_file | file_path, export_name? | Extracts the Zod schema expression from a TypeScript/JS file |
detect_schema_drift | zod_file_path, schema_export_name, openapi_file_path, openapi_schema_name? | Diffs Zod vs OpenAPI โ reports missing_in_openapi, missing_in_zod, type_conflict, required_mismatch |
evaluate_schema_evolution | schema_file_path, schema_export_name, old_schema_content? | Generates mocks from old schema, validates against new โ detects breaking changes before tests run |
| Tool | Arguments | What it returns |
|---|---|---|
scaffold_api_contract_test | framework, base_url, endpoint, method, schema_code, test_name? | Contract test boilerplate for Playwright, Jest, Vitest, or MSW |
suggest_contract_fix | schema_code, payload | Validates a JSON payload and explains each violation with a fix suggestion |
.cursor/mcp.json or .vscode/mcp.json)generate_mock_variants โ 3 diverse valid mocks, seeded for CI:
detect_schema_drift โ field missing in OpenAPI, extra field in Zod:
evaluate_schema_evolution โ new required field breaks existing mocks:
MIT
No reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/zod-contract-mock-forge-mcp)<a href="https://allmcps.com/mcp/zod-contract-mock-forge-mcp"><img src="https://allmcps.com/api/badge/zod-contract-mock-forge-mcp?style=directory" alt="Zod Contract Mock Forge MCP on AllMCPs" /></a>