JSON模式管理服务器

一个管理JSON模式并根据模式生成实例的服务器。

  • by jaho5
  • Python
  • 本地部署
  • 4 星标
  • 更新于
在 GitHub 查看 jaho5/json-schema-mcp

使用说明

JSON模式MCP服务器

管理JSON模式并从中创建实例的MCP服务器。

特性

  • 存储和检索JSON模式
  • 创建新的JSON模式 用一个简单的工具
  • 生成实例 来自具有自定义值的模式

资源

  • schema://{schema_id} -按ID获取特定架构
  • schemas://list -获取所有可用模式的列表

工具

  • create_schema -创建新的JSON模式
  • create_instance -从模式创建JSON实例

用法

  1. 安装依赖项:

    pip install mcp[cli]
    
  2. 运行服务器:

    python server.py
    
  3. 或者使用Claude Desktop进行安装:

    mcp install server.py
    

例子

创建人员架构

// Create a schema for a person
create_schema(
  title="Person",
  properties={
    "name": {"type": "string"},
    "age": {"type": "integer"},
    "email": {"type": "string", "format": "email"}
  },
  required=["name", "email"]
)

创建实例

// Create a person instance
create_instance(
  schema_id="<schema-id-from-previous-step>",
  values={
    "name": "John Doe",
    "age": 30,
    "email": "john@example.com"
  }
)