Playwright-Lighthouse MCP Server

by kbyk004
Verified

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Runs performance analysis on websites, providing scores for performance, accessibility, best-practices, SEO, and PWA categories, along with specific improvement recommendations

  • Analyzes Progressive Web App compliance as one of the optional categories in the Lighthouse performance analysis

Playwright-Lighthouse MCP 服务器

使用 Playwright 和 Lighthouse 分析网站性能的 MCP 服务器。通过模型上下文协议 (MCP),LLM 可以执行网站性能分析。

特征

  • 使用 Lighthouse 进行性能分析
  • 屏幕截图

设置

先决条件

  • Node.js 18 或更高版本
  • npm

安装

# Clone the repository git clone https://github.com/kbyk004/playwright-lighthouse-mcp.git cd playwright-lighthouse-mcp # Install dependencies npm install npx playwright install # Build npm run build

用法

调试 MCP 服务器

npm run inspector

与 MCP 客户端集成

此服务器旨在与支持模型上下文协议 (MCP) 的客户端配合使用。例如,它可以与 Claude for Desktop 集成。

Claude 桌面版配置示例

将以下内容添加到 Claude for Desktop 配置文件( ~/Library/Application Support/Claude/claude_desktop_config.json ):

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

可用工具

1. 运行灯塔

对当前打开的页面运行 Lighthouse 性能分析。

参数:

  • url :要分析的网站的 URL
  • categories :要分析的类别数组(默认值:[“performance”])
    • 可用类别:“性能”、“可访问性”、“最佳实践”、“SEO”、“PWA”
  • maxItems :每个类别显示的最大改进项目数(默认值:3,最大值:5)

2. 截屏

截取当前打开的页面的屏幕截图。

参数:

  • url :要捕获的网站的 URL
  • fullPage :如果为 true,则捕获整个页面的屏幕截图(默认值:false)

输出格式

分析结果包括:

  • 每个选定类别的总体得分,带有颜色指示器
  • 按类别分组的关键改进领域
  • 保存的报告文件的路径

执照

MIT 许可证 - 详情请参阅许可证

-
security - not tested
A
license - permissive license
-
quality - not tested

使用 Playwright 和 Lighthouse 分析网站性能的服务器,允许 LLM 通过模型上下文协议执行网络性能分析。

  1. Features
    1. Setup
      1. Prerequisites
      2. Installation
    2. Usage
      1. Debugging MCP Server
      2. Integration with MCP Clients
    3. Available Tools
      1. 1. run-lighthouse
      2. 2. take-screenshot
    4. Output Format
      1. License
        ID: 2gxb9p6d7o