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

@frontguard/mcp

v0.2.2

Published

Model Context Protocol server for Frontguard — lets in-IDE agents (Claude Code, Cursor, Copilot) query visual regressions and suggested fixes.

Downloads

437

Readme

@frontguard/mcp

Model Context Protocol server for Frontguard. Lets in-IDE agents — Claude Code, Cursor, GitHub Copilot, and anything else that speaks MCP — answer questions like "what regressed on PR 42?" or "give me the suggested fix for diff D5" without leaving the editor.

npm

Why

Frontguard already runs your visual-regression checks on every PR. The expensive part of that loop isn't the screenshots — it's the agent context-switch between "agent sees PR" and "agent reads the report and reasons about the fix." This MCP server collapses that loop: the agent calls list_regressions(pr_id) and gets structured JSON; it calls get_suggested_fix(diff_id) and gets the AI-generated patch, ready to apply.

Install

npm install -g @frontguard/mcp
# or run on-demand
npx -y @frontguard/mcp

The server speaks JSON-RPC over stdio — your MCP client (the editor) launches it as a subprocess.

Configure your editor

Claude Code

Add an entry to ~/.claude/mcp.json (or your project-scoped .mcp.json):

{
  "mcpServers": {
    "frontguard": {
      "command": "npx",
      "args": ["-y", "@frontguard/mcp"],
      "env": {
        "FRONTGUARD_API_KEY": "fg_live_xxx",
        "FRONTGUARD_API_URL": "https://your-cloud-api.example.com"
      }
    }
  }
}

Cursor

~/.cursor/mcp.json:

{
  "mcpServers": {
    "frontguard": {
      "command": "npx",
      "args": ["-y", "@frontguard/mcp"],
      "env": {
        "FRONTGUARD_API_KEY": "fg_live_xxx",
        "FRONTGUARD_API_URL": "https://your-cloud-api.example.com"
      }
    }
  }
}

GitHub Copilot (VS Code)

.vscode/mcp.json:

{
  "servers": {
    "frontguard": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@frontguard/mcp"],
      "env": {
        "FRONTGUARD_API_KEY": "${env:FRONTGUARD_API_KEY}",
        "FRONTGUARD_API_URL": "${env:FRONTGUARD_API_URL}"
      }
    }
  }
}

Tools

| Tool | Input | Returns | |------|-------|---------| | list_regressions | pr_id (number or run id), optional repo | regressions on the PR with stable diffIds | | get_suggested_fix | diff_id from list_regressions | AI-generated patch (fixType, patch, confidence, explanation) | | accept_baseline | run_id, confirm_all_regressions_reviewed: true | promotes the entire run to the new baseline (run-scoped, not per-diff) | | recent_runs | optional repo, branch, limit | newest-first run summary list |

Every tool returns JSON in the MCP text content channel; agents parse it directly.

Example agent prompts

  • "What regressed on PR 42 in acme/shop?" → calls list_regressions({ pr_id: 42, repo: 'acme/shop' }).
  • "Show me the suggested fix for the first one."get_suggested_fix({ diff_id }).
  • "OK, apply that and accept the baseline." → agent writes the patch to your CSS, reviews every regression from list_regressions, then calls accept_baseline({ run_id, confirm_all_regressions_reviewed: true }).

Local-only mode

Point the server at a local wrangler dev instance of @frontguard/cloud-api:

export FRONTGUARD_API_URL=http://localhost:8787
export FRONTGUARD_API_KEY=fg_dev_localkey
npx -y @frontguard/mcp

The cloud client strips trailing slashes and validates that FRONTGUARD_API_KEY is non-empty on every tool call.

Authentication

| Variable | Required | |----------|----------| | FRONTGUARD_API_KEY | yes — per-tool-call | | FRONTGUARD_API_URL | yes — your self-hosted cloud-api base URL (e.g. http://localhost:8787 for local dev) |

There is no hosted default. The server starts on stdio even when credentials are missing (so tools/list works); missing-key or missing-URL errors surface when a tool is actually called.

On launch the binary writes frontguard-mcp v<version> starting on stdio to stderr. If your editor shows no tools and no stderr line, check that npx can resolve the bin (symlink/realpath issues) and file an issue with which npx and your cwd.

Local JSON-RPC smoke test (after npm run build)

mkdir -p /tmp/mcp-test
cat > /tmp/mcp-test/init.jsonl <<'EOF'
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"local-test","version":"0"}}}
{"jsonrpc":"2.0","method":"notifications/initialized"}
{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}
EOF
cd /tmp/mcp-test && cat init.jsonl | node /path/to/frontguard/packages/mcp/dist/index.js

Stdout should contain JSON-RPC result frames (including four tools). Stderr should show frontguard-mcp v… starting on stdio. Published npx -y @frontguard/[email protected] is the known before-state (empty stdout); verify against your local dist/index.js build instead.

License

MIT © Ravindra Kumar