The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Pagespeed Insights MCP listing page.
Six-tool MCP server for Google PageSpeed Insights & Chrome UX Report APIs. Analyze, compare, and optimize web performance directly through Claude, Cursor, or any MCP-compatible AI client.
Get a free API key at Google Cloud Console → paste into Claude Desktop's claude_desktop_config.json → restart. Done. (Codex/OpenAI config, Docker)
Most PageSpeed MCP servers wrap one tool: "run PSI on a URL." This server ships six workflow tools covering the full performance workflow — not just a score, but an action plan:
🎬 View Interactive Demo → — See the tools in action with animated examples Fallback URL: https://ruslanlap.github.io/pagespeed-insights-mcp/demo.html
Add to your claude_desktop_config.json:
Add to your configuration (TOML):
Note: The
pino-prettypackage is required for proper log formatting. The above configurations ensure it is installed automatically vianpx.
Add to ~/.grok/config.toml (global) or <repo>/.grok/config.toml (project-scoped, higher priority):
Project-scoped example (put in this repo's .grok/config.toml for local dist/index.js + tighter Serena):
Verification inside Grok session:
/mcps (or Ctrl+L → MCP tab) → ensure pagespeed-insights shows "running"pagespeed-insights__pagespeed_analyze_page, pagespeed-insights__pagespeed_get_field_data, etc. (namespaced)Real pagespeed_analyze_page results for github.com — one mobile Lighthouse run. CrUX numbers come from pagespeed_get_field_data with scope: "origin":
Lighthouse lab scores:
| Category | Score | Status |
|---|---|---|
| Performance (mobile) | 54/100 | 🔴 Poor |
| Performance (desktop) | 52/100 | 🔴 Poor |
Core metrics (mobile):
| Metric | Value | Rating |
|---|---|---|
| First Contentful Paint | 11.9 s | 🔴 Poor |
| Largest Contentful Paint | 13.4 s | 🔴 Poor |
| Total Blocking Time | 30 ms | 🟢 Excellent |
| Cumulative Layout Shift | 0.07 | 🟢 Good |
| Speed Index | 11.9 s | 🔴 Poor |
CrUX field data — real users, github.com origin (phone):
| Metric | p75 (real users) |
|---|---|
| First Contentful Paint | 1.9 s |
| Largest Contentful Paint | 2.2 s |
| Interaction to Next Paint | 243 ms |
| Cumulative Layout Shift | 0.02 |
Results vary between runs — Lighthouse lab data is noisy (a single run is one sample). Use
runs: 3-5for medians.Lab vs field: Lighthouse throttles the connection (hence 54/100 mobile), while CrUX shows how actual GitHub visitors experience it — both views come straight from this server's tools.
We have comprehensive documentation available online.
👉 View Full Documentation Site
You can also view the raw markdown files in the
docs/directory or runmkdocs servelocally.
Current release: v2.0.0.
Recent highlights:
pagespeed_* tools replace the 19 v1 endpoint-shaped tools; all data tools support Markdown or JSON with structured results.The badges at the top of this README update automatically on every release (npm version, GitHub package version, downloads). No manual edits needed.
For the complete release history, see CHANGELOG.md.
Pain point 1 — "My page is slow but I don't know why." You open PageSpeed Insights, get a wall of data, and still can't tell what to fix first. This MCP gives your AI assistant six focused workflows that cut through the noise: it identifies the exact render-blocking resources, the specific images wasting 2 MB, the third-party scripts eating 1.5 s of main-thread time — and ranks them by impact. Ask "why is my site slow?" and get a prioritized fix list, not a 40-metric dashboard.
Pain point 2 — "I ship performance regressions to production." Your team moves fast, deploys daily, and nobody runs a full Lighthouse audit before each merge. By the time someone notices the Core Web Vitals dropped, the regression is already live. This MCP lets any developer paste a URL into Claude/Cursor and get a complete audit — lab data, field data from real Chrome users (CrUX), element-level CLS/LCP debugging — in seconds. It's the difference between catching a regression at your desk and discovering it in a Slack message from the SEO team three days later.
The installer uses the public npm package (pagespeed-insights-mcp) by default. To install the scoped GitHub Packages build instead, configure GitHub Packages authentication first and run:
Note: This package is available on both npm and GitHub Packages.
- For npm: Use
npm install pagespeed-insights-mcp- For GitHub Packages: Use
npm install @ruslanlap/pagespeed-insights-mcp(requires GitHub authentication)For detailed instructions on installing from GitHub Packages, see GITHUB_PACKAGES.md or visit the GitHub Packages page
The MCP server requires a Google API key to access the PageSpeed Insights API.
Note: These examples include
pino-prettyfor better log formatting. For production use without pretty logs, see the Logging section below.
Example configuration files are available in the examples directory.
To use this MCP server, you need a Google API key with the PageSpeed Insights API enabled.
[!TIP] ⚡ Quick Setup Link: You can go directly to the Google Cloud Credentials Setup Page to quickly create a key in your project.
GOOGLE_API_KEY in your configuration.
Config paths: macOS ~/Library/Application Support/Claude/claude_desktop_config.json · Windows %APPDATA%\Claude\claude_desktop_config.json · Linux ~/.config/claude/claude_desktop_config.json — see ⚙️ Client Configuration above for the JSON. Restart Claude Desktop after editing.
After configuration, simply ask Claude any of these commands:
Version 2 replaces the former 19 endpoint-shaped tools with six workflow tools. This is a breaking change: update MCP client prompts, saved tool calls, and integrations to use the names below. Every data-returning tool accepts responseFormat (markdown, default, or json) and returns MCP structuredContent.
| Tool | Use it for |
|---|---|
pagespeed_analyze_page | One-page Lighthouse health check, full report, recommendations, audit findings, or a Mermaid map (report). |
pagespeed_diagnose_page | One focused investigation: visual, elements, network, javascript, images, render-blocking, or third-parties. |
pagespeed_get_field_data | CrUX real-user Core Web Vitals for a page or origin. |
pagespeed_compare_pages | Compare two pages now, or compare one page with its saved baseline (mode). |
pagespeed_analyze_batch | Triage 1–10 pages with progress notifications when supported. |
pagespeed_clear_cache | Clear this process's in-memory API cache after a deploy. |
| v1 tools | v2 replacement |
|---|---|
analyze_page_speed, get_performance_summary, get_recommendations, get_full_audit, get_performance_map | pagespeed_analyze_page with report=full, summary, recommendations, audit, or performance-map |
get_visual_analysis, get_element_analysis, get_network_analysis, get_javascript_analysis, get_image_optimization_details, get_render_blocking_details, get_third_party_impact | pagespeed_diagnose_page with the matching focus |
crux_summary, get_origin_crux | pagespeed_get_field_data with scope=page or origin |
compare_pages, compare_baseline | pagespeed_compare_pages with mode=pages or baseline |
batch_analyze, clear_cache | pagespeed_analyze_batch, pagespeed_clear_cache |
full_report | Run pagespeed_analyze_page and pagespeed_get_field_data; lab and field data stay explicit rather than being mixed. |
answer example from Claude Desktop with pagespeed-insights-mcp 🔥🔥🔥
For better log formatting during development, it is recommended to install pino-pretty globally:
pino-pretty in MCP environmentsThis MCP server uses pino for logging and enables the pino-pretty transport when NODE_ENV=development.
or in your MCP config:
npx, you can have npx install pino-pretty alongside the server:Ensure the GOOGLE_API_KEY environment variable is set in your Claude Desktop configuration.
Check if PageSpeed Insights API is enabled in your Google Cloud project.
Ensure the URL includes the protocol — only http:// and https:// are accepted. Other schemes (file://, ftp://, javascript:, etc.) are rejected at the schema level.
Please report security issues privately — do not open a public issue. See SECURITY.md for the disclosure policy and operator hardening notes.
Special thanks to @engmsaleh (Mohamed Saleh Zaied) for his significant contribution to the development of this project.
A very special thank you to @system-conf for their outstanding and invaluable contribution to the growth and development of this project. Your dedication, expertise, and continuous support have made a tremendous impact — this project wouldn't be where it is today without you. 🙏
Apache-2.0 — see LICENSE. Patents granted by contributors under the Apache License 2.0.
For bug reports or feature requests, please create an issue in the repository.