Skip to main content
Glama

lighthouse-mcp

Lighthouse MCP 服务器

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

Lighthouse MCP 服务器截图

特征

  • 对任何 URL 运行全面的 Lighthouse 审核
  • 获取绩效分数和指标
  • 配置设备模拟(移动/桌面)
  • 控制网络限制
  • 选择特定的审计类别

安装

选项 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)

代言

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

允许 Cursor/Cline/GitHub Copilot 等 AI 助手使用 Google 的 Lighthouse 工具来测量您网页的性能指标。然后,您可以运行代理循环,让助手优化这些指标!

  1. 特征
    1. 安装
      1. 选项 1:使用 npx(推荐)
      2. 选项 2:全局安装
      3. 选项 3:本地开发
    2. MCP 配置
      1. 通过 npm(全局或 npx)安装时
      2. 使用本地开发版本时
    3. 可用工具
      1. 运行审计
      2. 获取绩效分数
    4. 示例用法
      1. 要求
        1. 代言

          Related MCP Servers

          • -
            security
            A
            license
            -
            quality
            Acts as a bridge between AI models and Google's PageSpeed Insights API, enabling detailed performance analysis of websites.
            Last updated -
            4
            4
            JavaScript
            MIT License
            • Linux
            • Apple
          • A
            security
            A
            license
            A
            quality
            Provides LLM Agents with AI-powered mentorship for code review, design critique, writing feedback, and brainstorming using the Deepseek API, enabling enhanced output in various development and strategic planning tasks.
            Last updated -
            5
            15
            TypeScript
            Apache 2.0
          • A
            security
            A
            license
            A
            quality
            Enables AI models to analyze webpage performance using the Google PageSpeed Insights API, providing real-time performance scores and improvement suggestions.
            Last updated -
            1
            7
            1
            JavaScript
            MIT License
          • A
            security
            A
            license
            A
            quality
            MCP-compatible server that enables AI assistants to interact with Lightdash analytics data, providing tools to list and retrieve projects, spaces, charts, dashboards, and metrics through a standardized interface.
            Last updated -
            13
            17
            17
            TypeScript
            MIT License

          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/priyankark/lighthouse-mcp'

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