pagespeed-insights
MCP server for Google PageSpeed Insights API that enables web page performance analysis directly through Claude.
claude mcp add --transport stdio ruslanlap-pagespeed-insights-mcp npx -y -p pino-pretty -p pagespeed-insights-mcp pagespeed-insights-mcp \ --env GOOGLE_API_KEY="your-google-api-key-here"
How to use
The PageSpeed Insights MCP Server exposes Google's PageSpeed Insights capabilities through Claude, enabling you to run performance analyses and access detailed Lighthouse reports directly from the chat interface. It supports rich output such as visual analysis (screenshots, filmstrip, full-page captures), element-level debugging, a network waterfall, JavaScript profiling, image optimization insights, render-blocking analysis, and third-party impact assessments, all wrapped into a single MCP server you can query via Claude prompts. To start using it, configure the MCP with your Google API key and invoke the server by selecting the pagespeed-insights MCP and running commands that leverage the server’s tools. The included pino-pretty logging option ensures readable, nicely formatted logs during operation. The integration makes it easy to obtain actionable performance recommendations and automated audits from PageSpeed Insights within Claude conversations. The server is designed for multi-platform usage, supporting mobile and desktop perspectives and providing quick installation for rapid experimentation.
In practice, you can request specific outputs such as Lighthouse audits, render-blocking analysis, or third-party script impact, and the MCP will return structured results and guidance tailored to those facets. It also offers visual captures and performance breakdowns to help you pinpoint optimization opportunities.
How to install
Prerequisites:
- Node.js and npm installed on your system (or a compatible environment that supports npx).
- A Google API key with access to the PageSpeed Insights API.
- Optional: Docker if you prefer containerized deployment.
Option A: Quick start with npm/npx (recommended for local development)
- Install Node.js and npm from https://nodejs.org/
- Export your Google API key:
- Linux/macOS: export GOOGLE_API_KEY=your-google-api-key
- Windows (PowerShell): $env:GOOGLE_API_KEY = "your-google-api-key"
- Run the MCP server via npx (no permanent install required): npx -y -p pino-pretty -p pagespeed-insights-mcp pagespeed-insights-mcp
- Ensure the environment variable GOOGLE_API_KEY is available to the process (the command above includes it in MCP config).
Option B: Docker deployment
- Build the Docker image: docker build -t pagespeed-insights-mcp .
- Run the container with your API key: docker run -e GOOGLE_API_KEY=your-google-api-key -p 8080:8080 pagespeed-insights-mcp (Adjust port mappings as needed.)
Option C: Claude Desktop or Codex integration
- Use the provided MCP configuration (see mcp_config section) and insert your GOOGLE_API_KEY.
- If you want to log nicely in development, enable pino-pretty by including it in the npx args as shown in the configuration example.
Prerequisites summary
- A valid Google API key configured for PageSpeed Insights API
- Node.js/npx or Docker for deployment
- Optional: pino-pretty for readable logs
Additional notes
Tips and common issues:
- GOOGLE_API_KEY is required; without it, requests to PageSpeed Insights will fail. Ensure the key has the necessary API access enabled.
- If you prefer production-grade logging without pretty output, you can omit pino-pretty from the args. In that case, logs may be more verbose but faster.
- Docker users can customize environment variables or mount configuration as needed. The example uses a direct GOOGLE_API_KEY environment variable.
- The MCP configuration examples show both Claude Desktop (JSON) and Codex (TOML) formats. Ensure you place the configuration in the correct editor for your workflow.
- The npm package is pagespeed-insights-mcp; you can install globally or use npx for quick execution. If you plan to deploy in production, consider a proper process manager and environment isolation.
- If you encounter rate limits or API quota issues, monitor your PageSpeed Insights quota and consider caching results where appropriate via the MCP's caching capabilities.
Related MCP Servers
claude-config-editor
Claude Config Editor is a lightweight web tool that helps you clean and optimize your Claude Code/Desktop config files (.claude.json). Analyze project sizes, bulk delete chat histories, export data for backup, manage servers visually, and speed up Claude—all locally, with auto-backup, no dependencies, and cross-platform support.
awesome-claude-dxt
Awesome Claude Desktop Extensions (dxt) (not only Claude) mcpb
ollama
An MCP Server for Ollama
mcp-rest-api
A TypeScript-based MCP server that enables testing of REST APIs through Cline. This tool allows you to test and interact with any REST API endpoints directly from your development environment.
claude-code-vm
Deploy Claude Code and additional tools to a VM for remote development
mcp -webscan
A Model Context Protocol (MCP) server for web content scanning and analysis. This server provides tools for fetching, analyzing, and extracting information from web pages.