Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Compare design and implementation screenshots using pixel-by-pixel analysis, generating visual diff images and metrics.

README.md

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_fit controls how (contain preserves aspect ratio by default; fill/cover available); toggle off with auto_resize
  • Ignore 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 step
  • Diff 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_percentage flips the result to an error when exceeded — a CI regression gate without parsing text
  • 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, 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 base64
  • threshold (number, optional): Matching threshold (0-1). Smaller values make the comparison more sensitive. Default is 0.1
  • auto_resize (boolean, optional): When the two screenshots differ in resolution, scale the implementation to the design's dimensions instead of erroring. Default is true. Set false to 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), or cover (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): If true (default), include a diff bounding box and a coarse 3x3 heat grid in the result, showing where differences cluster. Set false to 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 localize is 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

  1. Loads both images into memory (any supported format → raw RGBA)
  2. If dimensions differ, scales the implementation to the design's dimensions using resize_fit (default contain, aspect-preserving; unless auto_resize is false, which errors instead)
  3. Masks out any ignore_regions in both images so excluded pixels don't count
  4. Uses pixelmatch to compare pixel-by-pixel, computes an SSIM score, and (when localize is on) locates where differences cluster (bounding box + 3x3 heat grid)
  5. Generates a diff image highlighting differences in pink
  6. 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, TIFF, or SVG); differing resolutions are auto-resized unless auto_resize is disabled

License

MIT

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Observability servers.