pagespeed-insights-mcp MCP Server
Google PageSpeed Insights and CrUX: six workflow tools for web performance.
pagespeed-insights-mcp scores 76 (Good), licensed Apache-2.0 and written in TypeScript. It installs as a local process. It declares 6 tools. Filed under Knowledge. GitHub shows 85 stars. Package registries report about 2,165 downloads a week. Install configs are generated for 12 clients. Being listed in the registry is not the same as being vendor-official.
Good trust
76 of 100 from six public signals. Nobody can buy a point.
- Listed in the official MCP registry.
- OSI-style license: apache-2.0.
License, quality and maintenance
Where the 76 comes from
22 + 20 + 10 + 10 + 4 + 10 = 76. Each factor is capped, so no single signal can carry a listing.
Active in the official MCP registry, plus a known vendor namespace.
Registry: 22 of 30 points.How recently the repository saw a commit or release.
Maintenance: 20 of 20 points.GitHub stars and weekly downloads, on a log scale.
Popularity: 10 of 20 points.A clear, OSI-style open-source license.
License: 10 of 10 points.Not archived, a secure install path, a pinned version.
Security: 4 of 10 points.A real summary, a README with depth, listed tools.
Docs: 10 of 10 points.Install
Pick your client, copy the config, paste it in.
Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.
{ "mcpServers": { "ruslanlap-pagespeed-insights-mcp": { "command": "npx", "args": [ "-y", "pagespeed-insights-mcp@2.5.0" ], "env": { "GOOGLE_API_KEY": "YOUR_GOOGLE_API_KEY" } } }}
Environment variables
| Name | Required | Notes |
|---|---|---|
GOOGLE_API_KEYSecret | Optional | Optional Google API key for higher PSI quotas and Chrome UX Report field data |
Tools6Tool docs quality grade C
All capabilitiesParallel triage of 1β10 URLs bounded by MAXCONCURRENCY with MCP progress notifications.
Lighthouse health check (summary), full report, 48-audit recommendations (with optional workspaceDir & budget), audit, or Mermaid performance-map.
Clear the in-memory response cache after a deploy.
Side-by-side comparison (mode: "pages") or multi-run regression check against a stored baseline (mode: "baseline").
Deep-dive through one lens: visual (native images + bounding boxes), elements (LCP phases & CLS), network, javascript, images, render-blocking, or third-parties. Reuses cached analysis automatically.
CrUX real-user Core Web Vitals (scope: "page" \
About
PageSpeed Insights MCP Server
Web performance engineering MCP server for Google PageSpeed Insights, Chrome UX Report (CrUX), and local Lighthouse. Audit public pages or localhost, inspect screenshots natively, track historical CrUX trends, enforce performance budgets in CI, and get code-level fixes directly inside Claude, Cursor, Codex, or Antigravity.
β‘ Quick Start (Zero-Config)
Paste into your MCP client config (claude_desktop_config.json, Cursor, or Antigravity) and restart:
{
"mcpServers": {
"pagespeed-insights": {
"command": "npx",
"args": ["-y", "pagespeed-insights-mcp"],
"env": {
"GOOGLE_API_KEY": "your-google-api-key"
}
}
}
}
Codex / OpenAI / Grok (config.toml):
[mcp_servers.pagespeed-insights]
command = "npx"
args = ["-y", "pagespeed-insights-mcp"]
env = { GOOGLE_API_KEY = "your-google-api-key" }
Docker:
docker build -t pagespeed-insights-mcp .
docker run -i -e GOOGLE_API_KEY=your-key pagespeed-insights-mcp
No API key yet? You can omit env completely to start immediately:
- Public URLs work up to Google's anonymous PSI quota.
localhost/ private URLs run via local Chrome + Lighthouse CLI without any API key.- Get a free key at Google Cloud Console (enable PageSpeed Insights API & Chrome UX Report API) for 25,000 req/day and CrUX field data.
π₯ Why This Server
- Hybrid Cloud + Local Engine: Public URLs run on Google PSI;
localhost,127.0.0.1, private IPs, and.localdomains automatically run via local Chrome + Lighthouse CLI (withextraHeadersfor auth-protected staging). - Evidence-Backed AI Remediation: Covers 48 Lighthouse 12/13 audits with concrete offending URLs/DOM selectors, framework
stackPacksguidance (Next.js, React, etc.), and optionalworkspaceDirmapping tofile:linein your repo. - Multimodal Visual Debugging:
focus="visual"returns native MCPimagescreenshots & filmstrip keyframes plus LCP/CLS bounding-box coordinates so multimodal models see layout shifts directly. - Real-User CrUX + Historical Trends: 28-day p75 Core Web Vitals,
Good / Needs Improvement / Poorhistograms, and multi-week CrUX History trends (includeHistory: true) to pinpoint when regressions started. - Statistically Honest Regression Tracking: Multi-run median + spread (
runs: 3β5),fetchTimereplay deduplication, disjoint-rangeguaranteedDeltaverdicts, and git-committable.pagespeed/baselines.json. - Same Engine in IDE & CI/CD: Built-in
.pagespeed.jsonperformance budgets,checkCLI gate for GitHub Actions, and stateless Streamable HTTP transport (--http) for shared team deployments.
π οΈ Tools (v2)
Every data tool accepts responseFormat (markdown default, or json) and returns MCP structuredContent.
| Tool | Purpose |
|---|---|
pagespeed_analyze_page | Lighthouse health check (summary), full report, 48-audit recommendations (with optional workspaceDir & budget), audit, or Mermaid performance-map. |
pagespeed_diagnose_page | Deep-dive through one lens: visual (native images + bounding boxes), elements (LCP phases & CLS), network, javascript, images, render-blocking, or third-parties. Reuses cached analysis automatically. |
pagespeed_get_field_data | CrUX real-user Core Web Vitals (scope: "page" | "origin"), traffic histograms, and optional weekly includeHistory: true trends. |
pagespeed_compare_pages | Side-by-side comparison (mode: "pages") or multi-run regression check against a stored baseline (mode: "baseline"). |
pagespeed_analyze_batch | Parallel triage of 1β10 URLs bounded by MAX_CONCURRENCY with MCP progress notifications. |
pagespeed_clear_cache | Clear the in-memory response cache after a deploy. |
MCP Prompts (Slash Commands) & Resources
| Prompt | What it runs |
|---|---|
/performance-audit | Guided 4-step triage: Lighthouse summary β CrUX field data β targeted diagnostic β prioritized fix plan. |
/release-comparison | Staging vs production comparison with a clear GO / NO-GO release verdict. |
/core-web-vitals-deepdive | Contrasts real-user CrUX field metrics against synthetic Lighthouse lab data for LCP, INP, and CLS. |
| Resource URI / Template | Content |
|---|---|
pagespeed://web-vitals-guide | Official 2026 Core Web Vitals thresholds & optimization playbook (text/markdown). |
pagespeed://baselines | All locally stored baselines (application/json). |
pagespeed://baseline/{strategy}/{encodedUrl} | Dynamic template to read a single stored baseline snapshot (application/json). |
π CI Performance Gate & Streamable HTTP
CI / GitHub Actions Budget Check (check)
# Inline budget thresholds (exits 0 on pass, 1 on budget violation or baseline regression)
npx pagespeed-insights-mcp check https://example.com --strategy mobile --min-score 90 --max-lcp 2500 --max-cls 0.1
# Or load thresholds from .pagespeed.json (supports route overrides) and output JSON
npx pagespeed-insights-mcp check https://example.com --budget .pagespeed.json --json
# Per-type transfer budgets (Lighthouse resource-summary; 0 is a real limit, an unmeasured run fails the check)
npx pagespeed-insights-mcp check https://example.com --max-js-bytes 150000 --max-image-bytes 400000
.pagespeed.json is discovered from the nearest project root (.git or .pagespeed.json) at or above the
working directory, so check and the MCP server pick up the same strategy, budget and route budgets from
any checkout subdirectory. Precedence: per-call/flag values > route budget (exact URL, else pathname) > budget.
The MCP pagespeed_analyze_page and pagespeed_compare_pages tools apply the same defaults; compare resolves
each URL's route budget independently.
{
"strategy": "mobile",
"budget": {
"performanceScore": 85,
"lcp": 2500,
"cls": 0.1,
"tbt": 200,
"jsBytes": 150000,
"imageBytes": 400000
},
"budgets": {
"/checkout": {
"performanceScore": 92,
"lcp": 2000,
"jsBytes": 100000
}
},
"baselinesDir": ".pagespeed"
}
Budget keys: performanceScore (β₯), lcp/tbt/fcp/si/ttfb (ms, β€), cls (β€), totalByteWeight (bytes, β€),
jsBytes and imageBytes (transfer bytes from Lighthouse resource-summary, β€). A budget whose measurement is
missing from the result fails rather than passing silently.
Baseline storage (.pagespeed/baselines.json)
Baseline files are shared by the CLI and MCP server. The directory is chosen in this order (first match wins):
PAGESPEED_BASELINES_DIRenvironment variable.baselinesDirin the project's.pagespeed.json(relative paths resolve against that file).<project root>/.pagespeed/β created on first write, so it does not need to pre-exist. The project root is the nearest ancestor with.gitor.pagespeed.json, so baselines land in the checkout, not in the subdirectory.~/.pagespeed-mcp/when there is no project β a personal global store is never mixed with a project's.
Streamable HTTP Transport (--http)
Run a shared stateless MCP server for teams or cloud agents (/mcp endpoint + /health probe + optional Bearer auth):
MCP_AUTH_TOKEN=your-secret npx pagespeed-insights-mcp --http --port 3000 --host 127.0.0.1
βοΈ Environment Variables
| Variable | Default | Description |
|---|---|---|
GOOGLE_API_KEY | (optional) | Recommended for higher PSI quotas; required for CrUX field data. |
MAX_CONCURRENCY | 3 | Concurrent upstream/local analysis limit (1β10). |
REQUEST_TIMEOUT | 30000 | Per-request timeout in milliseconds (1000β60000). |
RETRY_ATTEMPTS | 3 | Retry count for transient 5xx/network failures (0β5). |
CACHE_TTL | 3600 | In-memory cache TTL in seconds (60β86400). |
LOG_LEVEL | info | trace | debug | info | warn | error | fatal (JSON to stderr). |
LOG_PRETTY | false | Set true for colorized logs when dev dependencies are installed. Otherwise, logs stay JSON on stderr. |
MCP_AUTH_TOKEN | (optional) | Bearer token required on /mcp in --http mode. |
PAGESPEED_BASELINES_DIR | (optional) | Override baseline storage dir. Without it: .pagespeed/baselinesDir, else <project root>/.pagespeed/, else ~/.pagespeed-mcp. |
CHROME_PATH | (auto) | Chrome/Chromium binary path for local Lighthouse (localhost). |
π Documentation & Development
- Full Docs: ruslanlap.github.io/pagespeed-insights-mcp (Getting Started Β· Tools Reference Β· Architecture Β· Live Demo)
- Changelog & Releases: GitHub Releases Β· CHANGELOG.md
- Requirements: Node.js >= 20.19.0
- Security: See SECURITY.md
npm run dev # Run with tsx
npm run build # Compile TypeScript -> dist/
npm run lint # ESLint
npm run typecheck # tsc --noEmit
npm test # Vitest suite
Acknowledgments & License
Special thanks to @engmsaleh and @system-conf for their significant contributions to this project.
Licensed under Apache-2.0.
Frequently asked questions
What is pagespeed-insights-mcp MCP Server?
Google PageSpeed Insights and CrUX: six workflow tools for web performance.
How do I install pagespeed-insights-mcp MCP Server in Claude Desktop, Cursor, or VS Code?
Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. pagespeed-insights-mcp MCP Server runs locally from the npm package pagespeed-insights-mcp with the command npx -y pagespeed-insights-mcp@2.5.0.
Is pagespeed-insights-mcp MCP Server free and open source?
Yes. pagespeed-insights-mcp MCP Server is released under the Apache-2.0 license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.
Does pagespeed-insights-mcp MCP Server support remote (HTTP) connections?
No remote endpoint is listed for pagespeed-insights-mcp MCP Server. It runs locally on your machine over stdio, started by your MCP client.
What tools does pagespeed-insights-mcp MCP Server provide?
pagespeed-insights-mcp MCP Server provides 6 tools, including pagespeed_analyze_batch, pagespeed_analyze_page, pagespeed_clear_cache, and pagespeed_compare_pages. See the full tool list for descriptions and parameters.
How is pagespeed-insights-mcp MCP Server's trust score calculated?
pagespeed-insights-mcp MCP Server scores 76 out of 100 (Good). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.
Reviews
No reviews yetβBe the first to review
No published reviews yet. Used it? Tell the next person how it went.
Sign inA verified email is required to review this server.
Add badge to your README
Paste either snippet into the repository README. The image links to this listing.