pagespeed-insights-mcp — Claude Code MCP server: six performance tools
Wires Google PageSpeed Insights and the Chrome UX Report into your AI client. Useful when a page is slow and you want a ranked list of fixes, not just a score.
claude mcp add pagespeed-insights-mcp -e GOOGLE_API_KEY=<GOOGLE_API_KEY> -- npx -y pagespeed-insights-mcpWhat pagespeed-insights-mcp does
This server ships six tools rather than the usual single “run PSI on a URL”. You get page analysis, CrUX field data for a URL and for an origin, Lighthouse audits, multi-page and batch comparison, baselines, and regression tracking. Diagnostics reach element level: network, JavaScript, images, render-blocking resources, third-party impact.
A recommendations engine turns raw Lighthouse output into a prioritised fix list, and screenshots get analysed too. Repeat runs are cached. The package is on npm, listed in the Official MCP Registry and Glama, and CI runs Vitest.
You need a GOOGLE_API_KEY; the server will not start without one. The Claude Desktop and Codex configurations pull in pino-pretty through npx so logs are formatted readably — the minimal launch command skips it.
What it helps with
- find out which resources drag a Lighthouse score down
- compare load speed across several pages in one run
- pull real-user CrUX numbers instead of lab-only results
- record a baseline and catch regressions after a deploy
- spot third-party scripts blocking the first paint
Example prompts for the agent
- Run
pagespeed_analyze_pageon the homepage and tell me which fixes matter most - Compare mobile scores for three catalog pages and put them in a table
- Fetch CrUX origin data and explain how it differs from the lab run
How to install pagespeed-insights-mcp
Platform CLI
claude mcp add pagespeed-insights-mcp -e GOOGLE_API_KEY=<GOOGLE_API_KEY> -- npx -y pagespeed-insights-mcpReplace <…> with your own values
Platform CLI
codex mcp add pagespeed-insights-mcp --env GOOGLE_API_KEY=<GOOGLE_API_KEY> -- npx -y pagespeed-insights-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"pagespeed-insights-mcp": {
"command": "npx",
"args": [
"-y",
"pagespeed-insights-mcp"
],
"env": {
"GOOGLE_API_KEY": "<GOOGLE_API_KEY>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"pagespeed-insights-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"pagespeed-insights-mcp"
],
"env": {
"GOOGLE_API_KEY": "<GOOGLE_API_KEY>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e GOOGLE_API_KEY=<GOOGLE_API_KEY> pagespeed-insights-mcp npx -y pagespeed-insights-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about pagespeed-insights-mcp
How do I install pagespeed-insights-mcp in Claude Code?
Run claude mcp add pagespeed-insights-mcp -e GOOGLE_API_KEY=<GOOGLE_API_KEY> -- npx -y pagespeed-insights-mcp. The alternative form is claude mcp add --env GOOGLE_API_KEY=<GOOGLE_API_KEY> --transport stdio pagespeed-insights-mcp -- npx -y pagespeed-insights-mcp.
What does pagespeed-insights-mcp do?
It exposes six tools over Google PageSpeed Insights and the Chrome UX Report: page analysis, CrUX data, Lighthouse audits, page comparison, baselines, and regression tracking.
What does the server need to run?
A GOOGLE_API_KEY, passed as an environment variable when you register the server. The Claude Desktop and Codex configs also install pino-pretty so log output stays readable.