# TestivAI [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/testivai/testivai-oss  
**GitHub Stars:** 8  
**npm Downloads (last month):** 0  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/testivai

## Description
Local-first visual regression for AI agents: verdicts, diff images, explain_snapshot. No API key.

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

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

## Documentation

## What TestivAI does

TestivAI provides local-first visual regression testing for web applications and exposes the resulting evidence to AI coding agents through MCP. Its workflow compares captured screenshots with baselines while also examining the page DOM and, where supported by the adapter, element-level computed styles.

The resulting report combines pixel differences with structural and style signals. It can identify added or removed DOM elements, style-only changes, shifted selectors, changed regions, and broad page movement. Dynamic content can be excluded with selector- or coordinate-based masks, which remain visible as hatched areas in the diff.

The project is designed for agent-assisted UI work. An agent can read `visual-report/results.json`, inspect diff images, and use the `explain_snapshot` tool to receive layered evidence before describing or evaluating a change.

## How it works

TestivAI captures a screenshot alongside a DOM snapshot by default for its adapters and crawler. Several adapters also record an element map and computed-style digest. The comparison engine uses these artifacts to qualify pixel differences rather than treating every changed pixel as a regression.

A small, scattered pixel difference may receive a likely-render-noise hint when the DOM and compared styles are identical. A concentrated or larger difference is surfaced separately, because the style check does not cover every cause of visual change, including size, overflow, transforms, or images. Identical DOM with changed computed styles is reported as a real style change. Structural differences include a summary such as the number of added and removed elements.

The `explain_snapshot` MCP tool passes this evidence to the agent’s model; the model writes the natural-language explanation. No hosted AI service is required for that step. Reports include per-snapshot diff percentages and DOM summaries in a machine-readable JSON schema, alongside self-contained HTML output and diff imagery.

## Setup and configuration

TestivAI is intended to run entirely on the local machine or in CI. It needs no account, API key, or hosted service. Baselines are stored in the repository, and the generated report remains local unless a project separately publishes it through the available GitHub workflow.

Use the TestivAI adapters with Playwright or WebdriverIO to capture application pages through those frameworks’ native APIs. Playwright support covers JavaScript/TypeScript and Python, with Java identified as experimental. Playwright device emulation uses the same capture call and keeps baselines keyed by device profile.

For agent workflows, place the project’s visual-verification instructions in `AGENTS.md` or `CLAUDE.md`. The documented workflow has the agent run the UI tests, read `visual-report/results.json`, inspect suspicious diff images, and ask for approval when a change appears intentional. Claude Code also has a `testivai-report` plugin that displays the report and screenshots in the application.

## Tools and capabilities

- `explain_snapshot`: provide an agent with selector shifts, changed elements, style-only evidence, and whole-page shift analysis for a snapshot.
- Visual verdicts that distinguish likely rendering noise, concentrated or large differences, style-only changes, structural changes, unavailable style comparisons, and unhealthy captures.
- Region-level diffs with bounding boxes and element attribution, including exact positional shifts where the layout evidence supports them.
- Selector- and coordinate-based masks for dynamic regions.
- Shared baselines and reports across supported language adapters.
- GitHub Actions for posting diffs and handling `/testivai approve` baseline approvals in pull requests; a companion workflow can publish reports to GitHub Pages.

## Limitations and notes

Computed-style comparison depends on the capture adapter and available element map. Playwright JavaScript/TypeScript, WebdriverIO, Selenium, and Ruby adapters record an element map; the crawler, Playwright Python, and Playwright Java do not provide the same style-comparison coverage described for those adapters. When styles cannot be compared, the report avoids calling a difference render noise.

The style check covers a fixed property list. It does not establish that unchanged styles rule out changes involving dimensions, overflow, transforms, or images. A failed web-font or stylesheet load produces an unhealthy capture, which should not become a baseline.

The experimental `testivai run` sidecar does not capture a DOM snapshot by default. Baseline approval remains a human action through the pull request workflow, even when an agent performs the local investigation.

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

