Playwright-Lighthouse 性能分析服务器
基于 Playwright 和 Lighthouse 的网站性能分析工具,支持 MCP 协议。
快速入门
前置条件
- 安装 Node.js 18 或更高版本
- 安装 npm
安装步骤
- 克隆仓库:
git clone https://github.com/kbyk004/playwright-lighthouse-mcp.git
- 进入目录:
cd playwright-lighthouse-mcp
- 安装依赖:
npm install && npx playwright install
- 构建项目:
npm run build
使用方法
- 调试服务器运行:
npm run inspector
- 配置客户端(如 Claude for Desktop),在配置文件中添加对应参数。
功能工具
- run-lighthouse:分析网页性能
- 参数:
url
、categories
、maxItems
- 参数:
- take-screenshot:截取网页快照
- 参数:
url
、fullPage
- 参数:
详细信息请参考 README。