Compare JSON
About
A lightweight, dependency-free MCP for deep comparison of JSON values. Detects additions, deletions, type changes, and value changes between two JSON structures with fine-grained control over comparison behavior.
Details
- Author
- unitstack
- Downloads
- 176
- Categories
- Developer Tools
Jump to
- compare_json tool with multiple input options (raw, string, file path).
- Configurable array comparison: byIndex, lcs, or unordered.
- Case‑insensitive key and value comparison toggles.
- Numeric‑string equals number comparison option.
- Returns an array of JSONValueDifference objects with path and diff type.
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Compare JSONCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Start the server by running compare-json --mcp from a global install or npx @compare-json/cli --mcp. It communicates over stdio. Add the provided configuration to your MCP client (e.g., mcp.json) to register the compare-json server.
compare_json
Compare two JSON values and return differences. Supports various comparison options including comparisons case-insensitive comparisons, and numeric string handling.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"compare json": {
"compare-json": {
"command": "npx",
"args": [
"@compare-json/cli@latest",
"--mcp"
]
}
}
}
}
McpServers
{
"compare-json": {
"command": "npx",
"args": [
"@compare-json/cli@latest",
"--mcp"
]
}
}
MCP Server
@compare-json/cli also ships an MCP (Model Context Protocol) server that exposes the comparison engine as a tool for AI assistants.
Online Playground
Try it out at https://comparejson.comStart the MCP Server
``bash
from a global install
compare-json --mcp
or via npx
npx @compare-json/cli --mcp
`
The server communicates over stdio.
Available Tools
compare_json
Compare two JSON values and return their differences.
Input parameters:
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| baseJSON | any | conditional | Base JSON value (already parsed). |
| baseJSONString | string | conditional | Base JSON as a stringified value (parsed by the server). |
| baseJSONFilePath | string | conditional | Path to a base JSON file (read and parsed by the server). |
| contrastJSON | any | conditional | Contrast JSON value (already parsed). |
| contrastJSONString | string | conditional | Contrast JSON as a stringified value. |
| contrastJSONFilePath | string | conditional | Path to a contrast JSON file. |
| options | object | No | Comparison options (see below). |
At least one of baseJSON / baseJSONString / baseJSONFilePath must be provided, and at least one of contrastJSON / contrastJSONString / contrastJSONFilePath. When more than one is set for a side, file path takes precedence, then string, then raw value.
Options:
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| arrayCompareMethod | 'byIndex' \| 'lcs' \| 'unordered' | 'byIndex' | Array comparison strategy. |
| keyCaseInsensitive | boolean | false | Case-insensitive key comparison. |
| valueCaseInsensitive | boolean | false | Case-insensitive value comparison. |
| numericStringEqualsNumber | boolean | false | Treat numeric strings as equal to numbers. |
Output:
Returns structuredContent.differences — an array of JSONValueDifference objects — and a content[0].text mirror of the same data as JSON text.
`json
{
"differences": [
{
"pathSegments": ["name"],
"pathString": "name",
"pathBelongsTo": "both",
"diffType": "valueChanged"
}
]
}
`
MCP Client Configuration
Add the following to your MCP client config (e.g. mcp.json):
`json
{
"mcpServers": {
"compare-json": {
"command": "npx",
"args": ["@compare-json/cli@latest", "--mcp"]
}
}
}
``Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





