Skip to main content
Glama

VRT MCP

Visual Regression Testing MCP Server - Compare page screenshots against design references using AI.

Features

  • Figma Integration - Fetch designs directly from Figma API

  • Local File Support - Use local PNG files as design references

  • Smart Viewport Matching - Auto-match viewport to design dimensions

  • Side-by-side Comparison - Generate combined design/screenshot/diff images

  • Pre-actions - Click, scroll, type, wait before capturing

  • Retry Logic - Configurable retry with different wait strategies

  • Element Cropping - Screenshot specific elements

  • Session Caching - Reuse designs across iterations

  • Diagnostic Analysis - Smart suggestions for high diff percentages

Related MCP server: visual-regression-mcp

Installation

# Clone the repository
git clone https://github.com/yourusername/vrt-mcp.git
cd vrt-mcp

# Install dependencies and setup
npm install
npm run setup

The setup script will automatically check and install:

  • odiff - Image comparison tool

  • Playwright Chromium browser

Configuration

Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "vrt": {
      "command": "node",
      "args": ["/path/to/vrt-mcp/dist/index.js"],
      "env": {
        "FIGMA_TOKEN": "your-figma-token"
      }
    }
  }
}

Environment Variables

Variable

Required

Description

FIGMA_TOKEN

For Figma source

Get from Figma Settings → Personal Access Tokens

Usage

Basic Comparison (Local File)

{
  "page_url": "http://localhost:3000",
  "design_source": {
    "type": "file",
    "path": "/path/to/design.png"
  }
}

Figma Source

{
  "page_url": "http://localhost:3000",
  "design_source": {
    "type": "figma",
    "file_key": "abc123",
    "node_id": "1:234",
    "scale": 2
  }
}

With Pre-actions

{
  "page_url": "http://localhost:3000",
  "design_source": { "type": "file", "path": "/path/to/design.png" },
  "pre_actions": [
    { "type": "wait", "value": 1000 },
    { "type": "click", "selector": ".menu-button" },
    { "type": "wait", "value": ".dropdown-menu" }
  ]
}

Element Screenshot

{
  "page_url": "http://localhost:3000",
  "design_source": { "type": "file", "path": "/path/to/header.png" },
  "crop_to_element": "header.main-header"
}

Tools

vrt_compare

Main comparison tool.

Parameter

Type

Default

Description

page_url

string

required

URL to capture

design_source

object

required

Figma or file source

viewport

object

auto

{ width, height }

auto_match_viewport

boolean

true

Match design dimensions

threshold

number

1

Diff threshold (%)

session_id

string

auto

Session for caching

skip_design_fetch

boolean

false

Use cached design

wait_for_selector

string

-

CSS selector to wait for

wait_until

string

networkidle

load/domcontentloaded/networkidle/commit

retry_count

number

1

Retry attempts (1-3)

retry_delay

number

1000

Delay between retries (ms)

crop_to_element

string

-

CSS selector to crop to

pre_actions

array

-

Actions before capture

generate_side_by_side

boolean

false

Force side-by-side image

antialiasing

boolean

false

Enable antialiasing tolerance

vrt_session_info

Manage sessions and cache.

Parameter

Type

Description

action

string

list/get/clear/clear_all

session_id

string

Required for get/clear

Response

{
  "success": true,
  "session_id": "abc12345",
  "match": false,
  "diff_percentage": 5.23,
  "threshold": 1,
  "passed": false,
  "viewport": {
    "width": 1280,
    "height": 720,
    "source": "auto-matched from design"
  },
  "files": {
    "design": "/tmp/vrt-abc12345/design.png",
    "screenshot": "/tmp/vrt-abc12345/screenshot.png",
    "diff": "/tmp/vrt-abc12345/diff.png",
    "side_by_side": "/tmp/vrt-abc12345/side-by-side.png"
  },
  "cache_info": {
    "design_cached": true,
    "cache_path": "/tmp/vrt-abc12345",
    "created_at": "2025-01-22T10:00:00.000Z"
  },
  "analysis": {
    "likely_causes": ["Minor visual differences - could be font rendering or anti-aliasing"],
    "severity": "minor"
  }
}

Development

npm run build    # Build TypeScript
npm run dev      # Watch mode
npm run setup    # Check/install dependencies

License

MIT

Available Tools

2 tools
vrt_compareA

Visual regression test: compare a page screenshot against a design reference. Captures screenshot of URL, compares with Figma design or local image using odiff. Returns diff percentage, path to diff image, and analysis for AI feedback loop.

Workflow:

  1. Provide design source (Figma or local file path)

  2. Tool captures page screenshot (with optional pre-actions)

  3. Compares using odiff

  4. Returns diff result with percentage, diff image, and diagnostic analysis

Features:

  • Retry with configurable wait strategy

  • Pre-actions (click, scroll, type, wait) before capture

  • Crop to specific element

  • Side-by-side comparison image

  • Smart analysis for high diff percentages

Use session_id to reuse cached design across iterations.

Inputs: page_url (required), design_source (required), viewport, threshold, +11 more.

vrt_session_infoB

Query or manage VRT sessions and cache. Use to inspect cached designs, list active sessions, or clean up old sessions.

Inputs: action (required), session_id.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools have clearly separate purposes: vrt_compare performs the actual screenshot capture and diff, while vrt_session_info handles inspection and cleanup of session/cache state. There is no realistic way an agent would confuse them, and vrt_compare's description explicitly points to session_id usage, linking the two cleanly.

    Naming Consistency5/5

    Both tools use a consistent vrt_ prefix with snake_case noun/verb naming (vrt_compare, vrt_session_info). A fully predictable pattern for a two-tool server.

    Tool Count3/5

    Two tools is on the thin side even for a narrowly scoped visual regression server. The core work is done by a single tool, with the second only supporting session housekeeping, making the surface feel minimal.

    Completeness3/5

    The compare-plus-session-management pair covers the primary iterate-on-diff workflow, including cached design reuse. However, there is no tool for approving/updating baselines, batch or multi-URL comparison, or standalone session creation/deletion beyond the vague 'manage' in vrt_session_info, leaving notable gaps.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables agents to compare a live web page against a Figma frame and receive a bounded JSON verdict of design deviations, without sending screenshots or mockups through the model context.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI coding agents to see, measure, and verify web pages through a real Chrome browser, including screenshots, responsive layout and accessibility audits, pixel diffing against baselines, secure logins, and deployed-fix verification.
      27
      1
      MIT