lighthouse-mcp

lighthouse-mcp

Enables running Lighthouse web performance audits via MCP, providing Core Web Vitals, performance scores, and optimization suggestions for single or multiple URLs.

Category
Visit Server

README

Lighthouse MCP Server

通过 MCP 协议在 Claude 中直接运行 Lighthouse 网页性能审计,获取 Core Web Vitals、性能评分和优化建议。

功能

提供两个 MCP 工具:

audit_url — 单页审计

对一个 URL 运行 Lighthouse,返回:

  • Core Web Vitals: LCP、CLS、INP
  • 其他性能指标: FCP、TTFB、Speed Index、TBT
  • 分类评分: Performance / Accessibility / SEO / Best Practices (0-100)
  • 优化建议: 按预计可节省时间排序的改进机会

audit_batch — 批量审计

对多个 URL(最多 10 个)并行运行 Lighthouse,返回每个页面的核心指标,适合跨页面对比。

前置条件

  • Node.js >= 18
  • Google Chrome — Lighthouse 依赖 Chrome 运行,chrome-launcher 会自动查找。macOS 上安装 Chrome 即可。

安装

git clone <repo-url>/lighthouse-mcp.git
cd lighthouse-mcp
npm install
npm run build

在 Claude Code 中使用

在 ~/.claude/claude_desktop_config.json(或对应配置文件)中添加:

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

配置后重启 Claude Code,即可使用:

帮我审计一下 https://example.com 的性能
对比这三个页面的性能: https://a.com https://b.com https://c.com
用桌面模式审计 https://example.com

输出示例

{
  "url": "https://example.com",
  "device": "mobile",
  "scores": { "performance": 85 },
  "coreWebVitals": {
    "lcp_ms": 2500,
    "cls": 0.1,
    "inp_ms": 150
  },
  "otherMetrics": {
    "fcp_ms": 1800,
    "ttfb_ms": 200,
    "speedIndex_ms": 3000,
    "tbt_ms": 200
  },
  "opportunities": [
    { "title": "Reduce unused JavaScript", "potentialSavingsMs": 500 }
  ]
}

技术栈

  • @modelcontextprotocol/sdk — MCP 协议实现
  • lighthouse — Google Chrome 网页审计工具
  • chrome-launcher — 无头 Chrome 启动
  • TypeScript + ESM

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured