Skip to content

Repository files navigation

valj

valj

JSON Schema validation toolkit.

Schema basis

valj validates against JSON Schema Draft 2020-12 (specification, meta-schema URI https://json-schema.org/draft/2020-12/schema).

Crates

Crate Description
valj-core Core validation engine
valj-format Output formatting helpers
valj Command-line validation tool
valj-mcp MCP server — validates JSON over stdio for AI clients

Manual pages

Authoritative end-user documentation lives in docs/man/ and is shipped as Unix manual pages.

Page Section Topic
valj(1) 1 Command-line validator
valj-mcp(1) 1 MCP server
valj-mcp.toml(5) 5 Server registry config
valj-schema(5) 5 Schema dialect with worked examples
valj-protocol(7) 7 Validation pipeline, error budget, output formats

After installing the Debian package the same pages are available locally through man valj, man 5 valj-schema, etc.

Quick start

CLI

cargo install --path crates/valj
# Quick syntax check (no schema needed)
valj input.json
# Full schema validation
valj validate --schema schema.json --input input.json

See valj(1) for the full command reference and valj-schema(5) for schema authoring with worked examples (types, ranges, required fields, patterns, custom keywords).

MCP server (Claude Desktop, etc.)

cargo install --path crates/valj-mcp

valj-mcp exposes four tools over stdio:

Tool Description
valj_list_schemas List all loaded schemas and their status
valj_validate Syntax check or full schema validation
valj_check_schema Validate a schema file against JSON Schema Draft 2020-12
valj_register_schema Register a new schema at runtime (requires dynamic mode)

Syntax-only check (no schema_name):

{ "input": "{\"name\": \"Alice\"}" }
{ "mode": "syntax_only", "syntaxValid": true }

Full validation (schema_name must match a loaded schema):

{ "input": "{\"name\": \"Alice\", \"status\": \"active\"}", "schema_name": "person" }
{ "mode": "full", "valid": true, "findings": [] }

See valj-mcp(1) for the full server reference, valj-mcp.toml(5) for the registry config format, and crates/valj-mcp/README.md for a quick install walkthrough.

Development

cargo test --workspace
cargo clippy --workspace --all-targets -- -D warnings

See docs/development.md for the full build, test, lint, and documentation matrix.

Lint policy

Lints are centrally defined via [workspace.lints] in the root Cargo.toml. All crates inherit these via [lints] workspace = true.

Active policies:

  • unsafe_code = "deny" — unsafe blocks require a local #[allow(unsafe_code)]
  • rust_2018_idioms = "warn" — enforces modern Rust idioms
  • clippy::all = "warn" — standard Clippy checks
  • clippy::cargo = "warn" — Cargo manifest checks (with cargo_common_metadata and multiple_crate_versions allowed for internal crates)

Changelog

See CHANGELOG.md.

About

JSON Schema validation toolkit

Topics

Resources

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages