generate_valid_mockLABSCO SUMMARY
Zod schemas an agent can actually run.
A Zod schema is runtime code — a model can read it but not execute it, which is why hand-written fixtures almost validate and then do not. Running the schema means the mock is valid by construction, and every violation targets a real constraint rather than a guessed one.
What it is
A layer that executes Zod schemas on an agent's behalf: it generates payloads that satisfy a schema, payloads that violate each constraint, and reports how a schema has drifted or evolved.
What you get
- Valid mock data matching a schema, in whatever count you ask for
- Structurally valid but value-diverse mocks, seeded, for property-based testing
- Invalid payloads per constraint: missing fields, type mismatches, min/max, email, uuid, url
- Per-variant violations for every branch of a union or discriminated union
- The schema introspected into its actual constraints
- A schema read straight from a file instead of pasted in as code
- Drift detected between a schema and the docs it is supposed to match
- A schema change evaluated for what it breaks
Requirements
Zod schemas, either passed in as code or read from a file the server can see. Published on npm as zod-contract-mock-forge-mcp.
Setup effort
One command — npm install -g zod-contract-mock-forge-mcp
USE CASES
Filling a test fixture that passes validation first time
Read the schema from its file and generate data that satisfies it, instead of writing the object by hand.
Proving the API rejects what it should
Get one invalid payload per constraint — missing field, wrong type, out of range, bad email — and assert each is refused.
Covering every branch of a discriminated union
Violations generated per variant, so no branch is left with only the happy path tested.
Property-testing with data that actually varies
Seeded variants keep the structure valid while the values move, so the run is repeatable.
Catching a schema that drifted from the docs
Compare the two and get the divergence named, rather than finding it in an integration failure.
Judging whether a schema change breaks existing fixtures
Evaluate the evolution before you merge it, not after the test suite goes red.
10 tools
Listed in project docs. Your client may show a different list.
generate_mock_variantsgenerate_boundary_violationsgenerate_exhaustive_union_violationsintrospect_schemaread_schema_from_filedetect_schema_driftevaluate_schema_evolutionscaffold_api_contract_testsuggest_contract_fixBEFORE YOU INSTALL
What to know first
Tools you get
10 tools named in the project's documentation.
Requires
zod-contract-mock-forge-mcp on PATH
INSTALLATION
Connect your client
Server setup
npm install -g zod-contract-mock-forge-mcpMCP Clients
Cursor
{
"mcpServers": {
"zod-forge": {
"command": "zod-contract-mock-forge-mcp"
}
}
}VS Code
{
"servers": {
"zod-forge": {
"command": "zod-contract-mock-forge-mcp"
}
}
}Claude Code
claude mcp add zod-forge zod-contract-mock-forge-mcp