MCP Image Compare Server
Click on "Install 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 Image Compare ServerCompare before.png and after.png for visual differences."
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 Image Compare Server
TiαΊΏng Viα»t | English
A Model Context Protocol (MCP) server for pixel-perfect image comparison using Pixelmatch from Mapbox. Compare images, capture and compare screenshots, detect visual differences with precision.
Features
π― Pixel-perfect comparison - Detect even single-pixel differences
π¨ Perceptual color difference - YIQ color space for human-like perception
π Anti-aliasing detection - Smart detection and exclusion of anti-aliased pixels
π Detailed statistics - Pixel count, percentage, dimensions
πΌοΈ Visual diff output - Color-coded difference visualization
π Web screenshot support - Compare with live websites
π Multiple formats - PNG and JPEG support
β‘ Fast & lightweight - ~60-80KB package size
Quick Start
Installation
# Install globally
npm install -g mcp-image-compare-server
# Install Chromium for screenshots
npx playwright install chromiumConfiguration
For Claude Desktop
Add to your Claude Desktop config file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"image-compare": {
"command": "npx",
"args": ["-y", "mcp-image-compare-server"]
}
}
}Restart Claude Desktop after configuration.
For Cursor
Add to your Cursor MCP settings file:
Windows: %APPDATA%\Cursor\User\globalStorage\mcp.json
macOS: ~/Library/Application Support/Cursor/User/globalStorage/mcp.json
Linux: ~/.config/Cursor/User/globalStorage/mcp.json
{
"mcpServers": {
"image-compare": {
"command": "npx",
"args": ["-y", "mcp-image-compare-server"]
}
}
}Or through Cursor settings:
Open Cursor Settings (
Ctrl+,orCmd+,)Search for "MCP"
Click "Edit in settings.json"
Add the configuration above
Restart Cursor after configuration.
Usage
Ask in Claude Desktop or Cursor:
Compare image1.png and image2.pngThat's it! π
Tools
1. compare_images
Compare two local image files.
Parameters:
image1_path(string, required) - Path to first imageimage2_path(string, required) - Path to second imagediff_output_path(string, optional) - Where to save diff imagethreshold(number, optional) - Comparison threshold (0-1), default 0.1includeAA(boolean, optional) - Include anti-aliased pixels, default false
Example:
{
"image1_path": "./screenshots/before.png",
"image2_path": "./screenshots/after.png",
"diff_output_path": "./diff-result.png",
"threshold": 0.1
}2. compare_image_with_url
Compare a local image with a screenshot from a URL.
Parameters:
image_path(string, required) - Path to local imageurl(string, required) - URL to capture and comparediff_output_path(string, optional) - Where to save diff imagethreshold(number, optional) - Comparison threshold (0-1), default 0.1includeAA(boolean, optional) - Include anti-aliased pixels, default false
Example:
{
"image_path": "./design-mockup.png",
"url": "https://example.com",
"threshold": 0.15
}3. compare_urls
Compare screenshots from two different URLs.
Parameters:
url1(string, required) - First URL to captureurl2(string, required) - Second URL to capturediff_output_path(string, optional) - Where to save diff imagethreshold(number, optional) - Comparison threshold (0-1), default 0.1includeAA(boolean, optional) - Include anti-aliased pixels, default false
Example:
{
"url1": "https://staging.example.com",
"url2": "https://production.example.com"
}Output Format
All tools return JSON with detailed statistics:
{
"success": true,
"diffPixels": 1234,
"totalPixels": 921600,
"percentDiff": 0.13,
"width": 1280,
"height": 720,
"diffImagePath": "/path/to/diff.png",
"message": "Comparison completed: 1234 pixels differ (0.13%)"
}Fields:
success- Operation status (true/false)diffPixels- Number of different pixelstotalPixels- Total pixels in imagepercentDiff- Percentage differencewidth- Image width in pixelsheight- Image height in pixelsdiffImagePath- Path to generated diff imagemessage- Human-readable result messageerror- Error message (if failed)
Use Cases
Visual Regression Testing
Compare UI before and after updates to catch unintended changes.
I have two screenshots:
- before-update.png
- after-update.png
Compare them and tell me what changed.Cross-browser Testing
Compare rendering across different browsers to ensure consistency.
Design Review
Compare design mockups with actual implementation.
Compare design-mockup.png with https://myapp.com/landingA/B Testing
Compare different versions of the same page.
Compare:
- https://myapp.com/variant-a
- https://myapp.com/variant-bMobile vs Desktop
Compare responsive layouts across different viewports.
Configuration
Threshold Values
The threshold parameter (0-1) controls comparison sensitivity:
0.0 - Very sensitive, detects smallest differences
0.1 - Default, good balance for most cases
0.3 - Less sensitive, ignores minor differences
1.0 - Least sensitive, only major differences
Anti-aliasing
When includeAA = false (default), the server automatically detects and ignores anti-aliased pixels, reducing false positives from different rendering engines.
Diff Image Colors
Red: Different pixels
Yellow: Anti-aliased pixels (if includeAA = true)
Faded: Matching pixels (reduced opacity)
Installation Methods
Method 1: NPM Global (Recommended)
npm install -g mcp-image-compare-server
npx playwright install chromiumConfigure Claude Desktop:
{
"command": "npx",
"args": ["-y", "mcp-image-compare-server"]
}Method 2: NPX (No Installation)
Configure Claude Desktop:
{
"command": "npx",
"args": ["-y", "mcp-image-compare-server"]
}First run will download the package automatically.
Method 3: From Source
git clone https://github.com/leky90/mcp-image-compare-server.git
cd mcp-image-compare-server
npm install
npx playwright install chromium
npm run buildConfigure Claude Desktop or Cursor:
{
"command": "node",
"args": ["/absolute/path/to/mcp-image-compare-server/dist/index.js"]
}Replace /absolute/path/to/mcp-image-compare-server with your actual path.
System Requirements
Node.js: 18.0.0 or higher
npm: 8.0.0 or higher
OS: Windows 10+, macOS 10.15+, Linux (Ubuntu 20.04+)
Disk: ~500MB (includes Chromium browser)
RAM: 2GB minimum
Troubleshooting
Server doesn't connect
Verify config path is correct
Ensure you ran
npm run buildRestart Claude Desktop or Cursor completely
Check the MCP logs for errors
"Browser not found" error
npx playwright install chromiumScreenshot timeout
For slow websites, the default 30-second timeout will handle most cases. If issues persist, please report.
Out of memory
For very large images:
Resize images before comparison
Use lower resolution images
Increase Node.js memory:
node --max-old-space-size=4096 dist/index.js
Development
Building from Source
npm install
npm run buildRunning Locally
npm start
# or
npm run devTesting
See CONTRIBUTING.md for development guidelines.
Tech Stack
Framework: Model Context Protocol SDK
Image Comparison: Pixelmatch
Screenshots: Playwright
Language: TypeScript
Contributing
Contributions are welcome! Please read CONTRIBUTING.md for guidelines.
Changelog
See CHANGELOG.md for version history.
License
MIT License - see LICENSE file for details.
Acknowledgments
Built with:
Support
π Bug Reports: GitHub Issues
π¬ Questions: GitHub Discussions
π Documentation: This README
Made with β€οΈ using TypeScript and MCP
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/leky90/mcp-image-compare-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server