Playwright-Lighthouse 性能分析服务器

Playwright-Lighthouse 性能分析服务器

基于 Playwright 和 Lighthouse 的网站性能分析工具,支持 MCP 协议。

快速入门

前置条件

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

安装步骤

  1. 克隆仓库:git clone https://github.com/kbyk004/playwright-lighthouse-mcp.git
  2. 进入目录:cd playwright-lighthouse-mcp
  3. 安装依赖:npm install && npx playwright install
  4. 构建项目:npm run build

使用方法

  • 调试服务器运行:npm run inspector
  • 配置客户端(如 Claude for Desktop),在配置文件中添加对应参数。

功能工具

  1. run-lighthouse:分析网页性能
    • 参数:urlcategoriesmaxItems
  2. take-screenshot:截取网页快照
    • 参数:urlfullPage

详细信息请参考 README。