About diff-mcp
diff-mcp is an MCP server for code-review and code-edit agents that creates unified diffs, applies patches, and parses patch files. It reports change counts and whether patch application succeeds.
Key features
- 01Generate unified diffs
- 02Apply patches and report failures
- 03Parse file and hunk details
- 04Count additions and deletions
Use cases
- 01Create patches for code edits
- 02Check whether a patch applies
- 03Summarize changes in patch files
MCP support
Exposes diff generation, patch application, and patch parsing tools to MCP clients.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
3Saved tool list · updated 3w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| context | integer | No | Lines of context per hunk. |
| new_text | string | Yes | |
| old_text | string | Yes | |
| new_filename | string | No | |
| old_filename | string | No |
Details
From the project README@mukundakatta/diff-mcp
MCP server for character-precise unified diffs + patch application + patch parsing. For code-review and code-edit agents.
Why this exists
LLMs hand-roll diffs that look right but won't apply: off-by-one line numbers, missing context lines, wrong hunk headers. Routing through this server produces patches that the standard patch utility (and git apply) accept on the first try.
Tools
| Tool | Returns |
|---|---|
unified_diff(old_text, new_text, ...) | Patch text plus addition / deletion / unchanged line counts |
apply_patch(original_text, patch) | {success, result, reason?} — success:false means context drift |
parse_patch(patch) | File list with per-file hunk count + addition / deletion totals |
Install — Claude Desktop
{
"mcpServers": {
"diff": { "command": "npx", "args": ["-y", "@mukundakatta/diff-mcp"] }
}
}
Same shape for Cursor / Cline / Windsurf / Zed.
License
MIT OR Apache-2.0.
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.