内容
# JSON Schema MCP Server
一个管理 JSON schema 并从中创建实例的 MCP server。
## 功能
- **存储和检索 JSON schema**
- 使用一个简单的工具**创建新的 JSON schema**
- 从具有自定义值的 schema **生成实例**
## 资源
- `schema://{schema_id}` - 通过 ID 获取特定的 schema
- `schemas://list` - 获取所有可用 schema 的列表
## 工具
- `create_schema` - 创建一个新的 JSON schema
- `create_instance` - 从一个 schema 创建一个 JSON 实例
## 使用方法
1. 安装依赖:
```
pip install mcp[cli]
```
2. 运行 server:
```
python server.py
```
3. 或者使用 Claude Desktop 安装:
```
mcp install server.py
```
## 例子
### 创建一个 Person Schema
```
// 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"
}
)
```