lighthouse-mcp

lighthouse-mcp

Converts Lighthouse audits into prioritized implementation backlogs with evidence, suggested actions, and measurable acceptance criteria for coding agents.

Category
访问服务器

README

Lighthouse MCP

Turn Lighthouse audits into coding-agent tasks.

Run repeatable mobile and desktop Lighthouse audits from any compatible MCP client. Receive a bounded implementation backlog with evidence, suggested actions, and measurable acceptance criteria as structured JSON and Markdown.

npx -y mcp-server-lighthouse

Lighthouse MCP converts raw audits into an agent-ready backlog

Why Lighthouse MCP?

Raw Lighthouse output is designed for diagnostics, not autonomous implementation. It contains metrics, audit details, overlapping insights, and page-controlled text that a coding agent still needs to interpret.

Lighthouse MCP turns that output into a stable workflow:

  1. Run Lighthouse for mobile and desktop.
  2. Aggregate repeated runs and expose variability.
  3. Merge equivalent audits under canonical task IDs.
  4. Keep raw metrics out of the implementation backlog.
  5. Return at most ten prioritized tasks with evidence and acceptance criteria.

From Audit Noise To An Implementation Plan

Each prioritized task can include:

  • affected mobile and desktop profiles;
  • resource URLs or DOM selectors;
  • estimated time or byte savings;
  • deterministic suggested actions;
  • measurable acceptance criteria.

See the real CommaLabs JSON report and Markdown report.

Lighthouse results vary with browser version, hardware, network conditions, and page changes. The example demonstrates the report format, not a permanent performance score.

Install

Requirements

  • Node.js 20 or later
  • Google Chrome or Chromium

The package is an MCP server distributed through npm. Your MCP client starts it as a local stdio process:

npx -y mcp-server-lighthouse

Releases published through the trusted GitHub Actions workflow include npm provenance.

Claude Desktop

Open Claude Desktop's developer configuration and add:

{
  "mcpServers": {
    "lighthouse": {
      "command": "npx",
      "args": ["-y", "mcp-server-lighthouse"]
    }
  }
}

Restart Claude Desktop after saving the configuration. See the official MCP local-server guide.

Codex

Add the server with the Codex CLI:

codex mcp add lighthouse -- npx -y mcp-server-lighthouse

Or add it to ~/.codex/config.toml:

[mcp_servers.lighthouse]
command = "npx"
args = ["-y", "mcp-server-lighthouse"]

See the official Codex MCP documentation.

Other MCP Clients

For clients that accept the standard mcpServers JSON shape, use the Claude Desktop configuration above. Otherwise configure a local stdio server with:

  • command: npx
  • arguments: -y, mcp-server-lighthouse

Tool

analyze_website_performance

Runs Lighthouse against a public HTTP or HTTPS URL:

{
  "url": "https://example.com",
  "mode": "reliable"
}

mode is optional:

  • fast: one mobile run and one desktop run.
  • reliable: three runs per profile, median results, and variability ranges. This is the default.

What The Report Contains

  • Mobile and desktop Performance, Accessibility, Best Practices, and SEO scores
  • FCP, Speed Index, LCP, TBT, and CLS distributions
  • At most ten canonical prioritized issues
  • Up to ten evidence rows per issue
  • Resource URLs, DOM selectors, and console error evidence when available
  • Suggested actions and measurable acceptance criteria
  • Profile warnings when repeated runs vary materially
  • Canonical structuredContent validated by the advertised MCP outputSchema
  • Equivalent Markdown generated from the same canonical report

If only one profile produces enough successful runs, the report has status: "incomplete". It remains useful for diagnosis but must not be treated as a release baseline.

Coding-Agent Workflow

Treat structuredContent as the source of truth and Markdown as the execution summary:

Inspect the repository before mapping findings to files. Implement issues in prioritizedIssues order, preserve behavior and accessibility, run repository tests after each logical fix, then rerun Lighthouse in reliable mode and compare medians, ranges, and acceptance criteria. Do not claim completion from an incomplete baseline.

Security Model

The URL policy rejects:

  • protocols other than HTTP and HTTPS;
  • URLs containing embedded credentials;
  • localhost names;
  • loopback, private, link-local, multicast, reserved, and metadata-network IPs;
  • hostnames that resolve to any non-public address.

These checks reduce SSRF exposure but do not replace infrastructure controls. Production operators should run the server in an isolated environment and deny outbound access to private networks and cloud metadata services. Redirects and DNS rebinding are best controlled at the network boundary.

Page-controlled Lighthouse titles, descriptions, URLs, selectors, and snippets are sanitized and length-limited. Consumers must still treat them as untrusted evidence, not agent instructions.

Chrome sandboxing is enabled by default. Only isolated environments that cannot support it should set:

LIGHTHOUSE_CHROME_NO_SANDBOX=true

See SECURITY.md for reporting and deployment guidance.

Local Development

npm install
npm test
npm run check
npm run build

Run a real Chrome smoke audit:

npm run --silent smoke -- https://example.com fast
npm run --silent smoke -- https://example.com reliable

The smoke command writes canonical JSON to stdout and equivalent Markdown to stderr.

Troubleshooting

Chrome cannot be found

Install Google Chrome or Chromium in the environment running the MCP server.

Chrome fails to start in a container

Prefer a container configuration that supports the Chrome sandbox. Set LIGHTHOUSE_CHROME_NO_SANDBOX=true only when the surrounding container or virtual machine provides an equivalent isolation boundary.

The target URL is rejected

Only publicly routable HTTP and HTTPS targets are accepted. Local development sites and private network addresses are intentionally blocked.

Contributing

Focused issues and pull requests are welcome. Read CONTRIBUTING.md before changing the report contract, security policy, or MCP transport behavior.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选