Sponsored by Deepsite.site

Lighthouse MCP Server

Created By
danielsogl8 months ago
MCP server that enables AI agents to perform comprehensive web audits using Google Lighthouse with 13+ tools for performance, accessibility, SEO, and security analysis.
Content

Lighthouse MCP Server

NPM Version License: MIT Node Version CI Coverage Sponsor

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

Install in VS Code

Install in VS Code Insiders

Manual VS Code Installation

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

Install in Cursor

Manual Cursor Installation

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

Install in Windsurf

Manual Windsurf Installation

Follow the Windsurf MCP documentation. Use the following configuration:

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

Install in Claude Desktop

Claude Desktop Installation

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

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
ChatWiseThe second fastest AI chatbot™
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Playwright McpPlaywright MCP server
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
Tavily Mcp
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
WindsurfThe new purpose-built IDE to harness magic
Amap Maps高德地图官方 MCP Server
DeepChatYour AI Partner on Desktop
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
CursorThe AI Code Editor
Serper MCP ServerA Serper MCP Server
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。