
JSON Contracts
Register JSON schemas and validate agent or LLM structured outputs so tool calls do not silently drift.
Overview
JSON Contracts is a MCP server for the Build phase that registers JSON schemas and validates structured LLM and agent outputs against them.
What is this MCP server?
- Local JSON contract registry via JSON_CONTRACTS_DIR (default ./json-contracts)
- Validator for structured LLM and agent outputs against registered contracts
- stdio npm transport (json-contracts@0.1.2) for Claude Code, Cursor, and other MCP clients
- Designed for repeatable parse-safe JSON instead of free-form model text
- Server version 0.1.2 via npm identifier json-contracts
- stdio transport; JSON_CONTRACTS_DIR defaults to ./json-contracts
Community signal: 1 GitHub stars.
What problem does it solve?
Agents return JSON-shaped text that often misses fields or invents keys, breaking your integrations with no single source of truth.
Who is it for?
Solo builders shipping agent features who want filesystem-backed JSON Schema contracts and MCP-side validation without a hosted platform.
Skip if: Teams that only need informal prompts with no structured I/O, or shops already standardizing on OpenAPI/Protobuf with separate codegen pipelines only.
What do I get? / Deliverables
After you register contracts and connect the MCP server, agents can validate outputs against your schemas before code paths trust them.
- Validated structured JSON aligned to your registered contracts
- A reusable local contract set agents can reference across sessions
- Fewer integration breaks from malformed agent payloads
Recommended MCP Servers
Journey fit
Canonical shelf is Build because contracts are wired into integrations and agent tooling as you ship features. Integrations is where structured tool I/O and schema enforcement matter most for solo builders connecting agents to APIs.
How it compares
MCP schema validator for agent JSON, not a general-purpose JSON linter CLI or hosted observability product.
Common Questions / FAQ
Who is JSON Contracts for?
Indie developers and small teams using MCP-enabled agents who need reliable structured JSON from LLM tool calls.
When should I use JSON Contracts?
When you define or consume fixed JSON shapes from agents and want validation before those payloads drive app logic or tests.
How do I add JSON Contracts to my agent?
Install the npm package json-contracts, set JSON_CONTRACTS_DIR to your contracts folder, and register the stdio MCP server in Claude Code, Cursor, or your client's config.