Skip to main content
Glama

Lighthouse MCP

Lighthouse MCP Server

A Model Context Protocol (MCP) server that provides comprehensive web performance auditing and analysis capabilities using Google Lighthouse. This server enables LLMs and AI agents to perform detailed website performance assessments, accessibility audits, SEO analysis, security checks, and Core Web Vitals monitoring.

🌟 Key Features

  • 🚀 Performance Analysis: Complete Lighthouse audits with Core Web Vitals, performance scores, and optimization recommendations
  • ♿ Accessibility Audits: WCAG compliance checking and accessibility score analysis
  • 🔍 SEO Analysis: Search engine optimization audits and best practice recommendations
  • 🔒 Security Assessment: HTTPS, CSP, and security vulnerability scanning
  • 📊 Resource Analysis: JavaScript, CSS, image, and font optimization opportunities
  • 📱 Mobile vs Desktop: Comparative analysis across devices with throttling options
  • ⚡ Core Web Vitals: LCP, FID, CLS monitoring with threshold checking
  • 🎯 Performance Budgets: Custom performance thresholds and budget monitoring
  • 📚 Reference Resources: Built-in guidelines and best practices for web performance, accessibility, SEO, and security

🛠️ Requirements

  • Node.js 22.0.0 or newer
  • Chrome/Chromium browser (automatically managed by Lighthouse)
  • VS Code, Cursor, Windsurf, Claude Desktop, or any other MCP client

🚀 Getting Started

Install the Lighthouse MCP server with your preferred client using one of the configurations below:

{ "mcpServers": { "lighthouse": { "command": "npx", "args": ["@danielsogl/lighthouse-mcp@latest"] } } }

Install in VS Code

You can also install the Lighthouse MCP server using the VS Code CLI:

# For VS Code code --add-mcp '{"name":"lighthouse","command":"npx","args":["-y","@danielsogl/lighthouse-mcp@latest"]}' # For VS Code Insiders code-insiders --add-mcp '{"name":"lighthouse","command":"npx","args":["-y","@danielsogl/lighthouse-mcp@latest"]}'

After installation, the Lighthouse MCP server will be available for use with your GitHub Copilot agent in VS Code.

Install in Cursor

Go to Cursor SettingsMCPAdd new MCP Server. Name it "lighthouse", use command type with the command npx @danielsogl/lighthouse-mcp@latest:

{ "mcpServers": { "lighthouse": { "command": "npx", "args": ["@danielsogl/lighthouse-mcp@latest"] } } }

Install in Windsurf

Follow the Windsurf MCP documentation. Use the following configuration:

{ "mcpServers": { "lighthouse": { "command": "npx", "args": ["@danielsogl/lighthouse-mcp@latest"] } } }

Install in Claude Desktop

Follow the MCP install guide, use the following configuration:

{ "mcpServers": { "lighthouse": { "command": "npx", "args": ["@danielsogl/lighthouse-mcp@latest"] } } }

🔧 Available Tools

The Lighthouse MCP server provides the following tools for comprehensive web analysis:

🏁 Audit Tools

ToolDescriptionParameters
run_auditRun a comprehensive Lighthouse auditurl, categories?, device?, throttling?
get_accessibility_scoreGet accessibility score and recommendationsurl, device?, includeDetails?
get_seo_analysisGet SEO analysis and recommendationsurl, device?, includeDetails?
check_pwa_readinessCheck Progressive Web App readinessurl, device?, includeDetails?

⚡ Performance Tools

ToolDescriptionParameters
get_performance_scoreGet overall performance scoreurl, device?
get_core_web_vitalsGet Core Web Vitals metricsurl, device?, includeDetails?, threshold?
compare_mobile_desktopCompare performance across devicesurl, categories?, throttling?, includeDetails?
check_performance_budgetCheck against performance budgetsurl, device?, budget
get_lcp_opportunitiesFind LCP optimization opportunitiesurl, device?, includeDetails?, threshold?

🔍 Analysis Tools

ToolDescriptionParameters
find_unused_javascriptFind unused JavaScript codeurl, device?, minBytes?, includeSourceMaps?
analyze_resourcesAnalyze all website resourcesurl, device?, resourceTypes?, minSize?

🔒 Security Tools

ToolDescriptionParameters
get_security_auditPerform comprehensive security auditurl, device?, checks?

💬 Available Prompts

The Lighthouse MCP server includes reusable prompts that help LLMs provide structured analysis and recommendations:

📊 Analysis Prompts

PromptDescriptionParameters
analyze-audit-resultsAnalyze Lighthouse audit resultsauditResults, focusArea?
compare-auditsCompare before/after audit resultsbeforeAudit, afterAudit, changesImplemented?
optimize-core-web-vitalsGet Core Web Vitals optimization recommendationscoreWebVitals, framework?, constraints?
optimize-resourcesGet resource optimization recommendationsresourceAnalysis, loadingStrategy?, criticalUserJourneys?

📚 Available Resources

The Lighthouse MCP server provides built-in reference resources with essential guidelines and best practices:

ResourceDescriptionURI
core-web-vitals-thresholdsCore Web Vitals performance thresholdslighthouse://performance/core-web-vitals-thresholds
optimization-techniquesPerformance optimization techniques and impactlighthouse://performance/optimization-techniques
wcag-guidelinesWCAG 2.1 accessibility guidelines and issueslighthouse://accessibility/wcag-guidelines
seo-best-practicesSEO best practices and optimization opportunitieslighthouse://seo/best-practices
security-best-practicesWeb security best practices and vulnerabilitieslighthouse://security/best-practices
budget-guidelinesPerformance budget recommendations by site typelighthouse://performance/budget-guidelines
categories-scoringLighthouse audit categories and scoring methodslighthouse://audits/categories-scoring
framework-guidesFramework-specific optimization guideslighthouse://frameworks/optimization-guides

