JsonFabrica

io.github.ms-methos由 GitHub 账号 ms-methos 发布v0.3.2更新于 Oct 24, 2026

Generate realistic, relational synthetic JSON test data from templates, via the JsonFabrica API.

发布方自己的服务:Fabrica

已验证STDIO仅桌面开发者工具数据与分析

概览

AI 生成的概览

一个本地 MCP 服务器,让 AI 编程助手通过 JsonFabrica API 生成逼真、具关联关系的合成 JSON 测试数据。

可以做什么
检查网关连通性,并识别所配置 API 密钥对应的租户与角色。创建、列出、读取、更新和删除可复用的数据模板,并据此或临时生成记录。创建、列出、读取、更新、删除和递增用于有序取值的命名序列。运行生成批次,包括跨别名关联的记录,并轮询排队中的批次直至完成。读取租户当前的用量总计。
适用场景
适合需要为测试、演示或本地开发准备种子或夹具 JSON 的场景,让助手生成符合结构、可按种子复现且具引用完整性的记录,无需手写夹具或切换到控制台。
运行要求
以 stdio 方式在本地运行,由 MCP 客户端通过 npx 从 npm 包启动。需要 JsonFabrica 账号,并在 JSONFABRICA_API_KEY 环境变量中提供 API 密钥。需要访问 JsonFabrica 网关的网络;可通过 JSONFABRICA_API_URL 更改基础地址,例如自建网关时。
安装前请注意
API 密钥是放在客户端配置中的机密,请勿写入共享文件。生成调用会计费,包括不持久化的临时生成;可用用量工具查看消耗。相关工具会在远程服务上创建、更新和删除模板与序列,会改动已存储的数据。生成的数据会发送到 JsonFabrica 网关。

安装

在 SourceWeft 中

  1. 打开 控制台中的 JsonFabrica,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

@jsonfabrica/mcp-server

[npm] [license]

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:

json
{  "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:

bash
npm installnpm run buildJSONFABRICA_API_KEY=sk_live_... node dist/index.js

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 varRequiredDefaultNotes
JSONFABRICA_API_KEYYes—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_URLNohttps://api.jsonfabrica.comBase 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

ToolEndpointNotes
jsonfabrica_healthGET /healthNo auth. Connectivity check.
jsonfabrica_whoamiGET /v1/whoamiReturns { tenantId, role } for the configured key.

Templates

ToolEndpoint
jsonfabrica_create_templatePOST /v1/templates
jsonfabrica_list_templatesGET /v1/templates
jsonfabrica_get_templateGET /v1/templates/{templateId}
jsonfabrica_update_templatePUT /v1/templates/{templateId}
jsonfabrica_delete_templateDELETE /v1/templates/{templateId}
jsonfabrica_generate_from_templatePOST /v1/templates/{templateId}/generate
jsonfabrica_generate_adhocPOST /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. <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

ToolEndpoint
jsonfabrica_create_sequencePOST /v1/sequences
jsonfabrica_list_sequencesGET /v1/sequences
jsonfabrica_get_sequenceGET /v1/sequences/{name}
jsonfabrica_update_sequencePATCH /v1/sequences/{name}
jsonfabrica_delete_sequenceDELETE /v1/sequences/{name}
jsonfabrica_bump_sequencePOST /v1/sequences/{name}/bump

Batches

ToolEndpoint
jsonfabrica_create_batchPOST /v1/batches (small batches run synchronously — 200 with results; larger batches are queued — 202, poll with jsonfabrica_get_batch)
jsonfabrica_get_batchGET /v1/batches/{batchId}

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:

json
{  "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

ToolEndpoint
jsonfabrica_get_usageGET /v1/usage — returns { tenantId, usageTotal, asOf }

Explicitly out of scope

  • POST /v1/signup and PATCH /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 blockReason is 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_KEY is set and valid.
  • Connection refused / UPSTREAM_UNREACHABLE → check JSONFABRICA_API_URL and 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

bash
npm installnpm run build   # tsc -p tsconfig.jsonnpm 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.

来源:README.md,提交 1ba8790

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

2
  1. v0.3.2最新Oct 6, 2026
  2. v0.3.0Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Fabrica 集成