Labsco
MCP SERVER

Unified Diff MCP Server

by gorosun

Turn a unified diff into a side-by-side HTML view — shared as a self-deleting GitHub Gist, or saved locally as HTML or PNG.

Git Hosting & Code Review
Summary
The expiring Gist is the feature.

Sharing a diff usually means pasting code somewhere permanent. Here the default is a secret Gist that deletes itself in half an hour, with tighter presets — access code, 15-minute window — when the code is sensitive. If you have no token at all it degrades to a local file rather than erroring, so the file path stays usable regardless.

What it is

An MCP server that renders diffs as readable visual comparisons instead of raw text. Two tools, split by where the output goes: one publishes to a GitHub Gist and hands back a preview URL, the other writes a file to disk. Rendering uses diff2html; PNG output goes through a headless browser.

What you get
  • A diff published as a GitHub Gist with a browser-ready preview URL, auto-deleting after `expiryMinutes` (default `30`, range 1–1440), secret by default — `visualize_diff_html_content`
  • The same diff written to local disk as HTML or PNG, optionally opening in your browser — `visualize_diff_output_file`
  • Display controls shared by both: `format` as `side-by-side` (default) or `line-by-line`, `showFileList`, `highlight` for syntax colouring, and `oldPath`/`newPath` for the labels
  • Three sharing levels when the content is sensitive: secret Gist with a 60-minute expiry, secret Gist plus an access code at 30 minutes, or the same with a 15-minute window
  • A fallback when no GitHub token is present: the HTML is written to a temporary file and opened locally instead of failing
Requirements

Bun as the runtime, and Claude Desktop or another MCP client. `GITHUB_TOKEN` is required only for the Gist path — a personal access token with `gist` scope; local file output needs no credential at all. `DEFAULT_AUTO_OPEN` (default `false`) and `DEFAULT_OUTPUT_MODE` (default `html`) set the behaviour you do not want to repeat per call. Auto-open works on Windows, macOS and Linux with the platform's own opener.

Setup effort

One command plus a key — bunx @smithery/cli install @gorosun/unified-diff-mcp --client claude --config '{ "defaultAutoOpen": true, "defaultOutputMode": "html", "githubUsername": "your_actual_github_username", "githubToken": "ghp_your_actual_token_here" }', then supply credentials