Built for Claude Code

Lighthouse MCP & JSON for Claude Code

Connect Claude Code to PageSpeed Exporter via MCP (claude mcp add) to run live Lighthouse audits, read scorePlan, edit files, and re-scan from your terminal.

Loading…

Loading...

How to use Lighthouse JSON with Claude Code

  1. 1

    Sign in at speedexporter.com and generate an MCP account token on /dashboard

  2. 2

    Register the MCP server in one command: claude mcp add --transport http pagespeed-exporter https://speedexporter.com/api/mcp --header "Authorization: Bearer YOUR_ACCOUNT_TOKEN"

  3. 3

    Start Claude Code inside your project repository

  4. 4

    Ask Claude Code to run analyze_url or the fix_all_issues prompt on your public or preview URL

  5. 5

    Review and apply Claude Code's edits for the highest pointsAtRisk metric

  6. 6

    Deploy the branch and tell Claude Code to call analyze_url again until every metric reaches targetFor90

Ready-to-use prompt for Claude Code

Copy this prompt, attach your stripped AIReport JSON, and send it to Claude Code:

Use the pagespeed-exporter MCP tool analyze_url on https://[your-site.com] with strategy "mobile".

1. Read scorePlan and list every metric's numericValue, pointsAtRisk, and targetFor90
2. Fix the metric with the largest pointsAtRisk first using fixLocation and details (skip passedAuditIds; do not sort by savings.ms)
3. Edit the project files directly, run our build/tests, and summarize what to deploy before we re-scan

Run live audits in Claude Code via MCP

/api/mcp

Claude Code supports HTTP MCP servers natively via `claude mcp add --transport http`. Once registered with your dashboard token, Claude Code can invoke `analyze_url` and `fix_all_issues` directly from your terminal.

Frequently asked questions

How do I add PageSpeed Exporter to Claude Code?

Run `claude mcp add --transport http pagespeed-exporter https://speedexporter.com/api/mcp --header "Authorization: Bearer YOUR_ACCOUNT_TOKEN"` using the token generated in your /dashboard.

How are Claude Code MCP audits billed?

Every analyze_url call uses your account's shared monthly allowance: Free 5 reports/month, Starter ($9/mo) 50 reports/month, Pro ($29/mo) 200 reports/month. strategy "both" counts as two reports.

Can Claude Code also work from a downloaded AIReport JSON file?

Yes. Save the <50KB AIReport JSON into your repo (e.g., `aireport.json`), reference it in Claude Code, and let it edit your codebase based on scorePlan.pointsAtRisk.

Also works with

Need more reports? View pricing plans starting at $9/month.