
JSON Schema Tools
io.github.basitalisandhuv0.1.1更新於 Oct 5, 2026
Validate JSON against a schema with Ajv, infer a schema from samples and diff two schemas.
概覽
讓助理以 JSON Schema 驗證 JSON、從範例文件推斷 schema,並比較兩個 schema 的差異。
- 功能
- 提供三個工具。validate_json 使用 Ajv 依 07、2019-09 或 2020-12 草案驗證文件,回傳是否有效、所用草案、錯誤數量,以及最多 200 筆錯誤,包含 JSON Pointer 路徑、schema 路徑、關鍵字與訊息,並檢查 email、uri、date-time、uuid 等格式。infer_schema 從範例文件產生 2020-12 草案 schema,合併型別、標記必填鍵,並處理巢狀物件、陣列項目、字串格式與選用列舉。diff_schemas 比較兩個 schema,依對舊 schema 下有效文件的影響,將每項變更標為破壞性、相容或需複核。
- 適用情境
- 適合處理 JSON Schema 定義或 JSON 資料的情境:檢查資料是否符合約定、從真實樣本產生初始 schema,或評估 schema 變更是否會破壞現有文件。適用於 API 契約、設定檔與測試資料的編輯工作。
- 執行需求
- 以 npm 套件(npx)或 Docker 映像在本機透過 stdio 執行;未宣告帳號、API 金鑰或環境變數。使用 npm 方式需要 Node.js。schema 與文件以 JSON 值或字串傳入,上限 2 MB。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 JSON Schema Tools,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
json-schema-tools MCP server
Validates JSON against JSON Schema drafts 07, 2019-09 and 2020-12 with Ajv, infers a schema from sample documents, and diffs two schemas with a compatibility verdict per change.
Part of dev-mcp-servers. Stdio transport only; the server never opens a port.
Tools
Install
Claude Code:
Add -s user to make it available in every project. Any client that reads .mcp.json (Claude Code, Claude Desktop, Cursor):
Pin the version as shown so that an update to the package cannot change what runs in your editor without you noticing. From a checkout, use "command": "node", "args": ["<path>/packages/json-schema-tools/dist/index.js"] after npm install && npm run build at the repository root.
What it touches
- Network: None. Remote
$reftargets are not fetched. - Local files: None.
- Telemetry: none.
Notes
- Ajv runs with
strict: falseso real-world schemas with unknown keywords still validate. - Draft-04 and draft-06 schemas are rejected; update
$schemaor remove it. - Schemas and documents can be passed as JSON values or as JSON strings; both are capped at 2 MB.
Build and test
Tests use node:test and the SDK's in-memory transport; they do not reach the network.
Licence
MIT. See LICENSE.
來源:packages/json-schema-tools/README.md,提交 58c8c95
工具
0版本歷史
1- v0.1.1最新Oct 5, 2026


