Playwright Lighthouse 性能分析器
STDIO基于Playwright的网站性能分析服务
基于Playwright的网站性能分析服务
A MCP server that analyzes web site performance using Playwright and Lighthouse. Through the Model Context Protocol (MCP), LLMs can perform web site performance analysis.
# 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
npm run inspector
This server is designed to be used with clients that support the Model Context Protocol (MCP). For example, it can be integrated with Claude for Desktop.
Add the following to the Claude for Desktop configuration file (~/Library/Application Support/Claude/claude_desktop_config.json
):
{ "mcpServers": { "playwright-lighthouse": { "command": "node", "args": [ "/path-to/playwright-lighthouse-mcp/build/index.js" ] } } }
Runs a Lighthouse performance analysis on the currently open page.
Parameters:
url
: The URL of the website you want to analyzecategories
: Array of categories to analyze (default: ["performance"])
maxItems
: Maximum number of improvement items to display for each category (default: 3, max: 5)Takes a screenshot of the currently open page.
Parameters:
url
: The URL of the website you want to capturefullPage
: If true, captures a screenshot of the entire page (default: false)The analysis results include:
MIT License - see LICENSE for details