PL

priyankark/lighthouse-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

220 stars 21 forks 质量 82 趋势 14MIT

priyankark/lighthouse-mcp 是从 https://github.com/priyankark/lighthouse-mcp. 导入的 MCP 服务器候选服务器。

概览

priyankark/lighthouse-mcp 是从 https://github.com/priyankark/lighthouse-mcp. 导入的 MCP 服务器候选服务器。

概述(AI 翻译)

这是一个环绕谷歌Lighthouse工具的MCP服务器,帮助衡量网页的各种性能指标。

特色

  • 对任何URL进行全面的Lighthouse审计
  • 获取绩效评分和指标
  • 配置设备仿真(移动端/桌面端)
  • 控制网络限速
  • 选择特定的审计类别

安装

选项1:来自MCP注册处(推荐)

该服务器可在模型上下文协议注册表中获取。使用您的MCP客户端或Claude桌面安装。

选项2:使用NPX

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

选项3:全局安装

从npm全局安装该包:

然后运行它:

选项4:地方开发

  1. 克隆此仓库

  2. 安装依赖:

  3. 建设项目:

  4. 运行服务器:

MCP 配置

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

在你的MCP设置配置文件中添加以下内容:

使用本地开发版本时

在你的MCP设置配置文件中添加以下内容:

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

可用工具

run_audit

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Lighthouse MCP Server

An MCP server that wraps around Google’s Lighthouse tool to help measure various performance metrics for web pages.

Features

  • Run comprehensive Lighthouse audits on any URL
  • Get performance scores and metrics
  • Configure device emulation (mobile/desktop)
  • Control network throttling
  • Select specific audit categories

Installation

This server is available in the Model Context Protocol Registry. Install it using your MCP client or Claude Desktop.

Option 2: Using npx

You can run the tool directly using npx without installation:

npx lighthouse-mcp

Option 3: Global Installation

Install the package globally from npm:

npm install -g lighthouse-mcp

Then run it:

lighthouse-mcp

Option 4: Local Development

  1. Clone this repository
  2. Install dependencies:
    npm install
    
  3. Build the project:
    npm run build
    
  4. Run the server:
    npm start
    

MCP Configuration

When installed via npm (global or npx)

Add the following to your MCP settings configuration file:

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

When using local development version

Add the following to your MCP settings configuration file:

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

Replace /absolute/path/to/lighthouse-mcp with the actual path to this project.

Available Tools

run_audit

Run a comprehensive Lighthouse audit on a URL.

Parameters:

  • url (required): The URL to audit
  • categories (optional): Array of categories to audit (defaults to all)
    • Options: “performance”, “accessibility”, “best-practices”, “seo”
  • device (optional): Device to emulate (defaults to “mobile”)
    • Options: “mobile”, “desktop”
  • throttling (optional): Whether to apply network throttling (defaults to true)

Example:

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

get_performance_score

Get just the performance score for a URL.

Parameters:

  • url (required): The URL to audit
  • device (optional): Device to emulate (defaults to “mobile”)
    • Options: “mobile”, “desktop”

Example:

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

Example Usage

Once the MCP server is configured, you can use it with Claude:

What's the performance score for example.com?

Claude will use the get_performance_score tool to analyze the website and return the results.

Requirements

在 GitHub 查看完整 README

安装

npx lighthouse-mcp
新手?先看 mcpskill.org 教程 →

配置

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