Model Context Protocol

Connect AI Agents to
Lighthouse Audits

PageSpeed Exporter exposes an MCP server so Claude Desktop, LangChain, AutoGen, and any MCP-compatible client can run live Google Lighthouse audits on any URL — directly inside your AI workflow.

What the analyze_url tool returns

One tool call returns a complete, AI-optimised performance report. No post-processing required — every field is labelled and ready for the model to reason about.

  • Scores (0–100)Performance, Accessibility, Best Practices, SEO
  • Core Web VitalsLCP, FCP, CLS, TBT, Speed Index, TTI — with exact timings and pass/fail status
  • Real-user dataCrUX field data (p75 LCP, FID, CLS) with Fast / Moderate / Slow rating
  • OpportunitiesPrioritised list of fixes with estimated millisecond savings
  • DiagnosticsTechnical issues with descriptions and impact ratings
  • Stack hintsFramework-specific recommendations (WordPress, Next.js, React, Shopify…)

Add to Claude Desktop

Claude Desktop supports MCP servers natively (version 0.10+). Add the following to your claude_desktop_config.json:

macOS / Linux

~/Library/Application Support/Claude/claude_desktop_config.json

Windows

%APPDATA%\Claude\claude_desktop_config.json

Configuration

{
  "mcpServers": {
    "pagespeed-exporter": {
      "url": "https://speedexporter.com/api/mcp",
      "transport": "http"
    }
  }
}

Restart Claude Desktop after saving. You'll see a pagespeed-exporter tool appear in the tools panel. Claude can now run Lighthouse audits on any URL you ask about.

Example prompts for Claude

Once connected, try prompts like:

Audit https://mysite.com and tell me the top 3 things slowing it down
Check the mobile performance of https://mystore.com and explain the CLS score
Run a desktop Lighthouse audit on https://example.com and give me a prioritised fix list
Why is my LCP so high? Audit https://mysite.com on mobile
Compare the performance score of https://mysite.com vs https://competitor.com

Programmatic / Agent frameworks

The MCP endpoint is a standard HTTP JSON-RPC 2.0 server. Use it with LangChain, AutoGen, CrewAI, or any framework that supports OpenAPI or direct HTTP tool calls.

Step 1 — Initialise the session

POST https://speedexporter.com/api/mcp

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "initialize",
  "params": {
    "protocolVersion": "2024-11-05",
    "capabilities": {},
    "clientInfo": { "name": "my-agent", "version": "1.0" }
  }
}

Step 2 — Call the tool

POST https://speedexporter.com/api/mcp

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "analyze_url",
    "arguments": {
      "url": "https://example.com",
      "strategy": "mobile"
    }
  }
}

Optional — Bring your own Google API key

"arguments": {
  "url": "https://example.com",
  "strategy": "mobile",
  "api_key": "YOUR_GOOGLE_PSI_API_KEY"
}

Get a free API key at console.cloud.google.com (enable the PageSpeed Insights API). Providing your own key bypasses shared quota limits.

Tool schema

Retrieve the full tool definition at any time with tools/list:

{
  "name": "analyze_url",
  "inputSchema": {
    "type": "object",
    "required": ["url"],
    "properties": {
      "url":      { "type": "string" },
      "strategy": { "type": "string", "enum": ["mobile", "desktop"], "default": "mobile" },
      "api_key":  { "type": "string" }
    }
  }
}

Further reading