Provides comprehensive web performance analysis through Google Lighthouse, including Core Web Vitals metrics, accessibility audits, SEO analysis, and actionable optimization recommendations with support for critical request chain analysis and unused code detection.
Lighthouse MCP (Model Context Protocol)
A comprehensive web application performance analysis toolset integrating Google Lighthouse with Model Context Protocol (MCP), providing structured analysis capabilities accessible to AI assistants and automation tools.
๐ Overview
This project provides Google Lighthouse's powerful analysis capabilities through MCP (Model Context Protocol), enabling AI assistants to automatically detect, diagnose, and suggest improvements for website performance issues.
Key Features
๐๏ธ Three-Layer Architecture: Clear separation of concerns with Collection (L1) โ Analysis (L2) โ Intelligence (L3)
๐ Comprehensive Performance Analysis: Detailed analysis of all metrics including Core Web Vitals
๐ฏ Advanced Problem Detection: Automatic identification and prioritization of performance issues
๐ฐ Performance Budget Management: Target tracking and violation detection
๐ Pattern Recognition: Identification of common issues across multiple sites
๐ค MCP Integration: Standardized interface for AI assistants and automation tools
โ Complete Test Coverage: Quality assurance through unit, integration, and E2E tests
๐ Quick Start
Installation
Basic Usage
๐๏ธ Architecture
Three-Layer Design
L1 - Collection Layer
Foundation layer that directly executes Lighthouse and collects raw data:
l1_collect_single
: Execute Lighthouse analysis on a single URLl1_collect_multi
: Parallel analysis of multiple URLsl1_collect_comparative
: Collect data for comparative analysisl1_get_report
: Retrieve saved reportsl1_list_reports
: List available reports
L2 - Analysis Layer
Analyzes collected data and provides structured insights:
l2_deep_analysis
: Comprehensive performance problem detectionl2_critical_chain
: Critical request chain analysisl2_critical_chain_report
: Detailed critical chain report generationl2_unused_code
: Detect and quantify unused JavaScript/CSSl2_third_party_impact
: Measure third-party script impactl2_progressive_third_party
: Progressive third-party blocking analysisl2_lcp_chain_analysis
: LCP element critical path analysisl2_score_analysis
: Systematic score and improvement analysisl2_weighted_issues
: Priority ranking through weighted analysisl2_patterns
: Performance pattern detection
L3 - Intelligence Layer
Provides advanced interpretation and strategic recommendations:
l3_action_plan_generator
: Generate actionable improvement plansl3_performance_budget
: Performance budget management and violation detectionl3_pattern_insights
: Pattern insights from multiple analysis results
๐ง Available Tools
Primary Analysis Tools
Tool Name | Detectable Issues | Primary Use Case |
| LCP delays, CLS issues, TBT increase, unused resources | Comprehensive problem diagnosis |
| Render-blocking resources, request chains | Load order optimization |
| Unused CSS/JS, dead code | Bundle size reduction |
| Third-party impact, ad/analytics load | External dependency optimization |
| LCP bottlenecks, image optimization opportunities | LCP improvement strategy |
| Prioritized actions, implementation guide | Improvement planning |
Problem Detection Capabilities
This toolset can automatically detect:
Core Web Vitals
LCP > 4s delay detection and root cause analysis
CLS > 0.25 visual instability
FID/INP > 300ms responsiveness issues
Resource Optimization
Unused CSS/JavaScript (up to 90% reduction possible)
Render-blocking resources
Inefficient caching strategies
Third-Party Impact
Google Analytics, Facebook SDK impact measurement
Ad network load analysis
Progressive blocking impact assessment
๐ป Programmatic Usage
TypeScript/JavaScript
MCP Usage
๐งช Testing
The project includes a comprehensive test suite:
Test Fixtures
HTML files in test/fixtures/problem-cases/
reproduce actual problems:
slow-lcp.html
- LCP delay detection testhigh-cls.html
- CLS problem detection testthird-party-heavy.html
- Third-party impact testunused-code-heavy.html
- Unused code detection testcpu-intensive-dom-css.html
- High CPU load DOM/CSS test
๐ CI/CD
Automated CI/CD pipeline with GitHub Actions:
๐ Project Structure
๐ Documentation
Analysis Capabilities - Detailed analysis capabilities of each tool
Problem-Tool Matrix - Guide for selecting appropriate tools by problem
Tool Layers - Detailed L1/L2/L3 architecture
MCP Tools Catalog - Complete tool catalog
CLAUDE.md - Developer architecture guide
๐ ๏ธ Development
Setup
Development Commands
๐ Environment Variables
๐ Performance Improvement Results
Typical improvements achieved using this toolset:
LCP Improvement: 8.5s โ 2.1s (75% reduction)
Unused Code Reduction: 840KB โ 120KB (85% reduction)
Third-Party Impact: TBT 1200ms โ 300ms (75% reduction)
Performance Score: 35 โ 92 points
๐ค Contributing
Pull requests are welcome! Please follow these guidelines:
Create an issue to propose features or fixes
Create a feature branch (
git checkout -b feature/amazing-feature
)Add tests (maintain 90%+ coverage)
Pass type checking and linting (
pnpm typecheck && pnpm lint
)Create a pull request
๐ License
MIT License - See LICENSE file for details
๐ฅ Author
mizchi (@mizchi)
๐ Acknowledgments
Google Lighthouse Team
Puppeteer Developers
MCP (Model Context Protocol) Specification Contributors
All Contributors
Note: This project is actively under development. Features and APIs may change.
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Enables AI models to perform Google Lighthouse website performance analysis, including Core Web Vitals, accessibility, SEO audits, and actionable optimization recommendations. Provides comprehensive web performance insights through natural language interactions.