mcp-vsdiff
The mcp-vsdiff server exposes VS Code's advanced diff algorithm as a single MCP tool, compute_diff, for computing highly accurate diffs between two text strings.
Key capabilities:
Compare two strings to get a detailed unified diff with standard
@@-style hunks and 3 lines of contextDetect moved code blocks, annotating deletions with
{moved to block #N}and insertions with{moved from block #N}Control whitespace sensitivity via
ignoreTrimWhitespace(defaulttrue) — lines differing only in leading/trailing whitespace appear as unchanged contextSummary footer showing total insertions, deletions, and moved block counts
Metrics block (default
true) reportinghunkCount,changedLines,movedBlocks, andhitTimeoutVerbose metrics for a per-hunk breakdown
Paginate large diffs using
maxDiffLinesandskipDiffLinesMetrics-only mode via
metricsOnlyto assess the scale of changes without returning diff text
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-vsdiff Show diff with move detection between original and modified text"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-vsdiff
An MCP server that exposes VS Code's advanced diff algorithm as a tool.
What it does
Provides a single MCP tool, compute_diff, that computes a highly accurate unified diff between two strings using the same algorithm VS Code uses internally. Features include:
Move detection — identifies blocks of code that were moved, not just deleted/inserted
Unified diff output — standard
@@-style hunks with 3 lines of contextMove annotations — deleted lines show
{moved to block #N}and inserted lines show{moved from block #N}Summary footer — total insertions, deletions, and moved blocks at the end
Related MCP server: Git Stuff Server
Usage
Install
npm installRun
npm startThe server communicates over stdio and is compatible with any MCP client.
Tool: compute_diff
Parameter | Type | Required | Description |
| string | ✅ | The original text |
| string | ✅ | The modified text |
| boolean | Ignore leading/trailing whitespace differences per line (default: | |
| boolean | Append a JSON metrics block to the response (default: | |
| boolean | Add per-hunk breakdown to the metrics block (default: | |
| boolean | Return only the metrics block, no diff text — useful for large files (default: | |
| number | Truncate the diff text if it exceeds this number of lines (default: | |
| number | Number of diff text lines to skip from the beginning. Combine with |
Metrics fields
Field | Description |
| Number of separate change regions (lower = easier to review) |
| Real insertions + real deletions, excluding moved lines |
| Lines added, excluding moved lines |
| Lines removed, excluding moved lines |
| Number of detected move operations |
| Total lines involved in moves |
| Whether the diff computation hit the 5 s time limit |
ignoreTrimWhitespacegotcha: with the defaulttrue, a line whose only change is indentation (e.g. code moved into a deeperifblock) will appear as unchanged context, making the diff look cleaner than a plaingit diffwould. Set tofalseif indentation changes need to be visible.
MCP config example
{
"mcpServers": {
"vsdiff": {
"command": "node",
"args": ["/path/to/mcp-diff/index.js"]
}
}
}Dependencies
@modelcontextprotocol/sdk— MCP server frameworkvscode-diff— VS Code's diff algorithm, extracted as a standalone package
Available Tools
1 toolcompute_diffA
Computes a highly accurate diff with move detection using the VS Code advanced diff algorithm. Returns a human-readable unified diff string with context lines, move annotations, and a summary.
Inputs: modifiedText (required), originalText (required), ignoreTrimWhitespace.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no risk of confusion between tools. The single tool has a clear and distinct purpose.
The tool name 'compute_diff' follows a consistent verb_noun pattern, which is clear and predictable.
The server has only one tool, which is slightly thin for typical MCP servers but is well-scoped for its focused purpose of computing diffs.
The tool fully covers the domain of diff computation with advanced features like move detection and a human-readable summary, leaving no obvious gaps.
Related MCP Connectors
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
Cloudflare Workers MCP server: diff-patch-tools
A MCP server built for developers enabling Git based project management with project and personal…
Related MCP Servers
- AlicenseBqualityDmaintenanceThis MCP server provides unified diffs of two text inputs using Python's standard library difflib.19MIT
- AlicenseCqualityDmaintenanceMCP server providing Git-related functionalities, primarily a tool to generate diffs for Git merge commits against their first parent.4MIT
- AlicenseNot gradedqualityBmaintenanceAn MCP server that exposes Language Server Protocol features to external clients, allowing access to hover information, definitions, completions, references, and rename functionalities.44MIT
- AlicenseAqualityCmaintenanceMCP server that detects semantic (non-textual) merge conflicts between Git branches using AST-level analysis. Catches incompatible changes that Git merges cleanly — signature changes, removed exports, parameter changes, interface breaks, and cross-file dependency conflicts.445 npmMIT