🎯 Strategy Prompts

PromptDescriptionParameters
create-performance-planGenerate comprehensive performance improvement plancurrentMetrics, targetGoals?, timeframe?
create-performance-budgetCreate custom performance budget recommendationscurrentMetrics, businessGoals?, userBase?
seo-recommendationsGenerate SEO improvement recommendationsseoAudit, websiteType?, targetAudience?
accessibility-guideCreate accessibility improvement guideaccessibilityAudit, complianceLevel?, userGroups?

🔧 Prompt Parameter Details

  • auditResults: JSON audit results from Lighthouse tools
  • focusArea: Specific category to focus on ("performance", "accessibility", "seo", "best-practices", "pwa")
  • beforeAudit / afterAudit: Lighthouse audit results before and after changes
  • changesImplemented: Description of changes made between audits
  • currentMetrics: Current performance metrics from audits
  • targetGoals: Specific performance targets or business goals
  • timeframe: Timeline for implementing improvements
  • framework: Frontend framework or technology stack
  • constraints: Technical or business constraints
  • websiteType: Type of website (e.g., e-commerce, blog, corporate)
  • targetAudience: Target audience or market information
  • complianceLevel: WCAG compliance level ("AA" or "AAA")
  • userGroups: Specific user groups to consider for accessibility

📋 Parameter Details

Common Parameters

  • url (required): The website URL to analyze
  • device: Target device ("desktop" or "mobile", default: "desktop")
  • includeDetails: Include detailed audit information (default: false)
  • throttling: Enable network/CPU throttling (default: false)

Specific Parameters

  • categories: Lighthouse categories to audit (["performance", "accessibility", "best-practices", "seo", "pwa"])
  • threshold: Custom thresholds for metrics (e.g., {"lcp": 2.5, "fid": 100, "cls": 0.1})
  • budget: Performance budget limits (e.g., {"performanceScore": 90, "largestContentfulPaint": 2500})
  • resourceTypes: Resource types to analyze (["images", "javascript", "css", "fonts", "other"])
  • minBytes: Minimum file size threshold for analysis (default: 2048)
  • checks: Security checks to perform (["https", "mixed-content", "csp", "hsts", "vulnerabilities"])

💡 Usage Examples

Basic Performance Audit

// Get overall performance score { "tool": "get_performance_score", "arguments": { "url": "https://example.com", "device": "mobile" } }

Core Web Vitals Analysis

// Check Core Web Vitals with custom thresholds { "tool": "get_core_web_vitals", "arguments": { "url": "https://example.com", "device": "mobile", "includeDetails": true, "threshold": { "lcp": 2.5, "fid": 100, "cls": 0.1 } } }

Security Assessment

// Comprehensive security audit { "tool": "get_security_audit", "arguments": { "url": "https://example.com", "checks": ["https", "csp", "hsts"] } }

Resource Optimization

// Find optimization opportunities { "tool": "analyze_resources", "arguments": { "url": "https://example.com", "resourceTypes": ["images", "javascript"], "minSize": 1024 } }

Using Reference Resources

Access built-in guidelines and best practices:

// Get Core Web Vitals thresholds { "resource": { "uri": "lighthouse://performance/core-web-vitals-thresholds" } } // Access WCAG accessibility guidelines { "resource": { "uri": "lighthouse://accessibility/wcag-guidelines" } } // Get framework-specific optimization guides { "resource": { "uri": "lighthouse://frameworks/optimization-guides" } }

Using Prompts for Analysis

// Analyze audit results with focused recommendations { "prompt": "analyze-audit-results", "arguments": { "auditResults": "{...lighthouse audit json...}", "focusArea": "performance" } } // Create a performance improvement plan { "prompt": "create-performance-plan", "arguments": { "currentMetrics": "{...current performance metrics...}", "targetGoals": "Achieve 90+ performance score and sub-2s LCP", "timeframe": "3 months" } } // Compare before/after audit results { "prompt": "compare-audits", "arguments": { "beforeAudit": "{...before audit results...}", "afterAudit": "{...after audit results...}", "changesImplemented": "Implemented lazy loading and image optimization" } }

🎯 Use Cases

  • Performance Monitoring: Automated performance tracking and Core Web Vitals monitoring
  • Accessibility Compliance: WCAG 2.1 compliance checking and remediation guidance
  • SEO Optimization: Technical SEO audits and search engine optimization recommendations
  • Security Assessment: Vulnerability scanning and security best practice validation
  • Resource Optimization: Bundle analysis and optimization opportunity identification
  • Performance Budgets: Automated performance budget monitoring and alerting
  • CI/CD Integration: Automated quality gates and performance regression detection

🏗️ Architecture

The server is built using:

🤝 Contributing

Contributions are welcome! Please read our Contributing Guide for details on:

  • Code style and standards
  • Testing requirements
  • Pull request process
  • Development setup

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

🔒 Security

For security issues, please see our Security Policy.

📞 Support

🙏 Acknowledgments

  • Google Lighthouse team for the excellent auditing engine
  • Anthropic for the Model Context Protocol specification
  • The open source community for continuous inspiration and contributions

Built with ❤️ by Daniel Sogl

Related MCP Servers

View all related MCP servers

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/danielsogl/lighthouse-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server