Skip to main content
Glama

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,返回每个页面的核心指标,适合跨页面对比。

Related MCP server: Lighthouse MCP

前置条件

  • 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

Available Tools

2 tools
audit_batchA

Run Lighthouse performance audits on multiple URLs in parallel. Returns a summary comparing Core Web Vitals across all URLs, plus detailed metrics for each.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlsYesArray of URLs to audit (max 10)
deviceNoDevice emulation mode (default: mobile)

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full transparency burden. It discloses parallel execution and the returned summary/detailed metrics, but does not mention potential side effects, time/resource costs, or concurrency limits beyond what the schema implies.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, gets straight to the point, and uses no filler. Every phrase adds value: what the tool runs, the parallel nature, and what it returns.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with two well-documented parameters and no output schema, the description covers the high-level return behavior (summary plus detailed metrics). It does not mention the device parameter default, but that is already in the schema, so this is reasonably complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and both parameters already have clear descriptions in the schema. The description adds context about Core Web Vitals, but does not enrich parameter meaning further, so the baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Run') and clearly identifies the resource ('Lighthouse performance audits') and scope ('multiple URLs in parallel'). It distinguishes itself from the sibling tool audit_url by emphasizing batch execution and comparative Core Web Vitals results.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'multiple URLs in parallel' clearly implies a batch use case and contrasts with a single-URL tool like audit_url. However, it does not explicitly state when not to use this tool or name audit_url as an alternative for single-URL audits.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

audit_urlA

Run a Lighthouse performance audit on a URL. Returns Core Web Vitals (LCP, CLS, INP), other performance metrics (FCP, TTFB, Speed Index, TBT), category scores (0-100), and a prioritized list of improvement opportunities with estimated savings.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL to audit, e.g. https://example.com
deviceNoDevice emulation mode (default: mobile)
categoriesNoAudit categories to run (default: performance only)

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It describes outputs in detail but does not disclose any side effects, prerequisites (e.g., URL accessibility), rate limits, or operational characteristics like execution time. The read-only nature of an audit is implied but not explicit.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single dense sentence that lists concrete return values without repetition or filler. It is front-loaded with the action ('Run a Lighthouse performance audit') and efficiently covers key details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the absence of an output schema and annotations, the description sufficiently enumerates return values (Core Web Vitals, metrics, category scores, improvement opportunities). It does not cover error cases, limitations, or output format, but for a single-URL audit tool this is largely adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema covers 100% of parameters with descriptions, so the baseline is 3. The description adds no new meaning to the device or categories parameters; it only mentions metrics and scores, which relate to output rather than parameter selection.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it runs a Lighthouse performance audit on a URL and enumerates the specific metrics returned (Core Web Vitals, performance metrics, category scores, improvement opportunities). It distinguishes itself from the sibling audit_batch by emphasizing a single URL.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'on a URL' gives clear context that this tool is for auditing a single URL, implicitly contrasting with audit_batch. However, it does not explicitly mention when to use audit_batch instead or provide exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updatesv1.0.0
    • First observedaudit_batch
    • First observedaudit_url

TDQS

A4.1/5.0

Scored across 2 tools

Disambiguation5/5

The two tools are clearly distinct: audit_url handles a single URL while audit_batch handles multiple URLs. There is no overlap or ambiguity in their purposes.

Naming Consistency5/5

Both tools use the consistent verb_noun pattern (audit_url, audit_batch), making the naming predictable and easy to follow.

Tool Count3/5

With only 2 tools, the server feels thin for a full-featured Lighthouse server, though the tools cover the core audit functionality. It is below the typical 3-15 range.

Completeness4/5

The tools cover both single and batch audits, returning comprehensive metrics and opportunities. Minor gaps include lack of custom configuration options (e.g., device, categories) or historical comparison, but these are not critical.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

  • Free technical-SEO audit MCP: crawl a site, run checks, return an LLM-ready shareable report.

  • Audit public webpages and supplied markup for HTML, CSS, SEO, JSON-LD, and link issues.

  • Browserless MCP — wraps the Browserless headless-Chromium REST API (browserless.io)

  • Your agent needs to crawl a site and say what is wrong with it — broken tags, duplicate content, pages nothing can index, resources that never load. **What you can ask for** • "Crawl this site and list every page with a duplicate title or missing description." • "Which pages are non-indexable, and why?" • "Run Lighthouse on these URLs and give me the failing audits." • "Show the internal link graph and the orphan pages." • "Give me this page's raw HTML and its microdata." **How to use it** Point any MCP client at https://mcp.aisa.one/seo-onpage/mcp and sign in with OAuth — there is no key to create or paste. 20 tools: submit a crawl and read its summary, pages, resources, links and waterfall; duplicate content and duplicate tags; keyword density; non-indexable and uncrawlable resources; parsed content, raw HTML, microdata, screenshots and Lighthouse. **Why this rather than the source** A crawler you drive from the agent, with the audit results as structured data rather than a PDF. **It is also a door to the rest** The same login reaches 26 sources and 580+ operations. Find the broken pages here, then ask the same agent what those pages used to rank for — without adding a second server. **What it costs** Finding and inspecting an operation is free. Running one is billed per call at API prices, with no seat and no monthly minimum, and every call takes max_price_usd so an agent cannot overspend by accident. **Where else it reaches** https://mcp.aisa.one/seo/mcp for all of it at once — rankings, keywords, backlinks, site health and AI-answer visibility across DataForSEO, Semrush and Ahrefs.

Related MCP Servers

  • A
    license
    B
    quality
    B
    maintenance
    MCP server that enables AI agents to perform comprehensive web audits using Google Lighthouse with 13+ tools for performance, accessibility, SEO, and security analysis.
    11
    1,125 npm
    71
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI models to perform Google Lighthouse website performance analysis, including Core Web Vitals, accessibility, SEO audits, and actionable optimization recommendations. Provides comprehensive web performance insights through natural language interactions.
    1,300 npm
    4
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Core Web Vitals analysis powered by Lighthouse. Four tools: analyze a URL, compare two URLs, check against thresholds, or crawl an entire site. Works with Claude Code, Cursor, Windsurf, and any MCP-compatible AI tool.
    4
    3 npm
    MIT