MCP server for Google Lighthouse performance metrics
npm install lighthouse-mcpAn MCP server that wraps around Google's Lighthouse tool to help measure various performance metrics for web pages.
!Lighthouse MCP Server Screenshot
- Run comprehensive Lighthouse audits on any URL
- Get performance scores and metrics
- Configure device emulation (mobile/desktop)
- Control network throttling
- Select specific audit categories
This server is available in the Model Context Protocol Registry. Install it using your MCP client or Claude Desktop.
You can run the tool directly using npx without installation:
``bash`
npx lighthouse-mcp
Install the package globally from npm:
`bash`
npm install -g lighthouse-mcp
Then run it:
`bash`
lighthouse-mcp
1. Clone this repository
2. Install dependencies:
`bash`
npm install
`
3. Build the project:
bash`
npm run build
`
4. Run the server:
bash`
npm start
Add the following to your MCP settings configuration file:
`json`
{
"mcpServers": {
"lighthouse": {
"command": "npx",
"args": ["lighthouse-mcp"],
"disabled": false,
"autoApprove": []
}
}
}
Add the following to your MCP settings configuration file:
`json`
{
"mcpServers": {
"lighthouse": {
"command": "node",
"args": ["/absolute/path/to/lighthouse-mcp/build/index.js"],
"disabled": false,
"autoApprove": []
}
}
}
Replace /absolute/path/to/lighthouse-mcp with the actual path to this project.
Run a comprehensive Lighthouse audit on a URL.
Parameters:
- url (required): The URL to auditcategories
- (optional): Array of categories to audit (defaults to all)device
- Options: "performance", "accessibility", "best-practices", "seo", "pwa"
- (optional): Device to emulate (defaults to "mobile")throttling
- Options: "mobile", "desktop"
- (optional): Whether to apply network throttling (defaults to true)
Example:
`json`
{
"url": "https://example.com",
"categories": ["performance", "accessibility"],
"device": "desktop",
"throttling": false
}
Get just the performance score for a URL.
Parameters:
- url (required): The URL to auditdevice
- (optional): Device to emulate (defaults to "mobile")
- Options: "mobile", "desktop"
Example:
`json`
{
"url": "https://example.com",
"device": "mobile"
}
Once the MCP server is configured, you can use it with Claude:
``
What's the performance score for example.com?
Claude will use the get_performance_score tool to analyze the website and return the results.
- Node.js 16+
- Chrome/Chromium browser (for Lighthouse)
Before releasing, ensure you're authenticated with both registries:
NPM Authentication:
`bash`
npm login
MCP Registry Authentication:
`bash`
mcp-publisher login github
If your authentication tokens expire, you'll need to re-login to the respective services.
Use the interactive release script to publish to both NPM and the MCP Registry:
`bash``
./release.sh
The script will:
1. Check NPM login status
2. Check for uncommitted changes
3. Run tests (if they exist)
4. Build the project
5. Prompt for version bump type (patch/minor/major/custom)
6. Update both package.json and server.json versions
7. Create a preview of the package contents
8. Publish to NPM
9. Publish to MCP Registry (if mcp-publisher is available)
10. Create git commit and tag
11. Optionally push to remote repository
This ensures consistent releases to both registries with proper version synchronization.