Design Comparison Server
БесплатноНе проверенCompare design and implementation screenshots using pixel-by-pixel analysis, generating visual diff images and metrics.
Описание
Compare design and implementation screenshots using pixel-by-pixel analysis, generating visual diff images and metrics.
README
An MCP (Model Context Protocol) server that allows LLMs to compare design screenshots with implementation screenshots using pixelmatch. Supports multiple image formats including PNG, JPEG, WebP, GIF, and TIFF. This tool helps identify visual discrepancies between design mockups and actual implementation.
Features
- Multi-Format Support: Works with PNG, JPEG, WebP, GIF, and TIFF images
- Screenshot Comparison: Compare two images pixel-by-pixel
- SSIM Score: Structural-similarity metric (0–1) that tracks perceived difference, not just raw pixel deltas
- Auto-Resize: Mismatched resolutions are reconciled automatically — the implementation is scaled to the design's dimensions.
resize_fitcontrols how (containpreserves aspect ratio by default;fill/coveravailable); toggle off withauto_resize - Ignore Regions: Exclude rectangles (e.g. timestamps, avatars) from the comparison so dynamic content doesn't count
- Visual Diff Output: Generate a highlighted diff image showing differences
- Detailed Metrics: Get total pixels, different pixels, and percentage difference
- Configurable Threshold: Adjust sensitivity of the comparison
- Base64 Support: Return diff images as base64 or save to file
Installation
For End Users
Install globally via npm:
npm install -g mcp-design-comparison
Or using npx (no installation required):
npx mcp-design-comparison
For Development
git clone https://github.com/w01fgang/mcp-design-comparison.git
cd mcp-design-comparison
npm install
npm run build
Usage
As an MCP Server
Add this server to your MCP client configuration. The server runs on stdio and provides a single tool:
Tool: compare_design
Compare a design screenshot with an implementation screenshot.
Parameters:
design_path(string, required): Path to the design screenshot (supports PNG, JPEG, WebP, GIF, TIFF)implementation_path(string, required): Path to the implementation screenshot (supports PNG, JPEG, WebP, GIF, TIFF)output_diff_path(string, optional): Path to save the diff image (always saved as PNG). If not provided, the diff image will be returned as base64threshold(number, optional): Matching threshold (0-1). Smaller values make the comparison more sensitive. Default is 0.1auto_resize(boolean, optional): When the two screenshots differ in resolution, scale the implementation to the design's dimensions instead of erroring. Default istrue. Setfalseto require identical dimensions.resize_fit(string, optional): How to scale the implementation when dimensions differ —contain(default, preserves aspect ratio and letterboxes),fill(stretches to exact dimensions), orcover(preserves aspect ratio and crops overflow).ignore_regions(array, optional): Rectangles{ x, y, width, height }in design-space coordinates to exclude from the comparison (e.g. dynamic content). Excluded pixels count toward neither the diff nor the percentage denominator.
Returns:
- Total number of pixels (excluding any ignored regions)
- Number of different pixels
- Percentage difference
- SSIM score (0–1, where 1.0 means identical)
- Diff image (as file or base64)
Configuration Example
Add to your MCP settings file:
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"design-comparison": {
"command": "npx",
"args": ["-y", "mcp-design-comparison"]
}
}
}
Cursor (~/Library/Application Support/Cursor/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json on macOS):
{
"mcpServers": {
"design-comparison": {
"command": "npx",
"args": ["-y", "mcp-design-comparison"]
}
}
}
After adding the configuration, restart Claude Desktop or Cursor.
How It Works
- Loads both images into memory (any supported format → raw RGBA)
- If dimensions differ, scales the implementation to the design's dimensions using
resize_fit(defaultcontain, aspect-preserving; unlessauto_resizeisfalse, which errors instead) - Masks out any
ignore_regionsin both images so excluded pixels don't count - Uses pixelmatch to compare pixel-by-pixel and computes an SSIM score
- Generates a diff image highlighting differences in pink
- Returns statistics, the SSIM score, and the diff image
Example Use Cases
- Design QA: Verify that implementation matches design mockups
- Regression Testing: Compare screenshots before and after changes
- Cross-browser Testing: Compare renders across different browsers
- Responsive Design: Compare layouts at different breakpoints
Testing
Run Automated Tests
npm test
Manual Testing with Your Screenshots
Use the included test script:
node test-manual.mjs design.png implementation.png [output-diff.png]
Requirements
- Node.js 18+
- Images in a supported format (PNG, JPEG, WebP, GIF, or TIFF); differing resolutions are auto-resized unless
auto_resizeis disabled
License
MIT
Установка Design Comparison Server
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/w01fgang/mcp-design-comparisonFAQ
Design Comparison Server MCP бесплатный?
Да, Design Comparison Server MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Design Comparison Server?
Нет, Design Comparison Server работает без API-ключей и переменных окружения.
Design Comparison Server — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Design Comparison Server в Claude Desktop, Claude Code или Cursor?
Открой Design Comparison Server на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
LibreOffice Tools
Enables AI agents to read, write, and edit Office documents via LibreOffice with token-efficient design. Supports multiple formats including DOCX, XLSX, PPTX, a
автор: passerbyflutterdannote/figma-use
Full Figma control: create shapes, text, components, set styles, auto-layout, variables, export. 80+ tools.
автор: dannoteLogo.dev
Search and retrieve company logos by brand or domain. Customize size, format, and theme to match your design needs. Accelerate design, prototyping, and content
автор: NOVA-3951PIX4Dmatic
Enables GUI automation for controlling PIX4Dmatic on Windows through MCP. Supports launching, focusing, capturing screenshots, sending hotkeys, clicking UI elem
автор: jangjo123Compare Design Comparison Server with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории design
