Skip to main content
Glama
schema-tools
by rog0x

mcp-schema-tools

为 AI 代理提供 Schema 验证和生成工具的 MCP 服务器。

工具

generate_json_schema

从示例 JSON 数据生成 JSON Schema。推断类型、必填字段、格式(email、date、URI、UUID),并从多个示例中检测枚举模式。

generate_typescript

从 JSON 数据或 JSON Schema 生成 TypeScript 接口和类型。处理嵌套对象、数组、可选字段、枚举和联合类型。

validate_schema

根据 JSON Schema 验证数据,并提供详细的错误消息,包括 JSON 路径、预期类型、实际值以及违反的约束关键字。

mock_from_schema

从 JSON Schema 生成逼真的模拟数据。智能字段名检测可生成上下文相关的值:email 字段获得有效的电子邮件地址,name 字段获得逼真的姓名,phone 字段获得格式化号码,等等。

diff_schemas

比较两个 JSON Schema,找出新增、删除和更改的字段。识别类型更改、约束更改,并将每个差异分类为破坏性变更或非破坏性变更,以进行向后兼容性分析。

Related MCP server: apitype

设置

npm install
npm run build

与 Claude Desktop 配合使用

添加到你的 claude_desktop_config.json:

{
  "mcpServers": {
    "schema-tools": {
      "command": "node",
      "args": ["path/to/mcp-schema-tools/dist/index.js"]
    }
  }
}

许可证

MIT

Available Tools

5 tools
diff_schemasA

Compare two JSON Schemas and identify all differences: added/removed/changed fields, type changes, constraint changes (min/max, patterns, enums). Classifies each change as breaking or non-breaking for backwards compatibility analysis.

Inputs: new_schema (required), old_schema (required).

generate_json_schemaA

Generate a JSON Schema from one or more sample JSON values. Infers types, required fields, formats (email, date, URI, UUID), and detects enum patterns from multiple examples.

Inputs: samples (required), title, detect_enums.

generate_typescriptA

Generate TypeScript interfaces and types from JSON data or a JSON Schema. Handles nested objects, arrays, optional fields, enums, union types, and Record types.

Inputs: json, schema, root_name.

mock_from_schemaA

Generate realistic mock data from a JSON Schema. Uses smart field-name detection to produce contextual values: email fields get valid emails, name fields get realistic names, dates get ISO strings, etc. Supports all JSON Schema types and constraints.

Inputs: schema (required), seed, count.

validate_schemaA

Validate data against a JSON Schema. Returns detailed error messages with JSON path, expected type, actual value, and the violated keyword (type, required, format, pattern, minimum, etc.).

Inputs: data (required), schema (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: generation from data, generation from schema, validation, mocking, and diffing. No overlap or ambiguity between tool responsibilities, so an agent should reliably select the correct tool for a given task.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern (generate_, validate_, mock_, diff_). The verbs are specific and descriptive, and the noun consistently refers to the primary artifact (schema or types). No mixed conventions or vague naming.

    Tool Count5/5

    With exactly 5 tools covering the core schema lifecycle, the count is tight and focused. Each tool earns its place, and the number is within the ideal range for a utility server without being overly minimal or bloated.

    Completeness5/5

    The set covers the major schema operations: creating schemas from data, generating types for coding, validating data, generating mocks, and comparing schemas for evolution. Together they form a coherent, end-to-end toolkit with no obvious dead ends or missing critical operations.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Detects schema mismatches between data producers and consumers through static analysis, supporting extraction, comparison, code generation, and automated validation with watch mode for MCP tools, APIs, and service contracts.
      11
      21 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to generate TypeScript types, Zod schemas, TypeBox, and JSON Schema from any API endpoint or JSON.
      2 npm
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables schema conversion from SQL/Prisma/JSON to Zod, TypeScript, and Pydantic, and generates realistic synthetic mock data.
      3
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables validating JSON/JSONC, getting/setting values with jq-like paths, pretty-printing or minifying, validating against Ajv JSON Schema, and diffing local files or inline strings without network calls.
      8
      MIT