Lighthouse Mcp

io.github.priyankark由 GitHub 账号 priyankark 发布v0.1.9更新于 Oct 26, 2026

MCP server for Google Lighthouse performance metrics

已验证STDIO仅桌面浏览器自动化开发者工具

概览

AI 生成的概览

封装 Google Lighthouse,让助手在本地审计网页的性能、无障碍、最佳实践与 SEO 评分。

可以做什么
  • 对指定网址运行完整的 Lighthouse 审计,可选择审计类别、移动端或桌面端模拟以及网络限速
  • 仅获取某个网址的性能评分,可选移动端或桌面端
  • 返回被审计页面的评分与各项指标
适用场景
适合需要让助手检查页面加载速度或无障碍情况、对比移动端与桌面端结果,或在开发网站时快速取得性能评分的场景。
运行要求
通过 npx 或全局 npm 安装以 stdio 在本地运行;需要 Node.js 22.19 或更高版本,以及本机安装的 Chrome/Chromium 浏览器。未声明需要账号、API 密钥或环境变量。
安装前请注意
审计会在真实浏览器中加载目标页面,页面自身的请求会发往网络。默认允许访问回环地址;可设置 AUDIT_ALLOW_LOOPBACK=false 加以阻止,并且只审计你信任其访问本机服务的页面。审计一次只运行一个,超时时间为 120 秒。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Lighthouse Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

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

Option 1: From MCP Registry (Recommended)

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:

bash
npx lighthouse-mcp

Option 3: Global Installation

Install the package globally from npm:

bash
npm install -g lighthouse-mcp

Then run it:

bash
lighthouse-mcp

Option 4: Local Development

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

MCP Configuration

When installed via npm (global or npx)

Add the following to your MCP settings configuration file:

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

When using local development version

Add the following to your MCP settings configuration file:

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

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

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

  • Node.js 22.19+
  • Chrome/Chromium browser (for Lighthouse)

Endorsements

[图片]

Security

Chrome runs with its sandbox enabled. Localhost, IPv4 loopback, and IPv6 loopback remain supported by default. Private, link-local, cloud metadata, and other non-public destinations are blocked, including requests made by redirects and page resources. Connections use validated IP addresses to prevent DNS rebinding. Because loopback access is intentional, audit only pages you trust to access services on your own machine. For hostile sites, use a separate environment with network isolation.

Audits are limited to one at a time and time out after 120 seconds. Chrome and the audit proxy are cleaned up after success or failure.

Public-only audits

Set AUDIT_ALLOW_LOOPBACK=false to reject loopback destinations as well as private and metadata addresses. Hosted workers must use this setting and infrastructure egress isolation. Local development keeps loopback access by default.

Maintainer CI and releases

GitHub Actions runs the build, network and release-policy tests, npm security audit, and real Chrome smoke tests on the minimum supported Node version and Node 24. Node 24 also installs the npm tarball in a clean temporary project and checks its executable, dependencies, MCP version, and browser audits.

Every push to main runs the release pipeline. When package files change, it automatically increments the patch version (or honors a larger version already committed), synchronizes package metadata, repeats validation, commits and tags the release, publishes to npm with provenance, and creates a GitHub release. Changes limited to documentation, tests, or workflows do not publish a new version. Runtime server versions come from package.json.

Dependabot checks npm and GitHub Actions weekly. A successful PR CI run automatically merges npm updates only when all existing changed dependencies are stable patch/minor upgrades and only package.json / package-lock.json changed. Major upgrades, 0.x minor upgrades, downgrades, prereleases, and GitHub Actions changes require review. The merge job runs only trusted code from main, verifies the tested PR head, and explicitly dispatches publishing after a bot merge.

npm publishing uses the npm GitHub environment and an npm trusted publisher for priyankark/lighthouse-mcp, workflow publish.yml, environment npm, with direct publishing allowed. No npm token is stored in GitHub. The environment accepts deployments only from main.

To retry a failed release, rerun the Publish workflow or run ./release.sh. The pipeline reuses an unpublished version and skips an already published, unchanged package. If a reserved release tag points to different code, it stops rather than overwriting that version. For a breaking change, update package.json and package-lock.json to the intended major/minor version in the reviewed PR before merging.

来源:README.md,提交 d736855

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.9最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分