WebPerf Snippets
Run 56 web performance snippets in headless Chromium and read Core Web Vitals results
- Pricing
- Open source
- Platforms
- CLI, Web
- Runs
- Locally
- Version
- 1.17.0
- Listing updated
- 3 days ago
About WebPerf Snippets
WebPerf Snippets is an open-source MCP server for browser automation. It runs locally on your machine and is started by your AI client.
WebPerf Snippets began as a collection of JavaScript snippets you paste into DevTools; this package runs the same code through Playwright so an agent or a CI job gets the same result each time. The collection spans Core Web Vitals (LCP with subparts, CLS, INP), loading checks (TTFB, render-blocking resources, preloads, fonts, bfcache), interaction diagnostics (long animation frames, long tasks, input latency) and media audits.
The README positions it beside Lighthouse: Lighthouse gives a score, the snippets give the diagnosis, such as the LCP sub-part that is slow or which script blocked a frame. A default workflow runs LCP and CLS and adds sub-parts when LCP passes 2.5 seconds; other workflows run an 11-step loading audit and a 22-check structural audit. Output can be JSON or Markdown for pull-request comments.
Install the npm package with Playwright and Chromium. Field data through get_crux needs an optional Chrome UX Report API key; the other tools do not.
Install
Run in a terminal
claude mcp add webperf-snippets --env CRUX_API_KEY='<CRUX_API_KEY>' -- npx -y webperf-snippetsAdd to claude_desktop_config.json
{
"mcpServers": {
"webperf-snippets": {
"command": "npx",
"args": [
"-y",
"webperf-snippets"
],
"env": {
"CRUX_API_KEY": "<CRUX_API_KEY>"
}
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"webperf-snippets": {
"command": "npx",
"args": [
"-y",
"webperf-snippets"
],
"env": {
"CRUX_API_KEY": "<CRUX_API_KEY>"
}
}
}
}Add to .vscode/mcp.json
{
"servers": {
"webperf-snippets": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"webperf-snippets"
],
"env": {
"CRUX_API_KEY": "<CRUX_API_KEY>"
}
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"webperf-snippets": {
"command": "npx",
"args": [
"-y",
"webperf-snippets"
],
"env": {
"CRUX_API_KEY": "<CRUX_API_KEY>"
}
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"webperf-snippets": {
"command": "npx",
"args": [
"-y",
"webperf-snippets"
],
"env": {
"CRUX_API_KEY": "<CRUX_API_KEY>"
}
}
}
}Configuration
CRUX_API_KEYChrome UX Report API key for the field data of get_crux; the other tools work without it
Tools this server provides (1)
Taken from the project documentation; the running server may differ.
- get_crux
- Chrome UX Report field data; needs a CRUX_API_KEY.
What it does
- 56 snippets
- Curated Core Web Vitals, loading, interaction and media diagnostics.
- Workflows
- Default, loading and audit runs for common cases.
- CI-friendly output
- JSON and Markdown results for budgets and PR comments.
- Third-party analysis
- Separate first- and third-party scripts, with own-domain overrides.
- Field data option
- Pull Chrome UX Report data with an API key.
- Same code as DevTools
- Run the identical snippets manually in the console.
Good for
- Diagnose an LCP regression after a deploy
- Gate pull requests on performance budgets
- Find render-blocking resources and lazy-loading mistakes
- Attribute long animation frames to scripts
- Compare lab results with CrUX field data
Pricing
Open source
Free open-source package; optional CrUX API key
Prices change. Check webperf-snippets.net before you buy.
WebPerf Snippets FAQ
What do I need installed?
The npm package, Playwright and a Chromium build.
Is an API key required?
Only for get_crux field data; the other tools work without it.
How does it differ from Lighthouse?
It reports the diagnosis behind a score, per the README.
Can I run it without an agent?
Yes, the same snippets work in DevTools or from the CLI.
Is WebPerf Snippets free?
Yes. WebPerf Snippets is open source, so you can use and self-host it for free.
How do I add WebPerf Snippets to Claude Code?
Run this command in your terminal: claude mcp add webperf-snippets --env CRUX_API_KEY='<CRUX_API_KEY>' -- npx -y webperf-snippets
What are the best alternatives to WebPerf Snippets?
The closest alternatives to WebPerf Snippets are REA, Browser Use, Scrapling MCP Server, Codebase Memory and GitHub.
Alternatives to WebPerf Snippets

REA
MCP serverCLI and MCP server that lets coding agents reverse engineer apps and binaries
Runs locally- Open source
- 464K GitHub stars
- Developer tools

Browser Use
MCP serverBrowser agents and cloud browsers for AI, with an MCP server for web tasks
- 7 tools
- Remote
- Freemium
- 121K GitHub stars
- Browser automation

Scrapling MCP Server
MCP serverMCP server for AI clients to scrape sites with HTTP and stealth browser sessions
Runs locally- 17 tools
- Open source
- 104K GitHub stars
- Web search and scraping

Codebase Memory
MCP serverLocal MCP server that builds a code knowledge graph for AI coding agents
Runs locally- Open source
- 48.7K GitHub stars
- Knowledge and memory

GitHub
MCP serverOfficial MCP server connecting AI assistants to GitHub repos, issues and workflows
Not checked yet- Remote
- Open source
- 34.5K GitHub stars
- Developer tools

Serena MCP: the IDE for your agent
MCP serverMCP toolkit giving coding agents symbol-level code retrieval and editing
Runs locally- Open source
- 31.5K GitHub stars
- Developer tools