Skip to content
Skillpedia
● Free and open source💻 Local🔓 No API keyProgramming

WebPerf Snippets

Lets your AI agent measure Core Web Vitals and debug web performance by running tested snippets in a headless Chromium.

1.5k stars on GitHubby nucliweb (Joan León)License MITUpdated 18 days ago

How to install

This MCP is local: it runs on your computer.

It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Code…). Choose your app:

Paste in the terminal:

claude mcp add webperf-snippets -- npx -y webperf-snippets mcp

What to fill in

NameWhat it isRequired
CRUX_API_KEYChrome UX Report API key for the field data of get_crux; the other tools work without itNo

Ready! Now test it

Restart the app and paste one of these requests in the chat:

Audit https://example.com for Core Web Vitals.
Why is my TTFB so high on this page?

What it is

WebPerf Snippets is a set of tested JavaScript snippets that measure web performance. The MCP server lets your agent run them against a URL on a headless Chromium and read the structured result. The measurement is fixed code, so the agent only interprets the data.

What it can do

  • Core Web Vitals snippets: LCP, CLS and INP with breakdowns
  • Loading snippets: TTFB, FCP, scripts, fonts and caching
  • Interaction snippets: long animation frames, long tasks and scroll jank
  • Media snippets: image and video audits
  • Workflows: core-web-vitals, audit, loading and interaction
  • Performance budgets for CI, such as --budget-lcp

When to use

  • ›When you want to find out why a page's LCP is slow.
  • ›When your TTFB is high and you want to know where the time goes.
  • ›When you want performance checks that fail a pull request.

What you need

Node.js (the server runs with npx webperf-snippets mcp). It uses Playwright with a headless Chromium. A CrUX key is optional.

Skills that pair well

⭐ Skillpedia MCP · freeYour agent finds the right skill on its ownInstall our MCP and your agent searches 15,000+ skills whenever it needs one.Install for free →

Frequently asked questions

Is it free and open source?

The readme shows a license badge and describes it as open source. It is published on npm as webperf-snippets.

Do I need an API key?

No for the basic snippets. A CrUX key is optional and is described in the MCP documentation.

Which MCP clients work?

Claude Code, Cursor, VS Code, Gemini CLI and other MCP clients.

Can I run it without an agent?

Yes. Paste snippets into the DevTools console, or use the CLI with npx webperf-snippets.

Can it drive my own Chrome?

Yes, with the Agent Skills and Chrome DevTools MCP, the agent runs the snippets in your browser, including logged-in pages.

How many snippets are there?

The registry lists 56 and the readme table shows 57 for the main skill.

If it does not work

  • ›Check that Node.js is installed so npx can run.
  • ›If the skills show Access denied for files outside the project, add --workspace to the chrome-devtools-mcp arguments.
  • ›Install with claude mcp add webperf -- npx -y webperf-snippets mcp.

5 new skills a week. 1 minute to read.