
Zod Contract Mock Forge Mcp
io.github.vola-treblaPublished by GitHub account vola-treblav0.2.0Updated Oct 24, 2026
MCP server for deterministic mock generation and API contract scaffolding using Zod schemas
Overview
Local MCP server that turns Zod schemas into valid mocks, boundary violations, drift reports and contract test scaffolding for an AI assistant.
- What you can do
- Generate valid mock data and seeded, value-diverse mock variants from Zod schema code
- Produce invalid payloads for each constraint and per-branch violations for unions and discriminated unions
- Introspect schemas into JSON Schema and extract schema expressions from TypeScript/JS files
- Diff a Zod schema against an OpenAPI spec and flag breaking changes in schema evolution
- Scaffold contract tests for Playwright, Jest, Vitest or MSW and explain payload violations with fix suggestions
- When to use it
- Useful when an assistant works on TypeScript APIs with Zod schemas and needs payloads, negative test cases, OpenAPI drift checks or contract test boilerplate without writing them by hand.
- Requirements
- Runs as a local stdio process installed from the npm package zod-contract-mock-forge-mcp (Node.js); registered in an editor such as Cursor, VS Code or Claude Code. No authentication, environment variables or headers are declared. Desktop only.
Installation
In SourceWeft
- Open Zod Contract Mock Forge Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
zod-contract-mock-forge-mcp
[npm version] [npm downloads] [CI] [License: MIT]
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.
The Problem
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.
Tools
Mock generation
Violation generation
Schema analysis
Contract testing
Setup
1. Install
2. Add to your editor
Cursor / VS Code (.cursor/mcp.json or .vscode/mcp.json)
Claude Code
Example usage
Example output
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:
Scripts
License
MIT
Source: README.md at commit 87e8f46
Tools
0Version history
1- v0.2.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts