Agent tools
Give coding agents accurate, private JSON tools.
The local MCP server and CLI expose the same lossless engine as the web workspace. Documents stay inside the developer's Node.js process; the package makes no network requests and collects no analytics.
Run the MCP server
Configure any client that supports local stdio MCP servers to run:
npx -y bestjsonformatter mcpVersion 0.1.0 is published on npm and listed in the official MCP Registry. The first run downloads the package; every JSON operation after launch stays inside the local process.
Available tools
format_json- Format, minify, or recursively sort keys without rewriting exact JSON tokens.
validate_json- Validate strict syntax with deterministic line, column, and offset diagnostics.
repair_json- Propose a reviewable repair without modifying the source.
analyze_json- Find duplicate keys and JavaScript number precision risks.
compare_json- Compare document structure rather than whitespace or key order.
query_json- Run JSONPath and return matching values.
convert_json- Convert valid JSON to YAML, CSV, or XML.
infer_json_schema- Infer a Draft 2020-12 schema from an example.
validate_json_schema- Validate a document and return all schema errors.
generate_json_sample- Generate a representative document from a schema.
Use the CLI directly
Coding agents can also invoke the deterministic commands without MCP:
npx bestjsonformatter validate response.json
npx bestjsonformatter duplicates response.json
npx bestjsonformatter precision response.json
npx bestjsonformatter query '$.items[*].id' response.jsonWhy this is not an AI formatter
Formatting, parsing, schema validation, and numeric correctness should be deterministic. The tools do not ask a language model to rewrite the document. They preserve duplicate properties, large integers, exponent notation, and original escape spelling so an agent can inspect or fix the actual data rather than a lossy JavaScript-object conversion.
Human review
Agents work locally; people can inspect visually.
Use the web workspace when a result needs a searchable, editable, foldable document view. The MCP package never uploads its current document when opening the site.