Skip to main content
Glama

Lighthouse MCP 服务器

MCP 服务器围绕 Google 的 Lighthouse 工具,帮助测量网页的各种性能指标。

Lighthouse MCP 服务器截图

特征

  • 对任何 URL 运行全面的 Lighthouse 审核

  • 获取绩效分数和指标

  • 配置设备模拟(移动/桌面)

  • 控制网络限制

  • 选择特定的审计类别

Related MCP server: LightScout MCP

安装

选项 1:使用 npx(推荐)

您可以直接使用 npx 运行该工具,无需安装:

npx lighthouse-mcp

选项 2:全局安装

全局安装包:

npm install -g lighthouse-mcp

然后运行它:

lighthouse-mcp

选项 3:本地开发

  1. 克隆此存储库

  2. 安装依赖项:

    npm install
  3. 构建项目:

    npm run build
  4. 运行服务器:

    npm start

MCP 配置

通过 npm(全局或 npx)安装时

将以下内容添加到您的 MCP 设置配置文件中:

{
  "mcpServers": {
    "lighthouse": {
      "command": "npx",
      "args": ["lighthouse-mcp"],
      "disabled": false,
      "autoApprove": []
    }
  }
}

使用本地开发版本时

将以下内容添加到您的 MCP 设置配置文件中:

{
  "mcpServers": {
    "lighthouse": {
      "command": "node",
      "args": ["/absolute/path/to/lighthouse-mcp/build/index.js"],
      "disabled": false,
      "autoApprove": []
    }
  }
}

将/absolute/path/to/lighthouse-mcp替换为此项目的实际路径。

可用工具

运行审计

对 URL 运行全面的 Lighthouse 审核。

参数:

  • url (必填):需要审核的 URL

  • categories (可选):要审核的类别数组(默认为全部)

    • 选项:“性能”、“可访问性”、“最佳实践”、“SEO”、“PWA”

  • device (可选):要模拟的设备(默认为“移动设备”)

    • 选项:“移动”、“桌面”

  • throttling (可选):是否应用网络节流(默认为 true)

例子:

{
  "url": "https://example.com",
  "categories": ["performance", "accessibility"],
  "device": "desktop",
  "throttling": false
}

获取绩效分数

仅获取 URL 的性能分数。

参数:

  • url (必填):需要审核的 URL

  • device (可选):要模拟的设备(默认为“移动设备”)

    • 选项:“移动”、“桌面”

例子:

{
  "url": "https://example.com",
  "device": "mobile"
}

示例用法

一旦 MCP 服务器配置完毕,您就可以将其与 Claude 一起使用:

What's the performance score for example.com?

Claude 将使用get_performance_score工具来分析网站并返回结果。

要求

  • Node.js 16+

  • Chrome/Chromium 浏览器(适用于 Lighthouse)

代言

Available Tools

2 tools
get_performance_scoreC

Get just the performance score for a URL

Inputs: url (required), device.

run_auditC

Run a Lighthouse audit on a URL

Inputs: url (required), device, categories, throttling.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 2 tools

    Disambiguation3/5

    Both tools relate to Lighthouse audits, but they have distinct purposes: run_audit executes a full audit, while get_performance_score focuses on retrieving only the performance metric. However, get_performance_score is essentially a subset of run_audit, so an agent might be unsure when to use one over the other without additional context.

    Naming Consistency5/5

    Both tool names follow a clear verb_noun pattern (run_audit, get_performance_score) with consistent snake_case and action-first style. The naming is predictable and unambiguous in structure.

    Tool Count2/5

    With only 2 tools, the server feels under-scoped for a Lighthouse MCP. A typical Lighthouse workflow would expect a richer set of operations, such as fetching full report details, comparing scores, or handling multiple categories. The minimal count limits utility and feels thin.

    Completeness2/5

    The tool surface is severely incomplete for a Lighthouse server. It only covers running an audit and extracting the performance score, omitting other standard audit categories (accessibility, SEO, best practices) and report retrieval. Agents would hit dead ends if they need any other Lighthouse data.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      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.
      4
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Core Web Vitals analysis powered by Lighthouse. Four tools: analyze a URL, compare two URLs, check against thresholds, or crawl an entire site. Works with Claude Code, Cursor, Windsurf, and any MCP-compatible AI tool.
      4
      12 npm
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to control and inspect a live Chrome browser for automated web debugging, performance analysis, and Lighthouse audits. It allows agents to capture screenshots, monitor network requests, and measure Core Web Vitals using plain-English prompts.
      Apache 2.0