UNPKG

@danielsogl/lighthouse-mcp

Version:

A comprehensive Model Context Protocol (MCP) server that provides web performance auditing, accessibility testing, SEO analysis, security assessment, and Core Web Vitals monitoring using Google Lighthouse. Enables LLMs and AI agents to perform detailed we

73 lines (72 loc) 2.7 kB
import * as chromeLauncher from "chrome-launcher"; import { LighthouseResult, LighthouseAuditResult } from "./types"; export declare function launchChrome(): Promise<chromeLauncher.LaunchedChrome>; export declare function getScreenEmulation(device: "desktop" | "mobile"): { mobile: boolean; width: 1350 | 360; height: 940 | 640; deviceScaleFactor: number; disabled: boolean; }; export declare function buildLighthouseOptions(port: number, device: "desktop" | "mobile", categories?: string[], throttling?: boolean): { logLevel: "info"; output: "json"; onlyCategories: string[] | undefined; port: number; formFactor: "desktop" | "mobile"; screenEmulation: { mobile: boolean; width: 1350 | 360; height: 940 | 640; deviceScaleFactor: number; disabled: boolean; }; throttling: { readonly rttMs: 150; readonly throughputKbps: 1638.4; readonly cpuSlowdownMultiplier: 4; } | { readonly rttMs: 0; readonly throughputKbps: number; readonly cpuSlowdownMultiplier: 1; }; }; export declare function runRawLighthouseAudit(url: string, categories?: string[], device?: "desktop" | "mobile", throttling?: boolean): Promise<LighthouseResult>; export declare function filterAuditsByCategory(lhr: LighthouseResult["lhr"], categoryKey: string): { id: string; title: string; description: string | undefined; score: number | null; scoreDisplayMode: string | undefined; displayValue: string | undefined; }[]; export declare function formatCategoryScores(lhr: LighthouseResult["lhr"]): Record<string, { title: string; score: number; description: string; }>; export declare function extractKeyMetrics(lhr: LighthouseResult["lhr"]): Record<string, { title: string; value: number; displayValue: string; score: number | null; }>; export declare function runLighthouseAudit(url: string, categories?: string[], device?: "desktop" | "mobile", throttling?: boolean): Promise<LighthouseAuditResult>; export declare function getDetailedAuditResults(url: string, category: string, device: "desktop" | "mobile"): Promise<{ lhr: { finalDisplayedUrl: string; fetchTime: string; lighthouseVersion: string; userAgent: string; categories: Record<string, import("./types").LighthouseCategory>; audits: Record<string, import("./types").LighthouseAudit>; }; audits: { id: string; title: string; description: string | undefined; score: number | null; scoreDisplayMode: string | undefined; displayValue: string | undefined; }[]; }>;