@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
66 lines (65 loc) • 2.12 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DEFAULTS = exports.BUDGET_METRIC_MAPPINGS = exports.SECURITY_AUDITS = exports.LCP_OPPORTUNITIES = exports.KEY_METRICS = exports.THROTTLING_CONFIG = exports.SCREEN_DIMENSIONS = exports.CHROME_FLAGS = void 0;
// Chrome configuration constants
exports.CHROME_FLAGS = ["--headless", "--no-sandbox", "--disable-dev-shm-usage"];
// Default screen dimensions
exports.SCREEN_DIMENSIONS = {
desktop: { width: 1350, height: 940 },
mobile: { width: 360, height: 640 },
};
// Throttling configuration
exports.THROTTLING_CONFIG = {
enabled: {
rttMs: 150,
throughputKbps: 1638.4,
cpuSlowdownMultiplier: 4,
},
disabled: {
rttMs: 0,
throughputKbps: 10 * 1024,
cpuSlowdownMultiplier: 1,
},
};
// Key performance metrics
exports.KEY_METRICS = [
"first-contentful-paint",
"largest-contentful-paint",
"total-blocking-time",
"cumulative-layout-shift",
"speed-index",
"interactive",
];
// LCP optimization opportunities
exports.LCP_OPPORTUNITIES = [
"render-blocking-resources",
"unused-css-rules",
"unused-javascript",
"modern-image-formats",
"uses-optimized-images",
"efficient-animated-content",
"preload-lcp-image",
"uses-text-compression",
];
// Security audit IDs
exports.SECURITY_AUDITS = [
"is-on-https",
"uses-http2",
"no-vulnerable-libraries",
"csp-xss",
"external-anchors-use-rel-noopener",
];
// Performance budget metric mappings
exports.BUDGET_METRIC_MAPPINGS = [
{ key: "firstContentfulPaint", metric: "first-contentful-paint", unit: "ms" },
{ key: "largestContentfulPaint", metric: "largest-contentful-paint", unit: "ms" },
{ key: "totalBlockingTime", metric: "total-blocking-time", unit: "ms" },
{ key: "cumulativeLayoutShift", metric: "cumulative-layout-shift", unit: "score" },
{ key: "speedIndex", metric: "speed-index", unit: "ms" },
];
// Default values
exports.DEFAULTS = {
LCP_THRESHOLD: 2.5,
MIN_UNUSED_JS_BYTES: 2048,
MIN_RESOURCE_SIZE_KB: 0,
};