JSON Schema Validator

A comprehensive JSON Schema validation server implementing the Model Context Protocol (MCP).
  • python

1

GitHub Stars

python

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "eienwolf-jsonshema_mcp": {
      "command": "python",
      "args": [
        "C:\\path\\to\\jsonschema_mcp\\mcp_server.py"
      ],
      "env": {
        "POSTGRES_HOST": "localhost",
        "POSTGRES_PORT": "5432",
        "POSTGRES_USER": "your_username",
        "POSTGRES_DATABASE": "jsonschema_mcp",
        "POSTGRES_PASSWORD": "your_password",
        "POSTGRES_AUTO_RESET": "false",
        "POSTGRES_AUTO_CREATE_SCHEMA": "true"
      }
    }
  }
}

You run a JSON Schema Validator MCP Server that ties JSON Schema Draft 2020-12 validation into your Model Context Protocol workflow, enabling AI assistants to validate data against schemas and manage those schemas with optional PostgreSQL storage or local file fallback.

How to use

Connect an MCP client to the server using a local stdio configuration. You start the server locally and let your client send requests to the running process. The server supports CRUD operations for schemas, real time validation streams for web clients, and automatic resolution of external references.

How to install

Prerequisites you need before starting:

  • Python 3.8 or newer
  • PostgreSQL (optional for database storage)

Step-by-step commands to set up and run the MCP server locally:

# 1. Clone the project
# Replace the path with your preferred location
# Note: this is a placeholder command since exact repo URL/content is defined by your project setup
# You would typically run something like:
# git clone https://github.com/your-org/jsonschema_mcp
# cd jsonschema_mcp

# 2. Install dependencies
pip install -r requirements.txt

# 3. Run the MCP server (stdio integration via Python)
python mcp_server.py

# Optional: run the SSE web client server for real-time streaming
python sse_server.py

Configuration and deployment notes

Configure connection and storage options using environment variables. These settings determine whether the server uses PostgreSQL or falls back to local file storage.

# PostgreSQL Configuration (optional)
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_DATABASE=jsonschema_mcp
POSTGRES_USER=your_username
POSTGRES_PASSWORD=your_password

# Auto-create schema if missing, auto-reset flag for destructive actions
POSTGRES_AUTO_CREATE_SCHEMA=true
POSTGRES_AUTO_RESET=false

Security and reliability

The server includes input validation and path safety checks to prevent directory traversal and other common issues. Destructive operations require explicit confirmation. Error messages are designed to be informative without exposing sensitive details. When running in Docker, processes operate as non-root users for safer isolation.

Troubleshooting

If you encounter issues connecting to PostgreSQL, verify the service is running and credentials are correct. If the database is unavailable, the server will automatically fall back to local file storage. Ensure the schemas directory has write permissions and that any Docker volumes are mounted correctly.

Tools and capabilities

The server exposes a set of validation and schema management tools to operate on your schema collections and perform validations against JSON data. Common operations include validating a JSON document against a schema, generating a schema from sample data, and managing existing schemas.

Notes on deployment modes

You can run the MCP server directly with Python for local development or deploy via Docker for containerized environments. The server supports both modes and can use PostgreSQL when available, otherwise it relies on local storage.

Appendix: MCP server configurations

The following configuration examples show how to integrate the MCP server with your client tooling using stdio for local development and a Docker-based approach for containerized deployment.

Available tools

validate_json_schema

Direct validation of a JSON document against a provided schema.

validate_json_from_collections

Validation against stored schemas from schema collections.

get_validation_info

Retrieves the validator capabilities and details.

add_update_schema

Add or update schemas within collections.

delete_schema

Remove schemas from collections.

get_schema

Retrieve the content of a stored schema.

list_schemas

List all available schemas in the store.

generate_schema

Generate a JSON Schema from sample JSON data.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational