
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
概覽
一個本機 MCP 伺服器,讓 AI 程式設計助理透過 JsonFabrica API 產生逼真、具關聯性的合成 JSON 測試資料。
- 可以做什麼
- 檢查閘道連線狀態,並辨識所設定 API 金鑰對應的租用戶與角色。建立、列出、讀取、更新與刪除可重複使用的資料範本,並依此或臨時產生記錄。建立、列出、讀取、更新、刪除與遞增用於有序取值的具名序列。執行產生批次,包括跨別名關聯的記錄,並輪詢排隊中的批次直到完成。讀取租用戶目前的用量總計。
- 適用情境
- 適合需要為測試、示範或本機開發準備種子或測試資料 JSON 的情境,讓助理產生符合結構、可用種子重現且具參照完整性的記錄,不必手寫測試資料或切換到主控台。
- 執行需求
- 以 stdio 方式在本機執行,由 MCP 用戶端透過 npx 從 npm 套件啟動。需要 JsonFabrica 帳號,並在 JSONFABRICA_API_KEY 環境變數中提供 API 金鑰。需要連線到 JsonFabrica 閘道的網路;可透過 JSONFABRICA_API_URL 變更基礎網址,例如自架閘道時。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 JsonFabrica,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
@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:
- 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_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
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
Templates
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
Batches
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:
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
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
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版本歷史
2- v0.3.2最新Oct 6, 2026
- v0.3.0Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
