# pixelpact [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/jamalkamaladdin/pixelpact  
**GitHub Stars:** 11  
**npm Downloads (last month):** 51  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/pixelpact

## Description
Extract a visual contract from a reference page and measure an implementation against it

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "pixelpact": {
    "command": "npx",
    "args": ["-y","pixelpact"]
  }
}
```

## Documentation

## What pixelpact does

The pixelpact MCP server turns a rendered reference page into a JSON contract, then measures another page against that contract. The contract records details such as element bounds, computed styles, colors, spacing, typography, design tokens, animation keyframes, and hover or focus states. This makes the reference the baseline from the beginning of a UI project rather than waiting for an approved screenshot.

Results identify the affected selector and property, along with the expected value, measured value, and difference. A check can therefore tell an agent whether a heading is too small, a button has the wrong padding, or a focus outline does not match. The output is intended to support repeated edit-and-check cycles and can also be reviewed as committed JSON in a pull request.

## How it works

The command-line workflow has two stages. First, extract a contract from a URL, optionally narrowing measurement to a selector, selecting named viewports, and saving screenshots. Next, pass the contract and the implementation URL to a check operation. The implementation is rendered and compared at the requested viewport dimensions.

Playwright drives the browser used for extraction and measurement. Because the tool reads the DOM and rendered styles, it is not tied to a particular frontend framework. It can also use a Figma frame as the reference according to the project documentation. A check exits with status 0 when all measurements are within tolerance and status 1 when deviations remain, allowing the command to run in scripts or CI jobs.

The pixelpact MCP server exposes four tools: `extract_contract`, `check_implementation`, `diff_pixels`, and `read_contract_summary`. MCP clients can call these tools so a coding agent can obtain measurements, inspect deviations, and repeat the process without a person manually opening the page.

## Setup and configuration

Install the package and Playwright as development dependencies, then install Chromium through Playwright:

```bash
pnpm add -D pixelpact playwright
pnpm exec playwright install chromium
```

Node.js 22.12 or newer is required. Playwright is a peer dependency, so browser installation remains under the project's control. The MCP configuration can launch the server through `npx`:

```json
{
  "mcpServers": {
    "pixelpact": { "command": "npx", "args": ["-y", "pixelpact-mcp"] }
  }
}
```

A typical extraction command supplies a reference URL, an optional root selector, viewport names, a screenshot directory, and an output path. A later check supplies the contract file, implementation URL, and viewport. Contracts are plain JSON with a version, source, viewport data, tokens, keyframes, and per-viewport element measurements.

## Tools and capabilities

The pixelpact MCP server supports these documented operations:

- Extract a contract from a rendered reference page.
- Check an implementation against a saved contract.
- Compare pixels through the `diff_pixels` tool.
- Read a compact summary of a contract.
- Measure desktop and mobile viewport configurations.
- Include hover, focus, animation, and design-token values in the reference data.
- Report missing elements and property-level deviations.
- Produce a file that can be committed, diffed, or passed to another agent.

## Limitations and notes

The server requires a browser environment through Playwright and Chromium, plus Node.js 22.12 or newer. It measures what the browser renders and does not depend on the application's framework, but the material does not describe support for non-browser assets or application-specific authentication flows.

This workflow is aimed at building toward a reference design, not replacing visual regression testing for an already-approved page. The documentation presents those as complementary approaches: pixelpact measures against the design itself, while regression tools compare later renders with an accepted snapshot.

_Full upstream README: https://allmcps.com/mcp/pixelpact/readme_

