Unified Diff MCP Server
Enables sharing diff visualizations as GitHub Gists with configurable auto-delete, security levels, and access codes.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Unified Diff MCP Server
Beautiful diff visualization for Claude Desktop. Transform code diffs into stunning visual comparisons with GitHub Gist integration and local file output.
✨ Features
🎨 Beautiful HTML diff visualization using diff2html
🌐 GitHub Gist integration for instant sharing
📁 Local file output (PNG/HTML)
🔄 Auto-delete functionality for temporary diffs
🖥️ Cross-platform support (Windows, macOS, Linux)
⚡ High-performance with Bun runtime
🛡️ Enhanced Security with multi-level protection for shared diffs
🔒 Multi-level security (Low/Medium/High) for different use cases
Related MCP server: MCP Image Compare Server
🚀 Quick Start
Installing via Smithery
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"
}'Manual Installation
Install Claude Desktop and Bun
Clone and build:
git clone https://github.com/gorosun/unified-diff-mcp.git cd unified-diff-mcp bun installConfigure Claude Desktop - see Configuration below
🛠️ Tools Overview
Tool | Purpose | Output | Best For |
| Browser display & sharing | GitHub Gist + HTML preview URL | Quick sharing, instant viewing |
| Local file storage | PNG/HTML files | Local storage, presentations |
📖 Usage Examples
🎯 Optimal Prompts by Purpose
Purpose | Recommended Prompt | Tool Used | Output |
Quick Preview |
|
| GitHub Gist + HTML preview URL |
Local Storage |
|
| Local HTML/PNG file |
Share with Others |
|
| GitHub Gist with shareable URL |
Image Export |
|
| Local PNG image |
Code Review |
| Either tool | Side-by-side comparison |
Documentation |
|
| Local HTML file |
🔒 Secure Sharing |
|
| Secret Gist with auto-delete |
Share diff instantly (GitHub Gist)
visualize_diff_html_content:
- Creates temporary GitHub Gist
- Auto-deletes after 30 minutes
- Instant browser-ready URLs
- Perfect for code reviewsSave diff locally
visualize_diff_output_file:
- Saves PNG or HTML to local disk
- Auto-opens in browser (optional)
- Perfect for documentation🎛️ Configuration
Environment Variables
Variable | Description | Default |
| GitHub Personal Access Token (for Gist integration) | Required for |
| Auto-open generated files |
|
| Default output format ( |
|
GitHub Token Setup
Generate new token with
gistscopeAdd to your environment:
export GITHUB_TOKEN="your_token_here"
Claude Desktop Configuration
macOS:
code ~/Library/Application\ Support/Claude/claude_desktop_config.jsonWindows:
code %APPDATA%\Claude\claude_desktop_config.jsonConfiguration template:
{
"mcpServers": {
"unified-diff-mcp": {
"command": "bun",
"args": ["run", "/path/to/unified-diff-mcp/src/index.ts"],
"env": {
"GITHUB_TOKEN": "your_github_token_here",
"DEFAULT_AUTO_OPEN": "true",
"DEFAULT_OUTPUT_MODE": "html"
}
}
}
}📋 Parameters Reference
Common Parameters
Parameter | Type | Default | Description |
| string | (required) | Unified diff text |
| string |
| Display format ( |
| boolean |
| Show file list summary |
| boolean |
| Enable syntax highlighting |
| string |
| Original file path |
| string |
| Modified file path |
| boolean |
| Auto-open in browser |
GitHub Gist Specific
Parameter | Type | Default | Description |
| number |
| Auto-delete time (1-1440 minutes) |
| boolean |
| Public vs secret gist |
Local File Specific
Parameter | Type | Default | Description |
| string |
| Output format ( |
🌍 Platform Support
Platform | Auto-Open | Commands |
Windows | ✅ |
|
macOS | ✅ |
|
Linux | ✅ |
|
🔧 Development
Development mode (with hot reload):
{
"command": "bun",
"args": ["--watch", "/path/to/unified-diff-mcp/src/index.ts"]
}Production mode:
{
"command": "bun",
"args": ["run", "/path/to/unified-diff-mcp/src/index.ts"]
}📚 Advanced Usage
🔒 Enhanced Security Levels
When GitHub Token isn't available or for secure sharing, you can choose from multiple security levels:
Security Level | Configuration | Features | Use Cases |
🟢 Low | Secret Gist + 60min auto-delete | URL-only access | Code examples, learning |
🟡 Medium | Secret Gist + Password + 30min auto-delete | URL + Access code required | Team reviews |
🔴 High | Secret Gist + Password + 15min auto-delete | URL + Access code + Short duration | Sensitive code |
Usage Example
Please visualize this diff with high security:
--- a/config.js
+++ b/config.js
@@ -1,3 +1,4 @@
const config = {
- apiKey: 'old-key'
+ apiKey: 'new-secure-key',
+ timeout: 5000
};Response Example:
🔒 **Secure Diff Visualization**
🔴 **Security Level**: High Security - Secret Gist + Password (15min auto-delete)
📋 **Preview Link**: https://htmlpreview.github.io/?...
🔑 **Access Code**: `a7x9k2`
⏰ **Auto-delete**: 15 minutes🔄 Fallback Functionality
When GitHub Token is unavailable, the system falls back to local files:
HTML saved as temporary file
Automatic browser opening
Security-based file management
For detailed setup and integration guides:
🇺🇸 English: CLAUDE_CODE_INTEGRATION.md
🇯🇵 日本語: CLAUDE_CODE_INTEGRATION_JP.md
🤝 Supported Clients
Claude Desktop (Primary)
Claude Code (CLI)
VS Code + MCP Extension
Cline and other MCP clients
📄 License
MIT License - see LICENSE file for details.
Dependencies
Library | License | Purpose |
diff2html | MIT | HTML diff generation |
playwright-core | Apache 2.0 | Browser automation |
@modelcontextprotocol/sdk | MIT | MCP integration |
Made with ❤️ for the Claude Desktop community
This server cannot be deployed
Maintenance
Related MCP Connectors
Diff two texts by line, word or char: unified diff, HTML redline, patch apply, similarity.
Diff two npm/PyPI versions or lockfiles: new install scripts, network/shell/eval calls, new deps.
Compare two JSON files deeply, regardless of order. Get a detailed difference report highlighting…
Compare two JSON files deeply, ignoring order, to surface every difference. Get a clear, structure…
Related MCP Servers
- AlicenseBqualityDmaintenancecompare 2 text or data (supports text diffs, json, json5, yaml, toml, xml and html). powered by jsondiffpatch162 npm5,353MIT
- AlicenseAqualityDmaintenanceEnables pixel-perfect image comparison and visual regression testing via tools to compare local images, screenshots, and URLs with detailed diff statistics.339 npm4MIT
- AlicenseNot gradedqualityCmaintenanceGenerates beautiful code snippet images with syntax highlighting and customizable themes for sharing on social media.7 npm3MIT
- AlicenseAqualityFmaintenanceRenders source code as beautiful SVG or PNG images with syntax highlighting, line numbers, and diff support. Ideal for AI agents to present code visually to humans or for sharing snippets.211 npmMIT