Core Web Vitals MCP Server
The Core Web Vitals MCP Server equips AI agents with tools to analyze real-user and lab Core Web Vitals, diagnose performance issues, and retrieve remediation playbooks.
Query CrUX real-user field metrics (LCP, INP, CLS, FCP, TTFB, overall assessment) for a URL or origin, with optional form factor and API key.
Retrieve 28-day historical CrUX field metric trends across 25+ weekly collection periods.
Run PageSpeed Insights lab audits for Lighthouse performance score, Speed Index, TBT, LCP, and savings opportunities (mobile or desktop, keyless capable).
Validate Google API credentials, endpoint connectivity, and test bed readiness via the doctor tool.
List and read diagnostic/remediation playbooks: google-api-setup, lcp-optimization, inp-debugging, cls-remediation.
Check PyPI for server updates.
Provides tools to query the Chrome User Experience Report (CrUX) API for real-user Core Web Vitals field metrics and 28-day historical trends.
Provides tools to run PageSpeed Insights lab audits, returning Lighthouse performance scores, Core Web Vitals, and savings opportunities.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Core Web Vitals MCP Server check Core Web Vitals for example.com"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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-mcpVia Node (npx)
npx -y core-web-vitals-tools-mcpRelated MCP server: @pulspeed/mcp-server
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:
Follow the official Google guide: PageSpeed Insights API - Get Started (API Key).
Or call
skill_read(name="google-api-setup")directly from your AI agent for step-by-step instructions.Set your environment variable:
export GOOGLE_API_KEY="AIzaSy..." # or export CRUX_API_KEY="AIzaSy..."
4. Tools
Tool | Parameters | Description |
|
| 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. |
|
| Query Google CrUX History API for 28-day historical field metric trends across 25+ weekly collection periods. |
|
| Run Google PageSpeed Insights lab audit for Lighthouse performance score (0-100), Speed Index, TBT, LCP, and top savings opportunities (works keyless!). |
|
| Diagnostic utility verifying Google API key configuration, testing endpoint connectivity, and verifying test bed readiness. |
| (none) | Lists dynamic Core Web Vitals diagnostic, remediation, and setup playbooks. |
|
| Fetches operational engineering playbooks: |
|
| 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 withscheduler.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, orCORE_WEB_VITALS_TELEMETRY=false.Zero PII: No user URLs, personal identifiers, or authentication keys are ever captured.
Available Tools
7 toolsaudit_pagespeedB
Run a Google PageSpeed Insights lab audit for synthetic Lighthouse performance scores and diagnostics.
Returns overall performance score (0-100), Speed Index, Total Blocking Time (TBT), Largest Contentful Paint (LCP), and prioritized remediation opportunities.
Args: url: URL of the web page to audit (e.g. 'https://surendranb.com'). strategy: Analysis strategy ('mobile' or 'desktop'). Defaults to 'mobile'. api_key: Optional Google API Key. If omitted, checks GOOGLE_API_KEY or PAGESPEED_API_KEY.
Inputs: url (required), api_key, strategy. Returns: result
check_for_updatesC
Check PyPI for the latest version of core-web-vitals-mcp.
Inputs: force. Returns: result
doctorB
Validate Google Cloud API credentials, test endpoint reachability, and check test beds.
Args: api_key: Optional Google API Key to test directly.
Inputs: api_key. Returns: result
get_crux_historyA
Query Google Chrome UX Report History API for 28-day historical field metric trends.
Provides timeseries percentiles for LCP, INP, CLS, FCP, and TTFB across 25+ weekly collection periods.
Args: url_or_origin: Web page URL or origin domain (e.g. 'https://surendranb.com'). form_factor: Optional device filter ('ALL_FORM_FACTORS', 'PHONE', 'DESKTOP', 'TABLET'). api_key: Optional Google API Key. If omitted, checks GOOGLE_API_KEY or CRUX_API_KEY environment variables.
Inputs: url_or_origin (required), api_key, form_factor. Returns: result
get_crux_metricsA
Query Google Chrome User Experience Report (CrUX) API for real-user field metrics.
Returns 75th percentile ratings for LCP, INP, CLS, FCP, TTFB, and overall Core Web Vitals assessment.
Args: url: Page URL (e.g. 'https://surendranb.com/blog/article') or root origin ('https://surendranb.com'). form_factor: Device form factor filter ('ALL_FORM_FACTORS', 'PHONE', 'DESKTOP', 'TABLET'). Defaults to ALL_FORM_FACTORS. api_key: Optional Google API Key. If omitted, checks GOOGLE_API_KEY or CRUX_API_KEY environment variables.
Inputs: url (required), api_key, form_factor. Returns: result
skill_readA
Read a specialized Core Web Vitals optimization playbook (e.g. 'lcp-optimization', 'inp-debugging', 'cls-remediation').
Args: name: Name of the skill to read. Call skills_list to view available playbooks.
Inputs: name (required). Returns: result
skills_listA
List available Core Web Vitals diagnostic and remediation playbooks (LCP, INP, CLS).
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
The core analysis tools are clearly separated by data source and shape: lab vs. field (audit_pagespeed vs. get_crux_metrics) and snapshot vs. timeseries (get_crux_metrics vs. get_crux_history). The two CrUX tools share a prefix and domain, which could cause a mild misselection, but descriptions make the distinction explicit. The remaining operational tools (doctor, check_for_updates) are unambiguous.
Most tools follow verb_noun (get_crux_history, get_crux_metrics, audit_pagespeed, check_for_updates), but skill_read and skills_list invert to noun_verb and 'doctor' is a bare noun with no action verb. The pattern is readable but not uniform, so an agent cannot reliably predict a name from an intended action.
Seven tools is a well-scoped size for a Core Web Vitals server, and no tool is redundant. Two of the seven (doctor, check_for_updates) serve the package itself rather than CWV analysis, which makes the analytical surface slightly thinner than the count suggests.
Coverage spans both major data planes (CrUX field metrics snapshot plus history timeseries) and lab diagnostics, with playbooks for remediation guidance and a credential/connectivity check. Gaps are minor: no batch or multi-URL comparison, no explicit mapping between audit opportunities and the referenced skills, and no export of raw percentile data beyond what the two CrUX tools return.
Maintenance
Related MCP Connectors
SEO & marketing toolkit for AI agents: GA4, Search Console, AdSense, GTM, PageSpeed, Trends.
Analyze web performance and get optimization insights from GTmetrix, directly in your AI workflow.
Marketing data and actions for AI agents: GA4, Search Console, ads, social, SEO and WordPress.
Real SEO data for AI assistants: page audits, Keyword Planner volumes, Search Console history.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to perform comprehensive web performance analysis using Google's PageSpeed Insights API, including metrics, best practices, SEO, and accessibility audits.44 npmMIT
- AlicenseAqualityBmaintenanceEnables AI agents to monitor website performance by scanning sites, retrieving Core Web Vitals, detecting regressions, and receiving AI-powered optimization recommendations.1159 npmMIT
- AlicenseAqualityDmaintenanceConnects LLMs to Google PageSpeed Insights to analyze web performance, accessibility, SEO, and best practices, enabling AI assistants to audit and improve any web page.10MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to analyze public websites, follow progress, retrieve shareable reports, compare multiple URLs, list checks and recent activity, and surface fixes ranked by impact.Apache 2.0