Google CrUX MCP

v1.2.1
io.github.A1-x-Tech/mcp-google-crux Checked 1 day ago Published 1 month ago

Real-user Core Web Vitals from the Chrome UX Report (CrUX) API for any origin or URL.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_core_web_vitals Core Web Vitals assessment

One-call Core Web Vitals assessment for an origin or URL over the latest 28-day window. Per metric (LCP, INP, CLS + diagnostic FCP and TTFB): p75, rating (good | needs-improvement | poor, web.dev thresholds: LCP ≤2500ms/>4000ms, INP ≤200ms/>500ms, CLS ≤0.10/>0.25) and the good/needs_improvement/poor user-experience densities (~sum 1.0). `passes_core_web_vitals` is true when all three CWV rate good. Timings are ms; CLS is unitless. Returns {no_data: true} when the origin/URL has insufficient traffic in CrUX. Provide exactly one of `origin` or `url`.

ParameterTypeDescription
form_factorstringDevice class filter. Omit for the aggregated record across all devices. tablet traffic is tiny and usually has no data.
originstringSite origin — scheme + host only, e.g. https://example.com (no path, no trailing slash). Aggregates real-user data across ALL pages of the site. Mutually exclusive with `url`. http/https and www/non…
urlstringA specific page URL, e.g. https://example.com/pricing/. Mutually exclusive with `origin`. Pass the final post-redirect URL (the API does not follow redirects); fragments and query params are stripped…

compare_form_factors Phone vs desktop vs tablet

Compares real-user performance across device classes for an origin or URL: one aggregated all-devices record plus phone, desktop and tablet records (4 API requests = 4 quota units of the 150/min budget). Per device: p75 + rating per metric; `traffic_share` gives each device's fraction of page loads (from the unfiltered form_factors metric). Devices without enough data come back as {no_data: true} — expected for tablet almost always. Default metrics: the three Core Web Vitals. Provide exactly one of `origin` or `url`.

ParameterTypeDescription
metricsarrayMetric names to return; omit for all available metrics. Timings are integer milliseconds; cumulative_layout_shift is a string-encoded double. form_factors is only returned when form_factor is NOT set.
originstringSite origin — scheme + host only, e.g. https://example.com (no path, no trailing slash). Aggregates real-user data across ALL pages of the site. Mutually exclusive with `url`. http/https and www/non…
urlstringA specific page URL, e.g. https://example.com/pricing/. Mutually exclusive with `origin`. Pass the final post-redirect URL (the API does not follow redirects); fragments and query params are stripped…

compare_origin_vs_url Origin vs specific page

Compares the site-wide origin record against one specific page (2 API requests): p75 + rating per metric for each, so you can tell whether a page is faster or slower than the site average. Either side can come back {no_data: true} (single pages often lack data; redirecting homepages can lack origin data while pages have it). Default metrics: the three Core Web Vitals. Both `origin` AND `url` are required here (unlike the other tools).

ParameterTypeDescription
origin *stringSite origin — scheme + host only, e.g. https://example.com. Required.
url *stringThe page URL to compare against the origin, e.g. https://example.com/pricing/. Required.
form_factorstringDevice class filter. Omit for the aggregated record across all devices. tablet traffic is tiny and usually has no data.
metricsarrayMetric names to return; omit for all available metrics. Timings are integer milliseconds; cumulative_layout_shift is a string-encoded double. form_factors is only returned when form_factor is NOT set.

get_cwv_trend Core Web Vitals trend

Weekly p75 trend for an origin or URL from the CrUX History API (1 request). Per metric: `points` — array of {period_end, p75, rating}, one per week (each week is a 28-day rolling window ending on period_end; ineligible weeks are skipped), and `delta` — first vs last p75 with direction improved | regressed | stable (lower is always better). Default metrics: the three Core Web Vitals; `weeks` caps the history depth (1..40, default 25). History data updates on Mondays. Returns {no_data: true} when CrUX has no data. Provide exactly one of `origin` or `url`.

ParameterTypeDescription
form_factorstringDevice class filter. Omit for the aggregated record across all devices. tablet traffic is tiny and usually has no data.
metricsarrayMetrics to trend (only p75-bearing metrics); default: the three Core Web Vitals (largest_contentful_paint, interaction_to_next_paint, cumulative_layout_shift).
originstringSite origin — scheme + host only, e.g. https://example.com (no path, no trailing slash). Aggregates real-user data across ALL pages of the site. Mutually exclusive with `url`. http/https and www/non…
urlstringA specific page URL, e.g. https://example.com/pricing/. Mutually exclusive with `origin`. Pass the final post-redirect URL (the API does not follow redirects); fragments and query params are stripped…
weeksintegerHow many weekly periods of history to analyze (1..40; default 25).

query_record Latest CrUX record (raw)

Returns the latest 28-day rolling CrUX record for an origin or URL (raw API response, updated daily ~04:00 UTC). Per metric: `histogram` (3 bins good/needs-improvement/poor with `density`), `percentiles.p75`, and for enum metrics `fractions`. Timings are integer ms; cumulative_layout_shift p75 is a string-encoded double (e.g. "0.05"). `collectionPeriod` always spans 28 days. `urlNormalizationDetails` appears if the URL was normalized (e.g. fragment stripped). A no-data answer (HTTP 404) is returned as {no_data: true} — not an error. Prefer get_core_web_vitals for a ready-made assessment; use…

ParameterTypeDescription
form_factorstringDevice class filter. Omit for the aggregated record across all devices. tablet traffic is tiny and usually has no data.
metricsarrayMetric names to return; omit for all available metrics. Timings are integer milliseconds; cumulative_layout_shift is a string-encoded double. form_factors is only returned when form_factor is NOT set.
originstringSite origin — scheme + host only, e.g. https://example.com (no path, no trailing slash). Aggregates real-user data across ALL pages of the site. Mutually exclusive with `url`. http/https and www/non…
urlstringA specific page URL, e.g. https://example.com/pricing/. Mutually exclusive with `origin`. Pass the final post-redirect URL (the API does not follow redirects); fragments and query params are stripped…

query_history_record CrUX weekly timeseries (raw)

Returns the weekly CrUX timeseries for an origin or URL (raw API response, updated Mondays ~04:00 UTC): up to 40 collection periods, each a 28-day rolling window. Per metric: `histogramTimeseries` (bins with `densities` arrays), `percentilesTimeseries.p75s` and `fractionTimeseries`; all series align with `record.collectionPeriods`. Ineligible periods appear as null p75s and "NaN" densities — tolerate non-numeric entries. A no-data answer (HTTP 404) is returned as {no_data: true}. Prefer get_cwv_trend for a cleaned p75 trend.

ParameterTypeDescription
collection_period_countintegerHow many weekly collection periods to return (1..40; API default 25).
form_factorstringDevice class filter. Omit for the aggregated record across all devices. tablet traffic is tiny and usually has no data.
metricsarrayMetric names to return; omit for all available metrics. Timings are integer milliseconds; cumulative_layout_shift is a string-encoded double. form_factors is only returned when form_factor is NOT set.
originstringSite origin — scheme + host only, e.g. https://example.com (no path, no trailing slash). Aggregates real-user data across ALL pages of the site. Mutually exclusive with `url`. http/https and www/non…
urlstringA specific page URL, e.g. https://example.com/pricing/. Mutually exclusive with `origin`. Pass the final post-redirect URL (the API does not follow redirects); fragments and query params are stripped…