
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
pagespeed-insights-mcp
Advanced tools
MCP server for Google PageSpeed Insights API - analyze web performance with Claude
MCP server for Google PageSpeed Insights API that enables web page performance analysis directly through Claude.
# Set environment variable
export GOOGLE_API_KEY=your-google-api-key
curl -sSL https://raw.githubusercontent.com/ruslanlap/pagespeed-insights-mcp/master/install.sh | bash
# Global installation from npm
npm install -g pagespeed-insights-mcp
# Or use without installation
npx pagespeed-insights-mcp
# Specific version
npm install -g pagespeed-insights-mcp@1.0.6
# First configure authentication (see GITHUB_PACKAGES.md for details)
# Then install globally
npm install -g @ruslanlap/pagespeed-insights-mcp
# Or specific version
npm install -g @ruslanlap/pagespeed-insights-mcp@1.0.6
Note: This package is available on both npm and GitHub Packages.
- For npm: Use
npm install pagespeed-insights-mcp- For GitHub Packages: Use
npm install @ruslanlap/pagespeed-insights-mcp(requires GitHub authentication)For detailed instructions on installing from GitHub Packages, see GITHUB_PACKAGES.md or visit the GitHub Packages page
The MCP server requires a Google API key to access the PageSpeed Insights API.
# Set environment variable
export GOOGLE_API_KEY=your-google-api-key
# Or pass directly when running
GOOGLE_API_KEY=your-google-api-key npx pagespeed-insights-mcp
To use this MCP server with Claude Desktop, add the following to your Claude Desktop configuration file:
{
"mcpServers": {
"pagespeed": {
"command": "npx",
"args": ["pagespeed-insights-mcp"],
"env": {
"GOOGLE_API_KEY": "your-google-api-key-here"
}
}
}
}
Example configuration files are available in the examples directory.
docker build -t pagespeed-insights-mcp .
docker run -e GOOGLE_API_KEY=your-key pagespeed-insights-mcp
If you used the install.sh script, the configuration was created automatically.
Add the configuration to your Claude Desktop file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/claude/claude_desktop_config.json
{
"mcpServers": {
"pagespeed-insights": {
"command": "npx",
"args": ["pagespeed-insights-mcp"],
"env": {
"GOOGLE_API_KEY": "your-google-api-key-here"
}
}
}
}
{
"mcpServers": {
"pagespeed-insights": {
"command": "npx",
"args": ["@ruslanlap/pagespeed-insights-mcp"],
"env": {
"GOOGLE_API_KEY": "your-google-api-key-here"
}
}
}
}
{
"mcpServers": {
"pagespeed-insights": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"--env", "GOOGLE_API_KEY=your-google-api-key-here",
"pagespeed-insights-mcp"
]
}
}
}
Restart Claude Desktop after configuration!
After configuration, simply ask Claude any of these commands:
Analyze the performance of https://example.com
Analyze https://example.com for mobile devices with all categories
Get a quick performance report for https://example.com
Analyze https://example.com performance for desktop devices
Perform a full audit of https://example.com including SEO, accessibility, and best practices
Get smart recommendations for improving https://example.com performance
Clear the cache to get fresh data for all subsequent requests
Get visual analysis for https://example.com showing screenshots and loading timeline
Show me which specific elements are causing performance issues on https://example.com
Analyze the network requests and resource loading for https://example.com
Get JavaScript execution breakdown for https://example.com
Show me which images need optimization on https://example.com
Find render-blocking resources on https://example.com
Analyze third-party script impact on https://example.com performance
Run a full audit including accessibility, SEO, and best practices for https://example.com
analyze_page_speedComplete page analysis with all Lighthouse metrics.
Parameters:
url (required): URL of the page to analyzestrategy: "mobile" or "desktop" (default: "mobile")category: array of categories ["performance", "accessibility", "best-practices", "seo", "pwa"]locale: locale for results (default: "en")get_performance_summarySimplified report with key performance metrics.
get_recommendationsGenerate smart performance recommendations with priority scoring and actionable fixes.
Parameters:
url (required): URL of the page to analyzestrategy: "mobile" or "desktop" (default: "mobile")category: array of categories to analyze (default: ["performance", "accessibility", "best-practices", "seo"])locale: locale for results (default: "en")clear_cacheClear the internal cache to force fresh API requests for all subsequent analyses.
get_visual_analysisGet screenshots and visual timeline showing how the page loads.
Parameters:
url (required): URL of the page to analyzestrategy: "mobile" or "desktop" (default: "mobile")Returns:
get_element_analysisGet specific DOM elements causing performance issues.
Parameters:
url (required): URL of the page to analyzestrategy: "mobile" or "desktop" (default: "mobile")Returns:
get_network_analysisGet detailed network waterfall showing all requests with timing and size.
Parameters:
url (required): URL of the page to analyzestrategy: "mobile" or "desktop" (default: "mobile")Returns:
get_javascript_analysisGet JavaScript execution breakdown showing performance impact.
Parameters:
url (required): URL of the page to analyzestrategy: "mobile" or "desktop" (default: "mobile")Returns:
get_image_optimization_detailsGet specific images needing optimization with exact savings potential.
Parameters:
url (required): URL of the page to analyzestrategy: "mobile" or "desktop" (default: "mobile")Returns:
get_render_blocking_detailsGet render-blocking resources and critical request chains.
Parameters:
url (required): URL of the page to analyzestrategy: "mobile" or "desktop" (default: "mobile")Returns:
get_third_party_impactGet third-party script impact analysis grouped by entity.
Parameters:
url (required): URL of the page to analyzestrategy: "mobile" or "desktop" (default: "mobile")Returns:
get_full_auditGet comprehensive audit results for all Lighthouse categories.
Parameters:
url (required): URL of the page to analyzestrategy: "mobile" or "desktop" (default: "mobile")categories: array of categories to audit (default: ["performance", "accessibility", "best-practices", "seo"])Returns:
answer example from Claude Desktop with pagespeed-insights-mcp 🔥🔥🔥
Now I have the full analysis! Here are all the ratings:
| Category | Score | Status |
|---|---|---|
| Performance | 67/100 | 🟡 Needs Improvement |
| Accessibility | 92/100 | 🟢 Good |
| Best Practices | 96/100 | 🟢 Excellent |
| SEO | 100/100 | 🟢 Perfect |
| Metric | Value | Score |
|---|---|---|
| First Contentful Paint | 1.2s | 🟢 Excellent (98/100) |
| Largest Contentful Paint | 2.4s | 🟡 Needs Improvement (75/100) |
| Speed Index | 4.8s | 🟡 Needs Improvement (67/100) |
| Total Blocking Time | 60ms | 🟢 Good (94/100) |
| Cumulative Layout Shift | 0 | 🟢 Perfect (100/100) |
| Audit | Score | Description |
|---|---|---|
| Label Content Name Mismatch | 🔴 0/1 | 2 errors with aria-label |
| Unsized Images | 🟡 0.5/1 | 1 image without dimensions |
| Color Contrast | 🟢 1/1 | Sufficient contrast |
| Button Names | 🟢 1/1 | Accessible button names |
| Link Names | 🟢 1/1 | Accessible link names |
| ARIA Roles | 🟢 1/1 | Correct ARIA roles |
| HTML Lang | 🟢 1/1 | Valid lang attribute |
| Meta Viewport | 🟢 1/1 | Proper viewport |
| Image Alt Text | 🟢 1/1 | Correct alt attributes |
| List Items | 🟢 1/1 | Proper list structure |
| Audit | Score | Status |
|---|---|---|
| Uses HTTPS | 🟢 ✓ | HTTPS is used |
| HTTP Status Code | 🟢 1/1 | Correct 200 status |
| No Console Errors | 🟢 1/1 | No console errors |
| Valid Source Maps | 🟢 1/1 | Valid source maps |
| No Notification Requests | 🟢 1/1 | No notification requests |
| Charset Declaration | 🟢 1/1 | Correct encoding |
| No Inspector Issues | 🟢 1/1 | No DevTools issues |
| Audit | Score | Status |
|---|---|---|
| Meta Viewport | 🟢 1/1 | Mobile optimized |
| Document Title | 🟢 1/1 | Title present |
| Meta Description | 🟢 1/1 | Description present |
| HTTP Status Code | 🟢 1/1 | Successful status |
| Link Text | 🟢 1/1 | Descriptive link texts |
| Crawlability | 🟢 1/1 | Available for indexing |
| HTML Lang | 🟢 1/1 | Valid document language |
| Hreflang | 🟢 1/1 | Correct hreflang attributes |
| Issue | Affects | Potential Savings |
|---|---|---|
| Improperly sized images | LCP, FCP | 1,069 KB, 170ms |
| Inefficient caching | Overall speed | 1,445 KB |
| Forced Reflows | Smoothness | 46.8ms |
| JavaScript execution time | TBT | 338ms |
| Metric | Value |
|---|---|
| Server Response Time | 120ms (🟢 Good) |
| Network RTT | Minimal |
| Main Thread Work | 0.9s |
| DOM Size | 453 elements (optimal) |
Overall Rating: Good with potential for improvement
The site has excellent SEO optimization and follows best practices, but needs image optimization to improve performance.
Parameters:
url (required): URL of the page to analyzestrategy: "mobile" or "desktop" (default: "mobile")# Development mode
npm run dev
# Build project
npm run build
# Run built server
npm start
Ensure the GOOGLE_API_KEY environment variable is set in your Claude Desktop configuration.
Check if PageSpeed Insights API is enabled in your Google Cloud project.
Ensure the URL includes the protocol (http:// or https://).
Special thanks to @engmsaleh (Mohamed Saleh Zaied) for his significant contribution to the development of this project.
MIT
For bug reports or feature requests, please create an issue in the repository.
FAQs
MCP server for Google PageSpeed Insights API - analyze web performance with Claude
The npm package pagespeed-insights-mcp receives a total of 135 weekly downloads. As such, pagespeed-insights-mcp popularity was classified as not popular.
We found that pagespeed-insights-mcp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.