JSON contract registry and validator for structured LLM and agent outputs.
JSON contract registry and validator for structured LLM and agent outputs. That is what the json contracts mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.
JSON Contracts is a local MCP contract server for natural-language-to-JSON workflows. It gives agents Git-controlled JSON contracts, rules, examples, and JSON Schema validation tools so any model can reliably convert natural-language requests into schema-valid JSON.
The server publishes 8 tools. What each one is for:
list_contracts — The list_contracts tool exposed by this serverread_contract — Returns the selected contract's description, rules, operations, schema, examples, contractHash, and schemaHashget_json_contract — The agent/model uses this contract to produce JSON. The MCP server does not produce itget_edit_contract — The agent/model uses this edit contract to return the complete updated JSON object. The MCP server first validates currentJson against the selectedvalidate_json — valid is never true unless Ajv validates the JSON against the contract schemaget_repair_contract — The agent/model uses this repair contract to produce corrected JSON. The MCP server does not repair by calling a model. When validation errors arestatus — Use this to debug host configuration, loaded contracts, and the exact contract/schema hashes in usereload_contracts — The reload_contracts tool exposed by this serverInstallation goes through your MCP client rather than a global install: point it at json-contracts on npm and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.
Configuration is passed through the environment: JSON_CONTRACTS_DIR, API_AUTH_TOKEN. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.
Plenty of AI and media services servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. JSON Contracts's toolset — list_contracts, read_contract, get_json_contract and 5 more — is a fair guide to whether it matches your workflow. It is maintained by json-contracts; worth a glance at recent repository activity before you build anything load-bearing on it.
SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.
| Tool | What it does |
|---|---|
| list_contracts | The list_contracts tool exposed by this server. |
| read_contract | Returns the selected contract's description, rules, operations, schema, examples, contractHash, and schemaHash. |
| get_json_contract | The agent/model uses this contract to produce JSON. The MCP server does not produce it. |
| get_edit_contract | The agent/model uses this edit contract to return the complete updated JSON object. The MCP server first validates currentJson against the selected contract, and the agent should validate the edited object with validate_ |
| validate_json | valid is never true unless Ajv validates the JSON against the contract schema. |
| get_repair_contract | The agent/model uses this repair contract to produce corrected JSON. The MCP server does not repair by calling a model. When validation errors are available, instructions also includes deterministic field-specific repair |
| status | Use this to debug host configuration, loaded contracts, and the exact contract/schema hashes in use. |
| reload_contracts | The reload_contracts tool exposed by this server. |
## MCP config
```json
{
"mcpServers": {
"json-contracts": {
"command": "npx",
"args": ["-y", "json-contracts@latest"],
"env": {
"JSON_CONTRACTS_DIR": "./json-contracts"
}
}
}
}Configuration as documented by the project. Restart the client after saving.
| Variable | Description | Required |
|---|---|---|
| JSON_CONTRACTS_DIR | Filesystem location the server is allowed to use. | Optional |
| API_AUTH_TOKEN | Credential the server authenticates with. | Yes |
Build a programmable telecommunications stack for connecting telephony services with the Internet via a cloud-based utility.
Search built for AI, not humans — semantic web search that returns model-ready content, plus code context.
Answers, not links — delegate questions to Perplexity's search-grounded models and get cited responses back.
Give your assistant a voice — text-to-speech, voice cloning and audio tools from the ElevenLabs API.
Give your assistant a real code sandbox — isolated cloud VMs for actually running the code it writes.
The ML hub in your context window — search models, datasets, papers and run Spaces from the official server.