jsonfabrica-mcp-server
A local stdio MCP server that gives an AI agent JsonFabrica's REST API as tools to generate realistic, seed-reproducible JSON test data — including multi-document batches with referential integrity — plus full management of templates and sequences.
Connectivity/auth checks —
jsonfabrica_health(no auth, verifiesJSONFABRICA_API_URLis reachable) andjsonfabrica_whoami(returns{ tenantId, role }for the configured key).Template CRUD — create, list (filter by name/tags/status, cursor-paginated), get by id, partially update in place, and soft-delete (archive) templates; there is no restore tool.
Generate from a saved template —
jsonfabrica_generate_from_templateproduces one document from a persistedtemplateId.Ad-hoc generation —
jsonfabrica_generate_adhocevaluates a raw body string without persisting a template (same billing as persisted generation).Batch generation with relations —
jsonfabrica_create_batchtakes multiple entries (templateId+ uniquealias+count+ optionalparams/relations) so documents can cross-reference each other (string refs forcount === 1parents, or{ from, strategy: "round-robin" }for larger groups); small batches return synchronously with results, larger ones queue (202) for polling withjsonfabrica_get_batch.Determinism controls — pass a
seedon generation/batches for byte-identical reproducible output; responses report the seed actually used, plus per-document seeds.Durable sequence management — create, list, get, update (
currentValue/step), hard-delete, and bump namednumber/string/uuidsequences that template bodies consume viacreateSeq()/getSeq().Parameterization —
paramsandcontextkey/value maps supply values forgetParam("key")placeholders and auxiliary data.Side-effect isolation —
sequenceNamespace/variableNamespaceon generate and batch calls keep test/debug runs from advancing real tenant sequences and variables.Usage metering —
jsonfabrica_get_usagereturns{ tenantId, usageTotal, asOf }.Robust error handling — every tool catches upstream failures (401, 403, 402 with
blockReason, unreachable gateway, other API errors) and returns a readableisError: trueresult instead of crashing the host process.Configured via env only —
JSONFABRICA_API_KEY(required; key never logged or echoed) and optionalJSONFABRICA_API_URL(defaults tohttps://api.jsonfabrica.com).Deliberately excluded — signup, billing-tier changes, and Stripe webhook endpoints are not wrapped.
@jsonfabrica/mcp-server
A local Model Context Protocol (MCP) server that lets an AI coding agent — Claude Desktop, Cursor, or anything else that speaks MCP — generate realistic, schema-conformant JSON test data mid-session by calling JsonFabrica's REST API as MCP tools.
It runs over stdio transport only: your AI client launches it as a subprocess, so there's no network service to host and no port to open. It never talks to anything except the JsonFabrica gateway you configure.
New to JsonFabrica? It's an API-first service for generating synthetic JSON test data from reusable templates — deterministic, seed-reproducible, with referential integrity across related records. See jsonfabrica.com and the API docs.
Install / run
Add it to your MCP client's config so the client launches it via npx:
{
"mcpServers": {
"jsonfabrica": {
"command": "npx",
"args": ["-y", "@jsonfabrica/mcp-server"],
"env": {
"JSONFABRICA_API_KEY": "sk_live_...",
"JSONFABRICA_API_URL": "https://api.jsonfabrica.com"
}
}
}
}Claude Desktop — add the block above to
claude_desktop_config.json(Settings → Developer → Edit Config), then restart.Cursor — Settings → MCP → Add new MCP server, or add the block to
~/.cursor/mcp.json.
Get an API key by signing up at jsonfabrica.com — Settings → API Keys.
Or run it directly for local testing:
npm install
npm run build
JSONFABRICA_API_KEY=sk_live_... node dist/index.jsRelated MCP server: TesteMCP
What it looks like in a session
Once connected, an agent can do things like:
You: Generate 20 realistic customer records and 60 orders linked to them, and drop them into
fixtures/seed.json.Agent: calls
jsonfabrica_create_templatefor the customer and order shapes, thenjsonfabrica_create_batchwith arelationsmap so each order references a generated customer id, then writes the result to the file.
No tab-switching to a dashboard, no hand-written fixtures.
Configuration
Env var | Required | Default | Notes |
| Yes | — | If missing, the server still starts and answers tool discovery, but every tool call fails with "check JSONFABRICA_API_KEY". Never logged or echoed back in tool output. |
| No |
| Base URL of the JsonFabrica gateway. Override this if you're self-hosting the gateway (e.g. |
Tools
Every tool's description states, verbatim, which REST endpoint it calls. Tool
names are prefixed jsonfabrica_ to avoid collisions with other MCP servers
your client may have loaded.
Health / Auth
Tool | Endpoint | Notes |
|
| No auth. Connectivity check. |
|
| Returns |
Templates
Tool | Endpoint |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Template body strings use JsonFabrica's function-call placeholder syntax with
angle brackets, e.g. <getRandomFullName()>, <getRandomEmail()>,
<createSeq('orderNo')>. The full catalogue of built-in functions is documented
at jsonfabrica.com/docs/functions —
it's authoring reference, not something this server exposes as tools.
Sequences
Tool | Endpoint |
|
|
|
|
|
|
|
|
|
|
|
|
Batches
Tool | Endpoint |
|
|
|
|
Both tools return the same shape: { batchId, status, seed, results?, error? },
where status is queued | running | completed | failed. results is present
once the batch is completed and groups the generated documents by alias —
each value is an array of the documents themselves:
{
"batchId": "4f1c…",
"status": "completed",
"seed": 42,
"results": {
"customer": [{ "id": "c-1", "name": "Ada Lovelace" }],
"order": [{ "id": "o-1", "customerId": "c-1" }, { "id": "o-2", "customerId": "c-1" }]
}
}A failed batch carries error: { code, message } instead of results. Batches
under 50 documents in total (the API's default threshold) run synchronously;
larger ones return 202 { batchId, status: "queued", seed }.
Usage
Tool | Endpoint |
|
|
Explicitly out of scope
POST /v1/signupandPATCH /v1/billing/tier— unauthenticated account-creation / billing-tier-change endpoints. Wrapping these would let a model create real paid subscriptions or change billing tiers on the user's behalf; excluded by design (generation API surface only).POST /v1/webhooks/stripe— Stripe-only webhook ingestion, not a developer-facing capability.
Error handling
Every tool catches errors internally and returns an MCP isError: true result
with a readable message — it never throws out of the handler or crashes the host
process. Common cases:
401 → "Invalid or missing API key — check JSONFABRICA_API_KEY."
403 → the API key's tenant is not allowed to perform the call.
402 (blocked account) → the upstream
blockReasonis passed through.Network failure (gateway unreachable) → a message naming the configured
JSONFABRICA_API_URL.Anything else →
JsonFabrica API error [CODE] (HTTP status): message.
Troubleshooting
401 / "Invalid or missing API key" → check
JSONFABRICA_API_KEYis set and valid.Connection refused / UPSTREAM_UNREACHABLE → check
JSONFABRICA_API_URLand that the gateway is actually running and reachable from wherever this process runs.403 / FORBIDDEN → your API key's tenant is not permitted to perform that call.
Development
npm install
npm run build # tsc -p tsconfig.json
npm test # build + node --test dist/
npm start # node dist/index.js (requires JSONFABRICA_API_KEY)Source layout mirrors the OpenAPI spec's tags: one file per tag under
src/tools/. src/client.ts is the only place that knows about fetch, the
base URL, and the Authorization header.
License
MIT — see LICENSE.
Available Tools
18 toolsjsonfabrica_bump_sequenceBump a JsonFabrica sequenceA
Calls POST /v1/sequences/{name}/bump. Atomically advances the sequence by its configured step (a permanent, irreversible change to the stored currentValue) and returns the updated record — this is the same advance a template's createSeq()/getSeq() calls trigger during generation. Use jsonfabrica_update_sequence instead if you need to set an explicit currentValue/step rather than advancing by the existing step.
Inputs: name (required). Returns: name, step, type, start, +4 more
jsonfabrica_create_batchCreate a JsonFabrica batch generation jobA
Calls POST /v1/batches. Generates multiple documents from one or more persisted templates in one call, optionally cross-referencing documents via relations — use this instead of looping jsonfabrica_generate_from_template yourself when you need many documents or cross-document relations in a single request. Small batches run synchronously and the response is 200 with results; larger batches are queued and the response is 202 with just { batchId, status, seed } — poll jsonfabrica_get_batch for the final results in that case. Like a single generate call, this is metered/billed per document produced and, unless namespaced, can advance real durable sequences and mutate durable variables referenced by the templates.
Inputs: documents (required), seed, sequenceNamespace, variableNamespace. Returns: seed, error, status, batchId, +1 more
jsonfabrica_create_sequenceCreate a JsonFabrica sequenceA
Calls POST /v1/sequences. Creates a durable named sequence (number/string/uuid), referenced from template bodies via createSeq()/getSeq()-style functions. Fails with a 409-style conflict error if a sequence with this name already exists for the tenant — use jsonfabrica_update_sequence to change an existing one's currentValue/step instead of retrying create with the same name.
Inputs: name (required), type (required), step, start. Returns: name, step, type, start, +4 more
jsonfabrica_create_templateCreate a JsonFabrica templateA
Calls POST /v1/templates. Creates a persisted, reusable template that can be generated from repeatedly with jsonfabrica_generate_from_template — use this instead of jsonfabrica_generate_adhoc when you want the body saved and shareable rather than a one-off, unsaved evaluation. body uses JsonFabrica's function-call placeholder syntax, e.g. "Hello {{getRandomFullName()}}" or "<getRandomNumber(1,100)>" — see the data-generation-functions reference for the full catalog. The optional generate field is a convenience that also runs a generation in the same call (response includes generation or generationError alongside template) so you avoid a separate jsonfabrica_generate_from_template round-trip; that generation is metered/billed and can advance durable sequences/variables just like a normal generate call. If generate is omitted, the response is just the created template with no generation side effects.
Inputs: body (required), name (required), tags, generate, +1 more. Returns: body, name, tags, status, +11 more
jsonfabrica_delete_sequenceDelete a JsonFabrica sequenceADestructiveIdempotent
Calls DELETE /v1/sequences/{name}. This is a hard, permanent delete — unlike jsonfabrica_delete_template's soft-delete/archive behavior, the sequence record is removed entirely and cannot be recovered; there is no status: "archived" equivalent for sequences. Returns no content on success. Any template body still calling createSeq()/getSeq() with this name afterwards will no longer see the deleted history/state.
Inputs: name (required).
jsonfabrica_delete_templateDelete a JsonFabrica templateADestructiveIdempotent
Calls DELETE /v1/templates/{templateId}. This is a soft delete: the template's status is set to "archived" (it is not erased from storage), and the call returns the resulting archived template record. Archived templates are excluded from jsonfabrica_list_templates by default — pass status: "archived" there to find them again — and both jsonfabrica_get_template and jsonfabrica_generate_from_template still work against the id afterwards, since archiving does not block reads or generation. Use this when a template should stop showing up in normal listings; there is currently no tool to restore an archived template back to active.
Inputs: templateId (required). Returns: body, name, tags, status, +8 more
jsonfabrica_generate_adhocGenerate a document from a raw template body (no persistence)A
Calls POST /v1/templates/generate. Generates a document directly from a raw body string without creating a template record — prefer this over jsonfabrica_generate_from_template while still iterating on template syntax; switch to jsonfabrica_create_template once the body is ready to be reused or shared. Goes through the same billing/usage metering as persisted-template generation (not a free bypass). createSeq()/durable sequence side effects still apply; set sequenceNamespace/variableNamespace to e.g. "debug" to avoid colliding with real tenant sequences and variables.
Inputs: body (required), seed, params, context, +2 more. Returns: data, meta
jsonfabrica_generate_from_templateGenerate a document from a JsonFabrica templateA
Calls POST /v1/templates/{templateId}/generate. Generates a document from a persisted, saved template referenced by templateId — use this (not jsonfabrica_generate_adhoc) when the template is meant to be reused or shared across calls/tenants; use jsonfabrica_generate_adhoc instead when you are still iterating on raw template syntax and don't want to persist anything yet. This call is metered/billed like any generation and, unless namespaced, can advance real durable sequences and mutate durable variables referenced by the template body. Set sequenceNamespace/variableNamespace to isolate those side effects between environments (e.g. test vs. production).
Inputs: templateId (required), seed, params, context, +2 more. Returns: data, meta
jsonfabrica_get_batchGet a JsonFabrica batchARead-onlyIdempotent
Calls GET /v1/batches/{batchId}. Returns batch status and, once complete, the generated documents. Use this to poll a batch that was accepted asynchronously (202).
Inputs: batchId (required). Returns: seed, spec, error, status, +3 more
jsonfabrica_get_sequenceGet a JsonFabrica sequenceARead-onlyIdempotent
Calls GET /v1/sequences/{name}. Returns the sequence record for a known name; use jsonfabrica_list_sequences instead if you need to discover names. Read-only — does not advance the sequence (use jsonfabrica_bump_sequence for that).
Inputs: name (required). Returns: name, step, type, start, +4 more
jsonfabrica_get_templateGet a JsonFabrica templateARead-onlyIdempotent
Calls GET /v1/templates/{templateId}. Returns the full template record for a known id. Use this instead of jsonfabrica_list_templates when you already have the templateId (e.g. from a prior create/list call); it is also the recommended way to inspect current body/tags/description before calling jsonfabrica_update_template, since update only shows you the fields you send, not the result of merging them with what already exists. Read-only, no side effects.
Inputs: templateId (required). Returns: body, name, tags, status, +8 more
jsonfabrica_get_usageGet JsonFabrica tenant usageARead-onlyIdempotent
Calls GET /v1/usage. Returns { tenantId, usageTotal, asOf } for the configured API key.
Inputs: no named parameters. Returns: asOf, tenantId, usageTotal
jsonfabrica_healthJsonFabrica health checkARead-onlyIdempotent
Calls GET /health on the JsonFabrica gateway. No authentication required. Use this to verify JSONFABRICA_API_URL points at a reachable gateway.
Inputs: no named parameters. Returns: status, service
jsonfabrica_list_sequencesList JsonFabrica sequencesARead-onlyIdempotent
Calls GET /v1/sequences. Returns a page of sequences ({ items, nextCursor }). Use this to discover sequence names when you don't already know one; if you know the exact name, call jsonfabrica_get_sequence directly instead. Read-only, no side effects.
Inputs: limit, cursor. Returns: items, nextCursor
jsonfabrica_list_templatesList JsonFabrica templatesARead-onlyIdempotent
Calls GET /v1/templates. Returns a page of templates matching optional name/tags/status filters ({ items, nextCursor }). Use this to discover or search templates when you don't already know the templateId; if you already have the id, call jsonfabrica_get_template directly instead — it is cheaper and returns the full record. This is read-only and has no side effects. Pass status: "archived" to see templates previously removed with jsonfabrica_delete_template, since the default active filter excludes them.
Inputs: name, tags, limit, cursor, +1 more. Returns: items, nextCursor
jsonfabrica_update_sequenceUpdate a JsonFabrica sequenceAIdempotent
Calls PATCH /v1/sequences/{name}. Only the provided fields (currentValue, step) are changed; fields you omit are left as-is. Use this when you need to set an explicit currentValue (e.g. resetting a counter) or change the step amount — use jsonfabrica_bump_sequence instead when you just want to advance the sequence by its existing configured step. This overwrites the sequence's stored state in place immediately; there is no undo.
Inputs: name (required), step, currentValue. Returns: name, step, type, start, +4 more
jsonfabrica_update_templateUpdate a JsonFabrica templateAIdempotent
Calls PUT /v1/templates/{templateId}. Partially updates an existing template in place: only the fields you include in the call are changed, and every field you omit is left exactly as it was — call jsonfabrica_get_template first if you need to see current values before deciding what to send. Use this only for an existing templateId; to make a new template use jsonfabrica_create_template instead (it does not modify or version the original). The change is applied immediately and in-place with no version history — there is no undo, so if you need to keep the old body/tags around, read and save them first.
Inputs: templateId (required), body, name, tags, +1 more. Returns: body, name, tags, status, +8 more
jsonfabrica_whoamiJsonFabrica whoamiARead-onlyIdempotent
Calls GET /v1/whoami on the JsonFabrica gateway using the configured API key. Returns { tenantId, role } for the configured JSONFABRICA_API_KEY.
Inputs: no named parameters. Returns: role, tenantId
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Each tool maps cleanly to a distinct resource and action: template CRUD, sequence CRUD/bump, adhoc vs persisted generation, batch create/poll, and service introspection. The few close pairs like generate_adhoc vs generate_from_template are explicitly differentiated by whether the template is persisted.
Tools consistently use the jsonfabrica_ prefix and mostly follow a verb_noun pattern (create_template, list_templates, get_sequence, delete_template). Minor exceptions are jsonfabrica_health and jsonfabrica_whoami, which are noun/command style rather than get_health/get_identity.
Eighteen tools is slightly above the typical ideal range, but each tool maps to a meaningful operation and there is no obvious redundancy. The size is justified by the multiple resource domains: templates, sequences, batches, and account introspection.
Template and sequence lifecycles are well covered with CRUD plus generation and bump operations, and batch create/poll coverage exists. However, the descriptions repeatedly mention durable variables with namespaces but provide no variable management tools, and archived templates cannot be restored to active.
Maintenance
Related MCP Connectors
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP server (stdio): validate JSON against JSON Schema (draft-07 / 2020-12) via the AgentForge API
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceConfigurable MCP server that lets you define LLM-powered tools via JSON, enabling easy integration of multiple models (GPT, Gemini, Claude, etc.) as MCP tools without writing Python code.6MIT
- FlicenseNot gradedqualityDmaintenanceMCP server for reading and listing JSON documents, designed to be used with Claude Haiku and Headroom compression to reduce token usage. It demonstrates an end-to-end MCP tool-use loop with stdio transport.-
- AlicenseAqualityDmaintenanceMCP server for Wraft that lets AI agents discover and run curated document-lifecycle tools over Wraft's REST API, including content types, templates, document creation/update, PDF builds, and approval flows via stdio or hosted HTTP.1511 npm1AGPL 3.0
- AlicenseNot gradedqualityAmaintenanceProvides MCP servers that wrap common developer tools such as git, npm, Docker, Kubernetes, and test runners, returning schema-validated structured JSON instead of raw terminal text. This lets AI agents consume typed, token-efficient results directly without brittle string parsing or platform-dependent formatting issues.4 npmMIT