pagespeed-insights-mcp

v2.5.0
io.github.ruslanlap/pagespeed-insights-mcp Checked 5 hours ago Published 1 day ago

Google PageSpeed Insights and CrUX: six workflow tools for web performance.

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

pagespeed_analyze_page Analyze a Page with Lighthouse

Run a PageSpeed Insights (or local Lighthouse for localhost/private URLs) analysis for one page. Start with report=summary for a health check; choose full for audits, recommendations for a prioritized fix list, audit for non-performance categories, or performance-map for Mermaid. Example: analyze a mobile product page and return the three most useful remediation steps. Returns a report plus structured result.

ParameterTypeDescription
url *stringPublic or local http(s) URL, for example https://example.com/products or http://localhost:3000.
budgetobjectOptional performance budget thresholds to validate against the measured result. Per-call values override the project's .pagespeed.json route budget and defaults.
categoriesarrayLighthouse categories to request.
enginestringAnalysis engine: auto (default, uses local Lighthouse for localhost/private URLs and Google PSI for public URLs), psi, or local.
extraHeadersobjectOptional HTTP headers (for example Authorization or Cookie) passed when running local Lighthouse against protected staging sites.
localestringBCP-47 locale such as en or uk-UA.
reportstringAmount and shape of returned insight.
responseFormatstringmarkdown is concise and readable; json is machine-readable and is also available as structuredContent.
runsintegerDistinct measurements. Use 3–5 when you need a median and spread.
strategystringLighthouse device profile. mobile is the default.
workspaceDirstringOptional local repository path to map Lighthouse selectors and asset filenames to source files.

pagespeed_diagnose_page Diagnose a Page Performance Problem

Inspect one page through exactly one diagnostic lens: visual, elements, network, javascript, images, render-blocking, or third-parties. Use after pagespeed_analyze_page identifies a problem; do not use it for a general score. Example: focus=render-blocking to identify CSS/JS delaying first render. Returns focused evidence (including native image screenshots when focus=visual).

ParameterTypeDescription
focus *stringThe single diagnostic lens to return.
url *stringPublic or local http(s) URL, for example https://example.com/products or http://localhost:3000.
enginestringAnalysis engine: auto (default, uses local Lighthouse for localhost/private URLs and Google PSI for public URLs), psi, or local.
extraHeadersobjectOptional HTTP headers (for example Authorization or Cookie) passed when running local Lighthouse against protected staging sites.
responseFormatstringmarkdown is concise and readable; json is machine-readable and is also available as structuredContent.
strategystringLighthouse device profile. mobile is the default.

pagespeed_get_field_data Get Chrome UX Report Field Data

Get real-user Core Web Vitals from Chrome UX Report, not Lighthouse lab measurements. Use scope=page for one URL; use scope=origin with a bare origin when the page has insufficient traffic. Set includeHistory=true to inspect multi-week historical trends. Returns p75 field metrics, distribution histograms, or a clear no-data result.

ParameterTypeDescription
url *stringPublic or local http(s) URL, for example https://example.com/products or http://localhost:3000.
formFactorstringCrUX device segment. ALL is valid only for scope=origin.
includeHistorybooleanFetch multi-week historical CrUX timeseries to spot when regressions began.
responseFormatstringmarkdown is concise and readable; json is machine-readable and is also available as structuredContent.
scopestringpage queries one URL; origin aggregates every page on the origin.

pagespeed_compare_pages Compare Pages or a Stored Baseline

Compare two pages now (mode=pages) or measure one page against its locally stored baseline (mode=baseline). Baseline mode records the first call; use runs=3 or more and rely on guaranteed deltas, not medians alone. Example: compare staging against production, or verify whether a deployed fix improved mobile LCP. replaceBaseline overwrites local baseline state.

ParameterTypeDescription
mode *stringpages compares url and against; baseline compares url to its saved measurement.
url *stringPublic or local http(s) URL, for example https://example.com/products or http://localhost:3000.
againststringSecond URL, required when mode=pages.
budgetobjectOptional performance budget thresholds to validate against the measured result. Per-call values override the project's .pagespeed.json route budget and defaults.
categoriesarrayLighthouse categories to request.
enginestringAnalysis engine: auto (default, uses local Lighthouse for localhost/private URLs and Google PSI for public URLs), psi, or local.
extraHeadersobjectOptional HTTP headers (for example Authorization or Cookie) passed when running local Lighthouse against protected staging sites.
replaceBaselinebooleanOnly baseline mode: overwrite the local stored baseline.
responseFormatstringmarkdown is concise and readable; json is machine-readable and is also available as structuredContent.
runsintegerUse 2–5 for baseline mode; 3 is recommended.
strategystringDevice profile; part of baseline identity.

pagespeed_analyze_batch Analyze Multiple Pages

Analyze 1–10 URLs in parallel (bounded by concurrency) and return per-page results plus success/failure counts. Use pagespeed_analyze_page for one URL or pagespeed_compare_pages for a direct comparison. Progress notifications are emitted when supported by the client.

ParameterTypeDescription
urls *arrayOne to ten http(s) URLs.
categoriesarrayLighthouse categories to request.
enginestringAnalysis engine: auto (default, uses local Lighthouse for localhost/private URLs and Google PSI for public URLs), psi, or local.
extraHeadersobjectOptional HTTP headers (for example Authorization or Cookie) passed when running local Lighthouse against protected staging sites.
localestringBCP-47 locale such as en or uk-UA.
reportstringPer-page result detail.
responseFormatstringmarkdown is concise and readable; json is machine-readable and is also available as structuredContent.
strategystringLighthouse device profile. mobile is the default.

pagespeed_clear_cache Clear Local PageSpeed Cache

Clear only this server process's in-memory PageSpeed response cache, forcing later analysis calls to contact Google again. Use after a deploy when a cached result is stale. It does not change the target website, files, or remote data; repeating the call is safe.