Skip to main content
Glama

Playwright-Lighthouse MCP Server

by kbyk004-diy

Playwright-Lighthouse MCP 服务器

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

特征

  • 使用 Lighthouse 进行性能分析

  • 屏幕截图

Related MCP server: Puppeteer MCP Server

设置

先决条件

  • 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 许可证 - 详情请参阅许可证

One-click Deploy
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kbyk004-diy/playwright-lighthouse-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server