# JSON Diff Visualizer MCP MCP

> JSON Diff Visualizer generates human-readable, colorized diffs between two complex JSON objects. It shows exactly what lines were added or removed in a configuration file—using green for additions and red for deletions. This is structural comparison, not just text comparison, making it essential for reviewing API specs and deployment manifests.

## Overview
- **Category:** productivity
- **Price:** Free
- **Tags:** json-diff, version-control, data-comparison, visualization, config-management

## Description

You're working on infrastructure code or an API definition. You update the JSON config locally and then push it up for review. Before anyone merges that change, you need to know exactly what changed in the structure. This MCP handles that. Instead of looking at raw logs or a wall of text, it gives you a clear, visual comparison showing structural differences between two versions of your data. It treats JSON by its keys and values, so if someone reorders the fields, it doesn't flag it as a change—it just shows what really changed. You can send this colored diff output directly into Slack or a Pull Request comment for instant team review. When you connect this MCP through Vinkius, your agent gets a single source of truth for data comparison, letting you focus on the logic rather than the formatting.

## Tools

### diff_json
Accepts two JSON strings and returns both a machine-readable structural diff and a visual report showing added, removed, or modified fields with their exact paths.

## Prompt Examples

**Prompt:** 
```
Show me a visual diff between our staging and production API configs so I can review before approving the deploy.
```

**Response:** 
```
Visual diff with + (added), - (removed) markers. 3 changes highlighted for human review.
```

**Prompt:** 
```
Post the JSON config changes to our Slack #deployments channel for team review.
```

**Response:** 
```
```diff
- "replicas": 2
+ "replicas": 3
``` Ready to paste into Slack.
```

**Prompt:** 
```
Compare the old and new Terraform state files and show me what infrastructure changed.
```

**Response:** 
```
Visual diff: 2 resources modified, 1 added, 0 destroyed.
```

## Capabilities

### Compare JSON structures
Passes two distinct JSON objects to generate a structural and visual difference report.

### Visualize additions and removals
Highlights new fields (green '+') and deleted fields (red '-') in the output diff.

### Generate machine-readable output
Provides a structured, programmatically usable format alongside the human-readable visualization.

### Review configuration changes
Creates an output designed for pasting into collaborative tools like Slack or Git PRs.

## Use Cases

### Approving a new microservice API spec
A backend developer needs to approve changes to the `user_profile` JSON schema. Instead of manually comparing the old file against the new one, they run the comparison through the MCP. The agent reports back with a visual diff: 'Only the `email_verified` field was added,' saving minutes of tedious manual checking.

### Comparing database state snapshots
A data engineer compares two JSON files representing the system's state before and after a deployment. The MCP immediately highlights which fields were removed or changed, allowing them to confirm that no critical indexes were accidentally deleted.

### Reviewing infrastructure code changes
A DevOps team member compares two versions of a Kubernetes manifest JSON file. The agent uses the MCP to show a visual diff: 'Two replicas changed from 2 to 3, and one new port was added,' providing actionable data for the release notes.

## Benefits

- Stop reading plain text logs. The `diff_json` tool gives you a colored, visual diff that looks exactly like the output every developer expects from Git—green for additions and red for removals.
- It compares JSON structures by key and value, not just character position. This means if your team reorders fields in an API spec, you won't get false positives flagging everything as modified.
- The output is immediately usable for collaboration. You can feed the result directly into a Slack message or a Pull Request comment, making review faster than writing a single sentence.
- You get two outputs: a human-friendly visual diff and a raw structural object that your automation tools can consume. It covers both manual review and programmatic checks.
- This MCP saves time by eliminating the need to manually compare complex data objects in multiple tabs, giving you one clear place for version control comparison.

## How It Works

The bottom line is that you get a clean report showing exactly what changed between two versions of your JSON data.

1. Provide your AI client with two JSON strings: the 'old' version and the 'new' version.
2. The MCP processes both inputs, comparing them field by field to build a structural map of differences.
3. You receive both a structured data object (for machine use) and a colored, easy-to-read visual diff.

## Frequently Asked Questions

**Does JSON Diff Visualizer MCP handle reordered keys?**
Yes. This MCP ignores key order when comparing two objects. It focuses purely on the structural presence and value of the data, so you don't get false positives just because someone rearranged fields.

**What is the difference between this MCP and a standard file diff?**
A standard tool compares text lines; this MCP compares JSON structures. It understands that changing a value in a nested object isn't the same as deleting an entire key.

**Can I use `diff_json` for Terraform state files?**
Yes. You can pass two versions of your state file—old and new—to the tool to visually track which resources were added, modified, or removed in the structure.

**Does JSON Diff Visualizer MCP support machine-readable output?**
Absolutely. Along with the visual diff, it provides a structured object that your automation pipelines can consume for programmatic actions.

**What happens if I pass malformed or invalid JSON strings to the `diff_json` tool?**
The process fails gracefully and returns an explicit error object. The system identifies which input string is improperly formatted, allowing you to correct your data before re-running the comparison.

**When using `diff_json`, does it correctly compare array elements by index, or can I modify element order?**
It compares elements based on their positional index. If you change the order of items in an array, those elements will be flagged as removed and added, rather than simply modified.

**Can `diff_json` handle very deeply nested or massive JSON structures efficiently?**
Yes, the structural diff engine is designed for deep nesting. It processes large data sets by traversing the object tree recursively, maintaining performance even with complex configurations.

**Is my sensitive configuration data secure when I use `diff_json` through your MCP?**
The comparison runs locally within the session context and is processed solely to generate the diff output. We do not retain or store the raw JSON inputs after the comparison is complete.

**How is this different from deep-diff-engine?**
deep-diff-engine returns structured change objects for programmatic processing (CI/CD pipelines, automated alerts). json-diff-visualizer returns human-readable text with +/- markers for visual review (Slack, PR comments, approval workflows). Use both together.

**Does reordering keys show as a change?**
No. The diff is structural — {a:1,b:2} and {b:2,a:1} show zero differences because the data is semantically identical.

**Can I use the output in Slack or GitHub PR comments?**
Yes. The output is plain text with +/- markers — paste directly into code blocks in Slack, GitHub, or any markdown-compatible platform.