Skip to main content

Core Web Vitals MCP Server (core-web-vitals-mcp)

FastMCP server exposing Google Chrome User Experience Report (CrUX) and PageSpeed Insights APIs for real-user Core Web Vitals (LCP, INP, CLS), 28-day field history trends, and Lighthouse lab performance audits.

The definitive Core Web Vitals diagnostics engine for AI coding agents (Claude, Cursor, Copilot, Antigravity).


1. Quickstart

Run directly without installing via uvx (Python) or npx (Node):

Via Python (uvx)

uvx core-web-vitals-mcp

Via Node (npx)

npx -y core-web-vitals-tools-mcp

2. MCP Client Configuration

Add to your MCP client config (claude_desktop_config.json, cursor.json, or Antigravity):

{
  "mcpServers": {
    "core-web-vitals": {
      "command": "uvx",
      "args": ["core-web-vitals-mcp"],
      "env": {
        "GOOGLE_API_KEY": "your_google_api_key_here"
      }
    }
  }
}

Or using npx:

{
  "mcpServers": {
    "core-web-vitals": {
      "command": "npx",
      "args": ["-y", "core-web-vitals-tools-mcp"],
      "env": {
        "GOOGLE_API_KEY": "your_google_api_key_here"
      }
    }
  }
}

3. Google API Authentication & Keyless Mode

  • Works Keyless Out-of-the-Box: PageSpeed Insights lab audits (audit_pagespeed) run with zero API keys and zero configuration.
  • Chrome UX Report (CrUX): 28-day field data requires a free Google Cloud API key (up to 150 requests/minute). When running keyless, the server gracefully returns synthetic lab metrics and instructs your AI agent how to enable field data.
  • Built-in Client Throttling: Automatically throttles requests (1.5s for keyless PageSpeed, 0.5s for keyed PageSpeed, 0.4s for CrUX) and caches repeated queries to strictly honor Google's free usage limits and prevent HTTP 429 errors.

To configure an API key:

  1. Follow the official Google guide: PageSpeed Insights API - Get Started (API Key).
  2. Or call skill_read(name="google-api-setup") directly from your AI agent for step-by-step instructions.
  3. Set your environment variable:
    export GOOGLE_API_KEY="AIzaSy..."
    # or
    export CRUX_API_KEY="AIzaSy..."
    

4. Tools

Tool Parameters Description
get_crux_metrics url, form_factor="ALL_FORM_FACTORS", api_key Query Google CrUX API for real-user field metrics: LCP, INP, CLS, FCP, TTFB, and overall Core Web Vitals assessment. Falls back to PageSpeed when keyless.
get_crux_history url_or_origin, form_factor, api_key Query Google CrUX History API for 28-day historical field metric trends across 25+ weekly collection periods.
audit_pagespeed url, strategy="mobile", api_key Run Google PageSpeed Insights lab audit for Lighthouse performance score (0-100), Speed Index, TBT, LCP, and top savings opportunities (works keyless!).
doctor api_key Diagnostic utility verifying Google API key configuration, testing endpoint connectivity, and verifying test bed readiness.
skills_list (none) Lists dynamic Core Web Vitals diagnostic, remediation, and setup playbooks.
skill_read name Fetches operational engineering playbooks: google-api-setup, lcp-optimization, inp-debugging, or cls-remediation.
check_for_updates force=False Queries PyPI for newer versions and upgrade commands.

5. Playbook Skills

The server dynamically dissociates actionable engineering playbooks from the core runtime:

  • google-api-setup: Official setup guide to obtain a free Google Cloud API key, enable CrUX/PageSpeed APIs, and manage free usage limits per developers.google.com.
  • lcp-optimization: 4-phase breakdown (TTFB, Load Delay, Load Duration, Render Delay), image format conversion, preloading, and render blocking mitigation.
  • inp-debugging: Interactive latency breakdown (Input Delay, Processing, Presentation Delay), task chunking with scheduler.yield(), and long task mitigation.
  • cls-remediation: Aspect-ratio reservation, fallback font metric overrides (size-adjust), and layout stability patterns.

6. Telemetry & Privacy

This package includes anonymous usage telemetry to ensure reliability and detect runtime bugs across different client harnesses. Telemetry adheres strictly to Schema v2:

  • Opt-Out: Strictly respects DO_NOT_TRACK=1, DISABLE_TELEMETRY=1, MCP_TELEMETRY_OPT_OUT=1, or CORE_WEB_VITALS_TELEMETRY=false.
  • Zero PII: No user URLs, personal identifiers, or authentication keys are ever captured.

Metadata

Release files for core-web-vitals-mcp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for core-web-vitals-mcp 0.1.1
File Size Uploaded Provenance Actions
core_web_vitals_mcp-0.1.1.tar.gz 32.7 kB Without provenance Details for core_web_vitals_mcp-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for core-web-vitals-mcp 0.1.1
File Interpreter ABI Platform Actions
core_web_vitals_mcp-0.1.1-py3-none-any.whl Python 3 none any Details for core_web_vitals_mcp-0.1.1-py3-none-any.whl

Total release size: 64.2 kB

Release files / core_web_vitals_mcp-0.1.1.tar.gz

Download URL core_web_vitals_mcp-0.1.1.tar.gz
Size 32.7 kB
Tags Source
SHA-256 checksum
How to use checksums
29f6db2d7a675cb1e78601176d87bd2aae1ba6ed0890bdb9e23aa5e002f57135
BLAKE2b-256 checksum
How to use checksums
3eb333532c5630bb5318e21c0213eb44f5d74ef4f53aee78c19e05708c64d01e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / core_web_vitals_mcp-0.1.1-py3-none-any.whl

Download URL core_web_vitals_mcp-0.1.1-py3-none-any.whl
Size 31.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a53a830eb57fe67b0405f20cba960b5645b6b3a0f574ca7d5e891bd9c0fa9e75
BLAKE2b-256 checksum
How to use checksums
610a323fa1871e30cffc625ee6da6a7bcf3f19a7f9771bb9314d31c8acc6425b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Security for core-web-vitals-mcp 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page