一个包裹了Google Lighthouse工具的MCP服务器,用于帮助测量网页的各种性能指标。
此服务器可在模型上下文协议注册表中找到。使用您的MCP客户端或Claude Desktop进行安装。
您可以直接使用npx运行该工具而不需安装:
npx lighthouse-mcp
从npm全局安装该包:
npm install -g lighthouse-mcp
然后运行它:
lighthouse-mcp
npm install
npm run build
npm start
在您的MCP设置配置文件中添加以下内容:
{
"mcpServers": {
"lighthouse": {
"command": "npx",
"args": ["lighthouse-mcp"],
"disabled": false,
"autoApprove": []
}
}
}
在您的MCP设置配置文件中添加以下内容:
{
"mcpServers": {
"lighthouse": {
"command": "node",
"args": ["/absolute/path/to/lighthouse-mcp/build/index.js"],
"disabled": false,
"autoApprove": []
}
}
}
请将/absolute/path/to/lighthouse-mcp替换为此项目的实际路径。
对URL运行全面的Lighthouse审计。
参数:
url(必需):要审计的URLcategories(可选):要审计的类别数组(默认为全部)
device(可选):要模拟的设备(默认为"mobile")
throttling(可选):是否应用网络限速(默认为true)示例:
{
"url": "https://example.com",
"categories": ["performance", "accessibility"],
"device": "desktop",
"throttling": false
}
仅获取URL的性能分数。
参数:
url(必需):要审计的URLdevice(可选):要模拟的设备(默认为"mobile")
示例:
{
"url": "https://example.com",
"device": "mobile"
}
一旦MCP服务器配置完成,您就可以使用Claude来使用它:
example.com的性能分数是多少?
Claude将使用get_performance_score工具分析网站并返回结果。