MCP Design Comparison Server
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 Design Comparison ServerCompare the design mockup and the implementation screenshot for the login page."
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 Design Comparison Server
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, TIFF, and SVG (rasterized via librsvg). This tool helps identify visual discrepancies between design mockups and actual implementation.
Features
Multi-Format Support: Works with PNG, JPEG, WebP, GIF, TIFF, and SVG 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_resizeIgnore Regions: Exclude rectangles (e.g. timestamps, avatars) from the comparison so dynamic content doesn't count
Vector (SVG) Input: Compare a design PNG against an SVG icon (or SVG vs SVG) — SVGs are rasterized at a configurable density (
svg_density, default 288 dpi) with no pre-render stepDiff Localization: A diff bounding box and a 3x3 heat grid report where differences cluster, not just how many pixels differ
Assertion Gate: Optional
max_difference_percentageflips the result to an error when exceeded — a CI regression gate without parsing textVisual 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
Related MCP server: MCP Component Review
Installation
For End Users
Install globally via npm:
npm install -g mcp-design-comparisonOr using npx (no installation required):
npx mcp-design-comparisonFor Development
git clone https://github.com/w01fgang/mcp-design-comparison.git
cd mcp-design-comparison
npm install
npm run buildUsage
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, SVG)implementation_path(string, required): Path to the implementation screenshot (supports PNG, JPEG, WebP, GIF, TIFF, SVG)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. For an SVG design, design space is the rendered raster (intrinsic size ×svg_density/ 72 — e.g. a 36×36 SVG at the default density 288 is 144×144), not the intrinsic SVG size; the same applies to the returned diff bounds and heat grid.svg_density(number, optional): Rasterization density (DPI) for SVG inputs. Higher = crisper vector render before comparison. Default 288 (4x the 72dpi baseline). Aimed at small assets (icons/logos); lower it for large vector art.localize(boolean, optional): Iftrue(default), include a diff bounding box and a coarse 3x3 heat grid in the result, showing where differences cluster. Setfalseto skip the extra pass.max_difference_percentage(number, optional): If set and the difference percentage exceeds it (strictly greater), the call returns an error (isError: true) while still producing the diff artifact. Use as a CI gate against a golden image. Omit for report-only.
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 bounding box and 3x3 heat grid (when
localizeis on and differences exist)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 countUses pixelmatch to compare pixel-by-pixel, computes an SSIM score, and (when
localizeis on) locates where differences cluster (bounding box + 3x3 heat grid)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 testManual 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, TIFF, or SVG); differing resolutions are auto-resized unless
auto_resizeis disabled
License
MIT
Available Tools
1 toolcompare_designA
Compare a design screenshot with an implementation screenshot using pixelmatch and SSIM. Supports PNG, JPEG, WebP, GIF, TIFF, and SVG inputs (SVGs are rasterized at svg_density). Returns the number and percentage of different pixels, a structural-similarity (SSIM) score, a diff bounding box and heat grid showing where differences cluster, and optionally outputs a diff image highlighting the differences.
| Name | Required | Description | Default |
|---|---|---|---|
| localize | No | If true (default), include a diff bounding box and a coarse per-cell heat grid in the result, showing where differences cluster. Set false to skip the extra pass. | |
| threshold | No | Matching threshold (0-1). Smaller values make the comparison more sensitive. Default is 0.1. | |
| resize_fit | No | How to scale the implementation when dimensions differ. 'contain' (default) preserves aspect ratio and letterboxes; 'fill' stretches to the exact dimensions; 'cover' preserves aspect ratio and crops the overflow. | contain |
| auto_resize | No | If true (default), the implementation screenshot is scaled to the design's dimensions when they differ, instead of failing. Set false to require identical dimensions. | |
| design_path | Yes | Path to the design screenshot (supports PNG, JPEG, WebP, GIF, TIFF, SVG) | |
| svg_density | No | Rasterization density (DPI) for SVG inputs. Higher = crisper vector render before comparison. Default 288 (4x the 72dpi baseline). Aimed at small assets (icons/logos); lower it for large vector art. | |
| ignore_regions | No | Rectangles (design-space coordinates) to exclude from the comparison, e.g. dynamic content like timestamps or avatars. Excluded pixels count toward neither the diff nor the percentage denominator. | |
| output_diff_path | No | Optional path to save the diff image. If not provided, the diff image will be returned as base64. | |
| implementation_path | Yes | Path to the implementation screenshot (supports PNG, JPEG, WebP, GIF, TIFF, SVG) | |
| max_difference_percentage | No | If set and the difference percentage exceeds it, the call returns an error (isError: true). Use as a CI gate against a golden image. Omit for report-only. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It reveals the comparison algorithms, SVG rasterization behavior, and diff image option. However, it omits potential side effects (e.g., file system reads only), error conditions, or performance impact, leaving some behavioral aspects implicit.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, somewhat long sentence. It is clear and contains no redundancy, but could be more scannable with bullet points or shorter sentences. It is adequate but not optimally structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, the description reasonably covers return values (diff counts, SSIM, bounding box, heat grid, optional diff image) and key parameter behaviors. It adequately informs the user of what to expect, though some minor details (e.g., color handling) are absent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% (baseline 3), but the description adds valuable context beyond schema field descriptions, such as explaining how ignore_regions affects counts and that svg_density is aimed at small assets. It enhances understanding of parameter behavior.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool compares design and implementation screenshots using pixelmatch and SSIM, lists supported formats, and details return metrics. It uses a specific verb and resource, distinguishing the tool's purpose effectively.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains what the tool does but does not provide explicit guidance on when to use it versus alternatives or when not to use it. Since no sibling tools are given, this is acceptable but lacks proactive context for selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v0.7.0- First observed
compare_design
TDQS
Scored across 1 tool
Only one tool exists, so there is no risk of confusion. The tool has a clear, singular purpose.
With a single tool, naming is trivially consistent. The name 'compare_design' follows a clear verb_noun pattern.
One tool is borderline for typical server scopes. While it fits a narrow purpose, the server could potentially benefit from a few more tools (e.g., for configuration or batch comparison).
The tool covers the core comparison task well, supporting multiple formats and providing useful outputs. Minor gaps exist, such as no ability to adjust comparison thresholds or handle folders of images.
Maintenance
Related MCP Connectors
Capture screenshots, detect visual regressions between page versions, and analyze with AI.
Visual regression review: projects, builds, visual diffs, approvals, comments and analytics.
MCP server for visual regression testing: triage a PR's UI diffs from your coding agent.
Validate HTML/CSS, audit SEO and JSON-LD, check links, and capture responsive screenshots.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAnalyzes app screenshots to identify UI/UX issues, compare designs with implementations, and provide actionable fixes using GPT-4o/GPT-5.2 vision capabilities. Supports single/batch analysis, design comparison, and automated report generation for iOS, Android, web, and desktop platforms.MIT
- AlicenseNot gradedqualityDmaintenanceAnalyzes React component changes by performing structural analysis and generating visual diffs to identify pixel-level differences. It integrates with Figma to validate implementation compliance against design specifications and automates component reviews across git branches.MIT
- AlicenseAqualityDmaintenanceEnables pixel-perfect image comparison and visual regression testing via tools to compare local images, screenshots, and URLs with detailed diff statistics.339 npm4MIT
- FlicenseBqualityBmaintenanceEnables comparison of mobile app screenshots against design mockups, with Calorix as the first integration target.7-