Logo de Lighthouse MCP 服务器

Lighthouse MCP 服务器

Comunidade
danielsogl

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

Publicado pordanielsogl
Repositóriolighthouse-mcp-server
IdiomaTypeScript
Forks
13
Estrelas
71
Ferramentas disponíveis
0
Tipo de transportestdio
Categorias
LicençaMIT
Links
  • Conecte ferramentas a fluxos de trabalho de IA

    Lighthouse MCP 服务器 disponibiliza recursos MCP que podem ser usados por clientes e agentes de IA compatíveis.

  • 0 ferramentas disponíveis

    Confira abaixo as ações que podem ser chamadas, incluindo nomes e descrições quando fornecidos pelo servidor.

  • Configuração pronta para copiar

    Use os exemplos de instalação para configurar este servidor no seu cliente MCP preferido.

  • Indicadores da comunidade de código aberto

    71 estrelas e 13 forks no repositório vinculado.

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, INP, CLS monitoring with threshold checking
  • 🎯 Performance Budgets: Custom performance thresholds and budget monitoring
  • 🤖 Agentic Browsing: Lighthouse 13 audits for how well a page serves AI agents (WebMCP tools, agent accessibility tree, llms.txt)
  • 🧩 Structured Output: Every tool declares an outputSchema and returns validated structuredContent, so clients get typed data instead of a JSON string to parse
  • 📚 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:

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

Persistent Chrome Profiles (Login Sessions)

If you need authenticated sessions, launch with a persistent Chrome profile and run headed:

json
{
  "mcpServers": {
    "lighthouse": {
      "command": "npx",
      "args": [
        "@danielsogl/lighthouse-mcp@latest",
        "--profile-path",
        "<profile-path>",
        "--no-headless"
      ]
    }
  }
}

You can pass extra Chrome flags with --chrome-flag, for example --chrome-flag=--disable-gpu. If the flag value starts with -- and matches a known option name, prefer --chrome-flag=... to avoid parsing it as a top-level option. Profile mode disables Lighthouse's storage reset so cookies and local storage persist between runs. If --user-data-dir points to a missing directory, it will be created and treated as a fresh profile. Set --profile-path to the Profile Path shown in chrome://version (e.g. .../Default). Note: Chrome's remote debugging requires a non-default user data directory, so reuse a dedicated profile directory instead of the system default. You can also pass --user-data-dir + --profile-directory separately if you prefer. Attaching with --chrome-port alone does not preserve storage; include a profile flag to keep sessions.

CLI Options

Supported runtime flags for the MCP server:

  • --profile-path <path>: use the Profile Path from chrome://version (auto-derives user data dir + profile name)
  • --user-data-dir <path>: reuse a Chrome profile directory for persistent sessions
  • --profile-directory <name>: select a profile within the user data dir
  • --chrome-path <path>: explicit path to the Chrome/Chromium executable (overrides auto-detection; also respects the CHROME_PATH environment variable)
  • --chrome-flag <flag> or --chrome-flag=<flag>: pass through extra Chrome flags (repeatable)
  • --chrome-port <port> or --remote-debugging-port <port>: attach to an existing Chrome instance launched with remote debugging enabled
  • --headless: force headless mode
  • --no-headless: force headed mode

Logging

Lighthouse logs to stderr. The server keeps this at error so it does not flood your MCP client's logs; set LIGHTHOUSE_LOG_LEVEL to silent, info or verbose when debugging (for example when Chrome fails to launch).

bash
LIGHTHOUSE_LOG_LEVEL=verbose npx @danielsogl/lighthouse-mcp@latest

WSL2 / Custom Chrome Path

If the wrong Chrome binary is picked up (e.g. Windows Chrome instead of the Linux binary on WSL2), set the path explicitly:

bash
# Via CLI flag
npx @danielsogl/lighthouse-mcp@latest --chrome-path /usr/bin/google-chrome

# Via environment variable
CHROME_PATH=/usr/bin/google-chrome npx @danielsogl/lighthouse-mcp@latest

