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
| Name | What it is | Required |
|---|---|---|
CRUX_API_KEY | Chrome UX Report API key for the field data of get_crux; the other tools work without it | No |
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
Skills that pair well
MCP or skill?
The MCP gives the agent the hands. The skill teaches the right way to use them. Together, the result is better and uses fewer tokens.
performance-analysisHelps your agent measure how fast your code runs, find the slow parts, and check speed before and after a change.core-web-vitalsGuides your agent to improve Core Web Vitals for loading, interactivity and layout stability, which affect your Google Search ranking.check-posthog-loadingHelps your agent check whether the PostHog tracking snippet loads on each page of your site, and flags missing or mismatched setups.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.