# pagespeed-insights-mcp

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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 76
- Author: ruslanlap
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ruslanlap/pagespeed-insights-mcp
- Updated: 2026-10-21
- HTML: https://affpapa.org/en/nevibecode/mcp/pagespeed-insights-mcp

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `GOOGLE_API_KEY` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add pagespeed-insights-mcp -e GOOGLE_API_KEY=<GOOGLE_API_KEY> -- npx -y pagespeed-insights-mcp
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add pagespeed-insights-mcp --env GOOGLE_API_KEY=<GOOGLE_API_KEY> -- npx -y pagespeed-insights-mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "pagespeed-insights-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "pagespeed-insights-mcp"
            ],
            "env": {
                "GOOGLE_API_KEY": "<GOOGLE_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "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

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e GOOGLE_API_KEY=<GOOGLE_API_KEY> pagespeed-insights-mcp npx -y pagespeed-insights-mcp
```
Replace <…> with your own values

## When to use it
- 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
- Run `pagespeed_analyze_page` on 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

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