In your MCP config:

json
{
  "mcpServers": {
    "lighthouse": {
      "command": "npx",
      "args": ["@danielsogl/lighthouse-mcp@latest", "--chrome-path", "/usr/bin/google-chrome"]
    }
  }
}

E2E Smoke Test (Profile)

Run a real audit with a persistent profile (use an existing profile directory and log in once if needed):

bash
npm run smoke:profile -- --url https://example.com \
  --profile-path "<profile-path>" \
  --no-headless

E2E Smoke Test (Attach to Existing Chrome)

Start Chrome with remote debugging enabled:

bash
/path/to/GoogleChromeExecutable \
  --remote-debugging-port=9222 \
  --user-data-dir /path/to/chrome-profile

Replace /path/to/GoogleChromeExecutable with your platform's Chrome/Chromium binary path.

Then attach Lighthouse to that instance:

bash
npm run smoke:profile -- --url https://example.com --chrome-port 9222

To preserve storage when attaching, pass the profile path so Lighthouse keeps cookies/local storage:

bash
npm run smoke:profile -- --url https://example.com \
  --chrome-port 9222 \
  --profile-path "<profile-path>"

Install in VS Code

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

bash
# 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 MCP Server

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

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

Install in Windsurf

Follow the Windsurf MCP documentation. Use the following configuration:

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

Install in Claude Desktop

Follow the MCP install guide, use the following configuration:

json
{
  "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?

⚡ 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", "agentic-browsing")
  • 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", "agentic-browsing"])
  • threshold: Custom thresholds for metrics (e.g., {"lcp": 2.5, "inp": 200, "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", "csp", "hsts", "origin-isolation", "clickjacking", "trusted-types", "third-party-cookies", "deprecations"])

💡 Usage Examples

Basic Performance Audit

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

Core Web Vitals Analysis

javascript
// 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,
      "inp": 200,
      "cls": 0.1
    }
  }
}

Security Assessment

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

Resource Optimization

javascript
// 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:

javascript
// 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

javascript
// 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:

🧪 Testing

bash
npm run test:run      # unit tests
npm run test:coverage # unit tests with coverage
npm run test:e2e      # end-to-end tests

The end-to-end suite builds the server, launches it over stdio with a real MCP client, and runs actual Lighthouse audits against a fixture page served on loopback. It requires Chrome to be installed; set CHROME_PATH if it lives somewhere non-standard.

🤝 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

Instalação

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

Use o MCP de Lighthouse MCP 服务器 com vários modelos de IA

O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho. Assim, após conectar Lighthouse MCP 服务器, é possível usá-lo com diferentes modelos de IA no TypingMind, em vez de configurá-lo separadamente para cada modelo. Este MCP é executado localmente no seu dispositivo por meio do conector MCP do TypingMind.

Guia de configuração para usar o conector local

Use esta opção quando o servidor MCP precisar acessar arquivos locais, aplicativos ou recursos privados no seu computador.

1

Abra as configurações de MCP

No TypingMind, vá até Configurações, Configurações avançadas e depois Model Context Protocol e selecione Configurar conector.

  1. Abra o TypingMind no navegador.
  2. Clique no ícone de Ajustes.
  3. Acesse Configurações avançadas.
  4. Abra a seção Model Context Protocol.
  5. Clique em Configurar conector e selecione Este dispositivo.
Tela de configuração do conector MCP do TypingMind com a opção Este dispositivo selecionada
2

Execute o comando do conector

Selecione Este dispositivo, copie o comando do TypingMind e execute-o no Terminal. Mantenha o processo em execução enquanto usa o MCP.

  1. Copie o comando de configuração exibido pelo TypingMind.
  2. Abra o Terminal no macOS ou o Windows Terminal no Windows.
  3. Cole e execute o comando.
  4. Autorize a instalação do pacote se o Terminal pedir confirmação para continuar.
  5. Mantenha o processo em execução na janela do Terminal enquanto usa as ferramentas MCP.
3

