About Diff
Diff is an MCP server for comparing text and structured data, aimed at clients that need readable change reports. It accepts several data formats and can return diffs as text, JSON, or JSON Patch.
Key features
- 01Compare text with text diff
- 02Compare JSON, JSON5, YAML, TOML, XML, and HTML
- 03Choose input formats independently
- 04Output text, JSON, or JSON Patch
Use cases
- 01Reviewing changes between text versions
- 02Comparing structured data files
- 03Generating a JSON Patch from two inputs
MCP support
The MCP server exposes a `diff` tool that accepts left and right text or data, with optional input and output formats. MCP clients can request readable differences in text, JSON, or JSON Patch.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
1Saved tool list · updated 3w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| left | any | Yes | The left side of the diff. |
| leftFormat | enum | No | format of left side of the difftext | json | json5 | yaml | toml | xml | html |
| right | any | Yes | The right side of the diff (to compare with the left side). |
| rightFormat | enum | No | format of right side of the difftext | json | json5 | yaml | toml | xml | html |
| outputFormat | enum | No | The output format. text: (default) human readable text diff, json: a compact json diff (jsondiffpatch delta format), jsonpatch: json patch diff (RFC 6902)text | json | jsonpatch |
Details
From the project README
diff-mcp
jsondiffpatch.com
MCP Server to compare text or data and get a diff
powered by jsondiffpatch
Features
- compare text (using text diff powered by google-diff-match-patch )
- compare data (json, json5, yaml, toml, xml, html) and get a readable diff in multiple output formats (text, json, jsonpatch)
Tool
diff
compare text or data and get a readable diff.
Inputs:
left(string | unknown[] | Record<string, unknown>): left text or dataleftFormat(string, optional): text, json, json5 (default), yaml, toml, xml, htmlright(string | unknown[] | Record<string, unknown>): right text or data (to compare with left)rightFormat(string, optional): text, json, json5 (default), yaml, toml, xml, htmloutputFormat(string, optional): text (default), json, jsonpatch
Setup
Usage with Claude Desktop
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"diff": {
"command": "npx",
"args": [
"-y",
"diff-mcp"
]
}
}
}
All contributors ✨
License
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.