mcpField
P
PageSpeed MCP Server

PageSpeed MCP Server

Local
github.com/PhialsBasementData & Analytics13Updated 59w ago

About PageSpeed MCP Server

PageSpeed MCP Server connects AI assistants to the Google PageSpeed Insights API for URL-based website analysis. It covers performance metrics, best practices, SEO, accessibility, and resource optimization.

Key features

  1. 01Analyze Core Web Vitals and performance metrics
  2. 02Check best practices and browser issues
  3. 03Audit SEO and mobile friendliness
  4. 04Assess accessibility
  5. 05Identify resource optimization opportunities

Use cases

  1. 01Evaluate page loading performance
  2. 02Find SEO or accessibility issues
  3. 03Review mobile page behavior

MCP support

The MCP server exposes Google PageSpeed Insights analysis to compatible MCP clients, returning performance, accessibility, best-practices, and SEO results.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"Pagespeed-MCP-Server": {
"command": "npx",
"args": [
"-y",
"@smithery/cli"
]
}
}
}
Run commandnpx -y @smithery/cli

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@smithery/cli

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MseeP.ai Security Assessment Badge

PageSpeed MCP Server

smithery badge

A Model Context Protocol (MCP) server that extends AI assistant capabilities with PageSpeed Insights functionality. This server acts as a bridge between AI models and Google's PageSpeed Insights API, enabling detailed performance analysis of websites.

Overview

The PageSpeed MCP server is designed to enhance AI assistants' capabilities by allowing them to perform comprehensive web performance analysis. When integrated, AI models can request and interpret detailed performance metrics, Core Web Vitals, and other critical web performance data for any given URL.

Installation

Installing via Smithery

To install PageSpeed Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install mcp-pagespeed-server --client claude
Manual Installation
npm install pagespeed-mcp-server

Configuration

Add the PageSpeed MCP to your AI assistant's(claude in this case) configuration file:

{
    "pagespeed": {
        "command": "node",
        "args": ["path/to/mcp-pagespeed-server/dist/index.js"],
        "env": {
           "GOOGLE_API_KEY": "<YOUR-API-KEY>"
        }
    }
}

Detailed Capabilities

Performance Metrics Analysis
  • First Contentful Paint (FCP)
  • Largest Contentful Paint (LCP)
  • Time to Interactive (TTI)
  • Total Blocking Time (TBT)
  • Cumulative Layout Shift (CLS)
  • Speed Index
  • Time to First Byte (TTFB)
Best Practices Assessment
  • HTTPS usage
  • JavaScript error monitoring
  • Browser console warnings
  • Deprecated API usage
  • Image aspect ratio analysis
  • Link security checks
SEO Analysis
  • Meta description validation
  • Robots.txt validation
  • Structured data validation
  • Crawlable links verification
  • Meta tags assessment
  • Mobile friendliness
Accessibility Audits
  • ARIA attribute validation
  • Color contrast checking
  • Heading hierarchy analysis
  • Alt text verification
  • Focus management assessment
  • Keyboard navigation testing
Resource Optimization
  • Image optimization suggestions
  • JavaScript bundling analysis
  • CSS optimization recommendations
  • Cache policy validation
  • Resource minification checks
  • Render-blocking resource identification

API Response Structure

The MCP server provides detailed JSON responses including:

{
    "lighthouseResult": {
        "categories": {
            "performance": { /* Performance metrics */ },
            "accessibility": { /* Accessibility results */ },
            "best-practices": { /* Best practices audit */ },
            "seo": { /* SEO findings */ }
        },
        "audits": {
            // Detailed audit results for each category
        },
        "timing": {
            // Performance timing data
        },
        "stackPacks": {
            // Technology-specific advice
        }
    }
}

Advanced Usage

Custom Configuration

You can customize the PageSpeed analysis by providing additional parameters:

{
    "strategy": "mobile", // or "desktop"
    "category": ["performance", "accessibility", "best-practices", "seo"],
    "locale": "en",
    "threshold": {
        "performance": 90,
        "accessibility": 100,
        "best-practices": 90,
        "seo": 90
    }
}
Error Handling

The MCP server includes robust error handling for:

  • Invalid URLs
  • Network timeouts
  • API rate limiting
  • Invalid parameters
  • Server-side errors

Requirements

Network Requirements
  • Stable internet connection
  • Access to Google's PageSpeed Insights API
Platform Support
  • Windows (x64, x86)
  • Linux (x64)
  • macOS (x64, arm64)

Integration Examples

Basic Integration
const PageSpeedMCP = require('pagespeed-mcp-server');
const mcp = new PageSpeedMCP();

await mcp.analyze('https://example.com');
With Custom Options
const results = await mcp.analyze('https://example.com', {
    strategy: 'mobile',
    categories: ['performance', 'accessibility'],
    locale: 'en-US'
});

Troubleshooting

Common Issues
  1. Connection Timeouts

    • Check internet connectivity
  2. API Rate Limiting

    • Use API key for higher limits
  3. Memory Issues

    • Adjust Node.js memory limits

Development

Building from Source
git clone https://github.com/phialsbasement/mcp-pagespeed-server
cd mcp-pagespeed-server
npm install
npm run build
Running Tests
npm run test
Contributing
  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

Support

Getting Help
  • GitHub Issues: Report bugs and feature requests

License

MIT License - See LICENSE file for details

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.