Home / MCP / JSON Schema MCP Server

JSON Schema MCP Server

Provides a server to store JSON schemas, create new schemas, and generate instances from them.

python
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "json_schema": {
            "command": "python",
            "args": [
                "server.py"
            ]
        }
    }
}

You can use this MCP server to store JSON schemas, create new schemas, and generate concrete instances from those schemas. It streamlines designing data contracts and producing valid data that conforms to them, which is useful for validating inputs, generating mock data, and powering robust APIs.

How to use

You interact with the MCP server through a client that speaks the MCP protocol. Start by creating a schema for your data, then generate instances from that schema by providing value mappings. Store and retrieve schemas as your data models evolve, and use generated instances to test validation and downstream processing.

How to install

Prerequisites: Python is installed on your system.

pip install mcp[cli]

Run the server directly with Python.

python server.py

Alternatively, install the MCP server via the command line tool.

mcp install server.py

Additional notes

You can use the provided tools to manage schemas and instances. Persisted schemas can be retrieved by their IDs, and a list of all available schemas is also available for discovery.

Example workflow includes creating a Person schema and then creating a Person instance from that schema.

Create a Person schema with required fields and then instantiate it with concrete values.

Available tools

create_schema

Create a new JSON schema by specifying a title, properties with types, and required fields.

create_instance

Create a concrete JSON instance from an existing schema by providing the schema_id and the values to populate.