mcpField
V
visualdiff

visualdiff

Local
github.com/CloudCorpRecordsDeveloper Tools0Updated 1w ago

About visualdiff

visualdiff is a CLI and MCP server for SnapDiff visual testing, aimed at teams checking web UI changes. It verifies changes against a stated intent, compares pages and baselines, and renders URLs or HTML as images.

Key features

  1. 01Verify UI changes against intent
  2. 02Compare pages and stored baselines
  3. 03Capture URL screenshots
  4. 04Render HTML and CSS to images

Use cases

  1. 01Review a staging UI change against its intent
  2. 02Compare a page with a reference or baseline
  3. 03Capture a full-page or selected-element screenshot
  4. 04Render HTML for social cards or email headers

MCP support

Its stdio MCP server exposes tools for verifying UI changes, comparing pages, capturing screenshots, and rendering HTML to images. Calls use the SnapDiff API and require SNAPDIFF_API_KEY.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"cloudcorprecords-visualdiff": {
"command": "npx",
"args": [
"-y",
"@reneturcios/visualdiff"
]
}
}
}
Run commandnpx -y @reneturcios/visualdiff

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@reneturcios/visualdiff0.1.0
ocighcr.io/cloudcorprecords/visualdiff:0.1.0

Tools

4

Saved tool list · updated 1w ago

ParameterTypeRequiredDescription
afterstringYesURL of the page after the change.
branchstringNoBranch name for the comparison.
intentstringYesDescription of the intended UI change.
projectstringYesSnapDiff project slug.
full_pagebooleanNoWhether to capture the full page instead of the viewport.
page_namestringYesName of the page with a stored baseline.
thresholdnumberNoVisual difference threshold.
intent_regionsarrayNoRegions where the intended change is expected.
ignore_selectorsarrayNoCSS selectors for elements to ignore in the comparison.
match_tolerance_percentnumberNoMatch tolerance as a percentage.

Details

From the project README

visualdiff

visualdiff wraps the SnapDiff visual-testing API: verify that a UI change matches what you meant to do, diff two pages (or a page against a stored baseline), capture a screenshot of any URL, and render raw HTML/CSS straight to an image. One binary serves a command-line interface and a stdio MCP server.

An API key is required. Set SNAPDIFF_API_KEY to a key from the SnapDiff dashboard; calls fail before any request is made when it is missing. The API base URL can be overridden with SNAPDIFF_API_URL; when it is not set, calls go to https://api.snapdiff.ai/v1.

Install

npx @reneturcios/visualdiff screenshot https://example.com

Or run the container image:

docker run -i -e SNAPDIFF_API_KEY=sk_live_... ghcr.io/cloudcorprecords/visualdiff

The container defaults to the MCP server (see below). Pass CLI arguments to use it as a CLI instead.

CLI

export SNAPDIFF_API_KEY=sk_live_...

visualdiff verify myproj pricing https://staging.example.com/pricing "added a yearly billing toggle"
visualdiff compare https://staging.example.com --before https://www.example.com
visualdiff compare http://localhost:3000 --project myproj --page-name homepage
visualdiff screenshot https://example.com --width 800 --full-page
visualdiff html-to-image "<h1>Hello</h1>" --css "h1 { color: navy; }" --width 1200 --height 630

visualdiff --version

Commands print the upstream JSON payload. Exit codes: 0 on success, 1 when a call fails (including a missing API key or an upstream API error), 2 for usage errors.

MCP server

One bin serves both faces. The mcp subcommand starts a stdio MCP server:

npx -y @reneturcios/visualdiff mcp

MCP client configuration:

{
  "mcpServers": {
    "visualdiff": {
      "command": "npx",
      "args": ["-y", "@reneturcios/visualdiff", "mcp"],
      "env": { "SNAPDIFF_API_KEY": "sk_live_..." }
    }
  }
}
Tools
ToolInputWhat it returns
snapdiff_verify_ui_changeproject, page_name, after, intent (all required); optional intent_regions, branch, threshold, match_tolerance_percent, ignore_selectors, full_pageA verdict (pass, expected_change_detected, unexpected_regression, no_change_detected, or needs_human_review), a next_action, and a review_url. Requires a project with a stored page baseline.
snapdiff_compare_pagesafter (required); plus before, or project + page_name for baseline mode; optional branch, threshold, ignore_selectors, full_pageA diff percentage plus a highlighted diff image.
snapdiff_capture_screenshoturl (required); optional full_page, dark_mode, selector, widthA screenshot of the page.
snapdiff_html_to_imagehtml (required); optional css, width, heightThe rendered image (OG cards, social images, email headers).

Each tool is sent as a POST to a per-tool endpoint under the base URL with the API key as a Bearer token. Optional arguments that are not supplied are omitted from the request body entirely.

Development

npm install
npm run build   # tsc -> dist/
npm test        # node test runner over test/*.test.ts, no network (fake fetch fixtures)
npm run dev     # run the CLI from source via tsx

License

MIT — see LICENSE.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.