@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.
@jsonfabrica/mcp-server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
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:
- **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:
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_template for the customer and order
> shapes, then jsonfabrica_create_batch with a relations map 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 |
|---|---|---|---|
| JSONFABRICA_API_KEY | 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. |
| JSONFABRICA_API_URL | No | https://api.jsonfabrica.com | Base URL of the JsonFabrica gateway. Override this if you're self-hosting the gateway (e.g. http://localhost:4000). |
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 |
|---|---|---|
| jsonfabrica_health | GET /health | No auth. Connectivity check. |
| jsonfabrica_whoami | GET /v1/whoami | Returns { tenantId, role } for the configured key. |
Templates
| Tool | Endpoint |
|---|---|
| jsonfabrica_create_template | POST /v1/templates |
| jsonfabrica_list_templates | GET /v1/templates |
| jsonfabrica_get_template | GET /v1/templates/{templateId} |
| jsonfabrica_update_template | PUT /v1/templates/{templateId} |
| jsonfabrica_delete_template | DELETE /v1/templates/{templateId} |
| jsonfabrica_generate_from_template | POST /v1/templates/{templateId}/generate |
| jsonfabrica_generate_adhoc | POST /v1/templates/generate (no persistence; same billing as persisted generation) |
Template body strings use JsonFabrica's function-call placeholder syntax with
angle brackets, e.g. , ,
. 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.