Adicione Lighthouse MCP 服务器 como servidor

Quando o status do conector for Pronto, clique em Editar e cole a configuração do servidor MCP.

  1. Aguarde até que o status do conector mostre Pronto.
  2. Clique em Editar.
  3. Cole a configuração do servidor MCP de Lighthouse MCP 服务器.
  4. Salve a lista de servidores.
  5. Atualize para confirmar se o conector ainda está pronto para uso.
Configurações de MCP do TypingMind mostrando um servidor ativo e o botão Editar
{
  "mcpServers": {
    "lighthouse-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@danielsogl/lighthouse-mcp"
      ]
    }
  }
}
4

Use a conexão com diferentes modelos

Salve a lista de servidores, abra Plugins, ative as ferramentas MCP de Lighthouse MCP 服务器, selecione qualquer modelo de IA compatível no TypingMind e use as ferramentas no chat ou atribua-as a um agente de IA.

  1. Abra a página Plugins no TypingMind.
  2. Ative as ferramentas MCP de Lighthouse MCP 服务器.
  3. Inicie um chat e escolha o modelo de IA que deseja usar.
  4. Use as ferramentas MCP no chat ou atribua-as a um agente de IA.
  5. Mude para outro modelo de IA sempre que necessário, sem reconectar o MCP.
Chat do TypingMind usando ferramentas MCP ativadas com um modelo de IA selecionado
Pode usar Lighthouse MCP 服务器 para me ajudar nesta tarefa?
Lighthouse MCP 服务器
Claro. Já li.
Veja o que encontrei usando Lighthouse MCP 服务器.

Perguntas frequentes

Para que serve o servidor MCP Lighthouse MCP 服务器?

Lighthouse MCP 服务器 é um servidor MCP que permite que aplicativos de IA compatíveis se conectem a ferramentas externas e informações de contexto. No TypingMind, basta adicionar esse servidor MCP uma vez para disponibilizar suas ferramentas no seu espaço de trabalho com IA.

Posso usar o MCP Lighthouse MCP 服务器 com vários modelos de IA no TypingMind?

Sim. O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho, permitindo usar Lighthouse MCP 服务器 com diferentes modelos de IA, como Claude, ChatGPT, Gemini ou outros modelos configurados no TypingMind, sem configurar o servidor MCP separadamente para cada modelo.

Por que usar o MCP Lighthouse MCP 服务器 com o TypingMind?

O TypingMind é uma das melhores interfaces de chat com LLMs porque reúne vários modelos de IA, prompts, plugins, agentes de IA, chaves de API e ferramentas MCP em um só espaço de trabalho. Com Lighthouse MCP 服务器 conectado, é possível usar suas ferramentas MCP nos seus modelos preferidos e manter seu fluxo de trabalho de chat organizado no TypingMind.

Como conecto o MCP Lighthouse MCP 服务器 ao TypingMind?

Lighthouse MCP 服务器 funciona por meio do conector MCP local do TypingMind. Essa é a melhor opção quando o servidor MCP precisa acessar arquivos locais, apps de desktop, ferramentas de linha de comando ou recursos privados no seu computador.

Quais ferramentas o MCP Lighthouse MCP 服务器 oferece no TypingMind?

Lighthouse MCP 服务器 disponibiliza recursos MCP que podem ser ativados na página Plugins do TypingMind e usados no chat ou atribuídos a agentes de IA.

Preciso compartilhar minhas chaves de API com o TypingMind para usar o MCP Lighthouse MCP 服务器?

Não. O TypingMind prioriza o uso local e permite manter seus provedores de modelos, chaves de API, prompts e configuração MCP sob seu controle. Se Lighthouse MCP 服务器 exigir autenticação, adicione os cabeçalhos, as configurações OAuth ou a configuração local exigidos por esse servidor MCP ao criar a conexão.

Servidores MCP relacionados

Ver todos

Crie seu próprio espaço de IA agora

Inscreva-se na nossa newsletter para receber novidades sobre recursos e futuros sorteios 👇