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

@explainui/mcp

v0.4.0

Published

ExplainUI MCP server — baseline-first UX analysis with phase-gated iteration control

Downloads

196

Readme

@explainui/mcp

ExplainUI MCP — baseline-first UX analysis with phase-gated iteration control and git checkpoint snapshots.

Captures screenshots, runs UX/accessibility analysis against your project constraints, and guides the agent through a strict fix loop with full git history at every step.

Every tool call requires both project_id and page_key.


Installation

npm install -g @explainui/mcp

Chromium is installed automatically via Playwright during postinstall.


Quick Setup

Claude Desktop

{
  "mcpServers": {
    "explainui": {
      "command": "explainui-mcp",
      "env": {
        "EXPLAINUI_LICENSE_KEY": "ek_live_your_key_here"
      }
    }
  }
}

Cursor

{
  "mcpServers": {
    "explainui": {
      "command": "explainui-mcp",
      "env": {
        "EXPLAINUI_LICENSE_KEY": "ek_live_your_key_here"
      }
    }
  }
}

GitHub Copilot (VS Code)

{
  "mcp": {
    "servers": {
      "explainui": {
        "command": "explainui-mcp",
        "env": {
          "EXPLAINUI_LICENSE_KEY": "ek_live_your_key_here"
        }
      }
    }
  }
}

Windsurf

{
  "mcpServers": {
    "explainui": {
      "command": "explainui-mcp",
      "env": {
        "EXPLAINUI_LICENSE_KEY": "ek_live_your_key_here"
      }
    }
  }
}

Environment Variables

| Variable | Required | Default | Description | |---|---|---|---| | EXPLAINUI_LICENSE_KEY | Yes | — | License key from explainui.com/settings | | EXPLAINUI_API_HOST | No | https://api.explainui.com | Override API host (self-hosted / staging) |


Tools (7)

| Tool | Purpose | |---|---| | explainui_status | Entry point — attach project/page, fetch current run state and strict next commands | | explainui_new_run | Create a run and automatically run baseline analysis | | explainui_baseline_analysis | Manual baseline retry/refresh (only if auto baseline failed) | | explainui_start_iteration | Begin fix loop — initialises git branch + cp-0, delivers baseline issues | | explainui_submit_iteration | Submit fixes and analyse — captures screenshots, snapshots cp-N | | explainui_finish_run | Merge or abandon the run | | explainui_close_project | End session and release browser resources |


Workflow

1. explainui_status({ project_id, page_key })
      ↓ loads project config, reports run state and next commands
2. explainui_new_run({ project_id, page_key })
      ↓ creates run, auto-runs baseline analysis, phase → baseline_ready
3. explainui_start_iteration({ project_id, page_key })
      ↓ initialises git branch + cp-0 snapshot, returns baseline issues to fix
4. [agent applies fixes in editor]
5. explainui_submit_iteration({ project_id, page_key, changes_made })
      ↓ analyses page, creates cp-N snapshot after success
      ↓ next_action="fix"  → repeat from step 3
      ↓ next_action="done" → go to step 6
6. explainui_finish_run({ project_id, page_key, action: "merge" | "abandon" })
      ↓ merge: creates cp-N if needed, merges run branch → source branch
      ↓ abandon: deletes run branch and all checkpoint tags
7. explainui_close_project({ project_id, page_key, reason })

Git Checkpoint System

When git snapshots are enabled for a page, the MCP maintains a full checkpoint history on a dedicated run branch. No changes are ever made to your source branch until finish_run is called.

Branch Structure

main (source branch)
  │
  ├─── cp-0  ← original code at run start
  │
  └─── explainui/run-N  (run branch, branched from main at new_run)
         │
         ├─── cp-1  ← code after iteration 1 fixes
         ├─── cp-2  ← code after iteration 2 fixes
         ├─── cp-3  ← code after iteration 3 fixes
         │
         └─── merged into main at finish_run

Checkpoint Lifecycle

| Checkpoint | When created | What it contains | |---|---|---| | cp-0 | At start_iteration (first call) | Original code before any fixes | | cp-N | After submit_iteration succeeds for iteration N | Agent's fixes for iteration N, as analysed | | cp-N (final) | At finish_run if cp-N doesn't exist yet | Created automatically before merge |

Tag format: explainui/run-{run_number}/cp-{N}

Example: explainui/run-5/cp-2

finish_run Merge Behaviour

# Merge latest checkpoint (default — normal happy path)
explainui_finish_run({ project_id, page_key, action: "merge" })

# Merge a specific earlier checkpoint
# Use when: iteration 3 made things worse, iteration 2 was better
explainui_finish_run({ project_id, page_key, action: "merge", checkpoint: 2 })

# Abandon — discard all changes, delete run branch
explainui_finish_run({ project_id, page_key, action: "abandon" })

When checkpoint: N is passed:

  • If N is the latest iteration: creates cp-N snapshot if it doesn't exist yet, then merges
  • If N is an earlier iteration: resets the run branch to cp-N's git tag, then merges that state into source branch

After a Merge

The run branch (explainui/run-N) and all checkpoint tags (explainui/run-N/cp-*) are deleted automatically. The merged state is committed to your source branch.

To restore a specific checkpoint manually after a run is complete:

git merge explainui/run-5/cp-2

This command is shown in the ExplainUI dashboard timeline for each checkpoint.


Error Handling

ANALYSIS_PARSE_FAILED

The analysis pipeline occasionally fails to parse results. When this happens:

  • The MCP rolls back the iteration counter so the retry uses the same iteration number
  • The agent should retry explainui_submit_iteration once with the same arguments
  • If it fails again, set next_action to review_human

Baseline capture failed

If automatic baseline from explainui_new_run fails (page unavailable, timeout):

explainui_baseline_analysis({ project_id, page_key })

This retries the baseline without creating a new run.


Troubleshooting

| Error | Fix | |---|---| | "No page attached" | Call explainui_status first | | "Baseline review required" | Call explainui_start_iteration after baseline completes | | "No active run" | Call explainui_new_run to start a fresh run | | "Cannot merge: source branch unknown" | Run explainui_start_iteration first (it records the source branch) | | "Checkpoint cp-N not found" | Tag doesn't exist locally — only checkpoints from the current session are available |


Development

cd packages/explainui_mcp
npm install
npm run build
npm test
npm run dev   # tsx watch mode

License

MIT