npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@testivai/mcp

v0.6.0

Published

MCP server exposing TestivAI visual regression results to AI coding agents

Readme

@testivai/mcp

MCP (Model Context Protocol) server that gives AI coding agents eyes on your visual regression results. The agent changes UI code, runs your test suite, then uses these tools to find out what actually changed on screen — and whether it's real or just render noise.

Tools

| Tool | What it does | |---|---| | get_visual_results | Reads visual-report/results.json and returns a one-line verdict per snapshot: passed / likely render noise (the DOM and computed styles both match) / style-only change (identical DOM, different computed styles: a real change) / structural change (with the DOM summary). Snapshots that share an identical signal (style-only change on the same elements, the same page shift, the same kind of noise) are grouped first; it ends with the paths to open the HTML report and each diff image | | explain_snapshot | Layered evidence for one snapshot: pixel regions, element attribution (which selectors shifted vs changed, whole-page shift), the DOM/style signal, and interpretation guidance | | get_report | The raw results.json payload, for agents that parse structured data | | get_diff (alias get_snapshot_diff) | Returns the baseline, current, and diff images for one snapshot, downscaled to fit model context, so the agent can see the change | | list_baselines | Lists the committed baselines under .testivai/baselines/ | | approve_snapshot / approve_all | Promote reviewed captures to committed baselines (same as testivai approve), only after a human confirms |

The server also ships a prompt, review-visual-changes, that walks the agent through a full review: summary, explain_snapshot per change, diff images when the evidence is ambiguous, and a recommendation per snapshot.

Approval is a human decision

approve_snapshot and approve_all exist so a human who has looked at a diff can say "approve it" in the conversation and have the agent carry it out. They are not for the agent to decide on its own: approving rewrites what "correct" means, so an agent that approves its own change can launder a regression into the baseline. Both tool descriptions, the review-visual-changes prompt, and every get_visual_results response say so. After approving, commit .testivai/baselines/.

In Claude Code the client enforces this: both approve tools are marked anthropic/requiresUserInteraction, so Claude Code asks you on every approve call, even in auto-approving permission modes. To turn that off, start the server with --no-approval-prompt or set "mcpApprovalPrompt": false in .testivai/config.json (the flag wins); the approve tools then follow your client's own permission settings. Walkthrough: Review and approve in Claude Code.

The other approval paths stay available: npx testivai approve <name> locally, or a /testivai approve <name> comment on the pull request.

Setup

Claude Code

claude mcp add testivai -- npx -y @testivai/mcp

Cursor / other MCP clients

// .cursor/mcp.json (or your client's equivalent)
{
  "mcpServers": {
    "testivai": { "command": "npx", "args": ["-y", "@testivai/mcp"] }
  }
}

The server reads the project from its working directory (pass --root <path> to override) and respects reportDir from .testivai/config.json.

Typical agent flow

  1. Agent edits UI code.
  2. Agent runs npx playwright test (the TestivAI reporter captures + diffs).
  3. Agent calls get_visual_results and sees, for example, homepage: changed (4.20% pixels differ) and the DOM changed (2 added, 1 removed, 0 attribute changes) — a real structural change; confirm it is intended before approving.
  4. Agent calls explain_snapshot homepage for the evidence, and get_diff homepage to look at the images, then confirms the change matches the task (or fixes its own regression).
  5. Agent reports to the human: what changed, whether it looks intended, and which snapshots need approval. If the human says to approve, the agent calls approve_snapshot; otherwise the human approves with npx testivai approve or /testivai approve on the PR.

Local mode only — no account, no API key, nothing leaves the machine.

Full integration guide (instructions-file level, MCP level, zero-test-suite apps, real transcript): docs/guides/ai-agents.md