经 AI Skill Hub 精选评估,PageSpeed Insights MCP 获评「强烈推荐」。这款MCP工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.0 分,适合有一定技术背景的用户使用。
PageSpeed Insights MCP 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
PageSpeed Insights MCP 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/ruslanlap/pagespeed-insights-mcp
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"pagespeed-insights-mcp": {
"command": "npx",
"args": ["-y", "pagespeed-insights-mcp"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 PageSpeed Insights MCP 执行以下任务... Claude: [自动调用 PageSpeed Insights MCP MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"pagespeed_insights_mcp": {
"command": "npx",
"args": ["-y", "pagespeed-insights-mcp"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
<p align="center"> <img src="https://raw.githubusercontent.com/ruslanlap/pagespeed-insights-mcp/master/assets/1.png" alt="PageSpeed MCP chat demo" width="48%" /> <img src="https://raw.githubusercontent.com/ruslanlap/pagespeed-insights-mcp/master/assets/2.png" alt="PageSpeed MCP terminal demo" width="48%" /> </p>
16-tool MCP server for Google PageSpeed Insights & Chrome UX Report APIs. Analyze, compare, and optimize web performance directly through Claude, Cursor, or any MCP-compatible AI client.
🎬 View Interactive Demo → — See all 16 tools in action with animated examples Fallback URL: https://ruslanlap.github.io/pagespeed-insights-mcp/demo.html
Get a quick performance report for https://example.com
Add to ~/.grok/config.toml (global) or <repo>/.grok/config.toml (project-scoped, higher priority):
```toml [mcp_servers.pagespeed-insights] command = "npx" args = ["-y", "-p", "pino-pretty", "-p", "pagespeed-insights-mcp", "pagespeed-insights-mcp"] env = { GOOGLE_API_KEY = "${GOOGLE_API_KEY}" } enabled = true
```bash
npm install -g pagespeed-insights-mcp
npx pagespeed-insights-mcp
#### From GitHub Packages
bash
npm install -g @ruslanlap/pagespeed-insights-mcp ```
Note: This package is available on both npm and GitHub Packages. - For npm: Usenpm install pagespeed-insights-mcp- For GitHub Packages: Usenpm 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
docker build -t pagespeed-insights-mcp .
docker run -e GOOGLE_API_KEY=your-key pagespeed-insights-mcp
npm run build
"pagespeed-insights": {
"command": "npx",
"args": [
"-y",
"-p",
"pino-pretty",
"-p",
"pagespeed-insights-mcp",
"pagespeed-insights-mcp"
],
"env": {
"GOOGLE_API_KEY": "your-google-api-key-here"
}
}
[mcp_servers.pagespeed-insights]
command = "npx"
args = [
"-y",
"-p",
"pino-pretty",
"-p",
"pagespeed-insights-mcp",
"pagespeed-insights-mcp"
]
env = { GOOGLE_API_KEY = "your-google-api-key-here" }
Note: These examples include pino-pretty for better log formatting. For production use without pretty logs, see the Logging section below.
1. Go to the Google Cloud Console (or use the Quick Setup Link). 2. Create a new project or select an existing one. 3. Enable PageSpeed Insights API: - Navigate to APIs & Services → Library. - Search for "PageSpeed Insights API" and click Enable. 4. Create an API key: - Go to APIs & Services → Credentials. - Click Create Credentials → API Key. - Copy the generated key and set it as GOOGLE_API_KEY in your configuration.
<p align="center"> <img src="assets/3.png" alt="Google Cloud Console API Key Setup" width="90%" /> </p>
After configuration, simply ask Claude any of these commands:
answer example from Claude Desktop with pagespeed-insights-mcp 🔥🔥🔥
Now I have the full analysis! Here are all the ratings:
export GOOGLE_API_KEY=your-google-api-key
bash curl -sSL https://raw.githubusercontent.com/ruslanlap/pagespeed-insights-mcp/master/scripts/install.sh | bash
The installer uses the public npm package (`pagespeed-insights-mcp`) by default. To install the scoped GitHub Packages build instead, configure GitHub Packages authentication first and run:
bash curl -sSL https://raw.githubusercontent.com/ruslanlap/pagespeed-insights-mcp/master/scripts/install.sh | \ PAGESPEED_INSIGHTS_MCP_PACKAGE=@ruslanlap/pagespeed-insights-mcp bash ```
```bash
The MCP server requires a Google API key to access the PageSpeed Insights API.
```bash
export GOOGLE_API_KEY=your-google-api-key
To use this MCP server with Claude Desktop, add the following to your Claude Desktop configuration file:
{
"mcpServers": {
"pagespeed-insights": {
"command": "npx",
"args": ["-y", "-p", "pino-pretty", "-p", "pagespeed-insights-mcp", "pagespeed-insights-mcp"],
"env": {
"GOOGLE_API_KEY": "your-google-api-key-here"
}
}
}
}
If you used the scripts/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": ["-y", "-p", "pino-pretty", "-p", "pagespeed-insights-mcp", "pagespeed-insights-mcp"],
"env": {
"GOOGLE_API_KEY": "your-google-api-key-here"
}
}
}
}
{
"mcpServers": {
"pagespeed-insights": {
"command": "npx",
"args": [
"-y",
"-p",
"pino-pretty",
"-p",
"@ruslanlap/pagespeed-insights-mcp",
"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!
This MCP server uses pino for logging and enables the pino-pretty transport when NODE_ENV=development.
NODE_ENV=production GOOGLE_API_KEY=your-google-api-key npx pagespeed-insights-mcp
or in your MCP config:
"pagespeed-insights": {
"command": "npx",
"args": ["pagespeed-insights-mcp"],
"env": {
"GOOGLE_API_KEY": "your-google-api-key-here",
"NODE_ENV": "production"
}
}
npx, you can have npx install pino-pretty alongside the server:"pagespeed-insights": {
"command": "npx",
"args": [
"-y",
"-p",
"pino-pretty",
"-p",
"pagespeed-insights-mcp",
"pagespeed-insights-mcp"
],
"env": {
"GOOGLE_API_KEY": "your-google-api-key-here"
}
}
To use this MCP server, you need a Google API key with the PageSpeed Insights API enabled.
[!TIP] ⚡ Quick Setup Link: You can go directly to the Google Cloud Credentials Setup Page to quickly create a key in your project.
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.
| Tool | Description |
|---|---|
crux_summary | Real-world Core Web Vitals from Chrome UX Report (field data) |
compare_pages | Side-by-side performance comparison between two URLs |
Compare performance metrics between two URLs side-by-side.
Parameters:
urlA (required): First URL to compareurlB (required): Second URL to comparestrategy: "mobile" or "desktop" (default: "mobile")Returns:
pagespeed-insights-mcp 是一个基于 MCP 协议的服务端实现,旨在为 AI 助手提供快速的网页性能分析能力。通过集成 Google PageSpeed Insights,开发者可以直接在聊天界面中获取指定 URL 的性能报告,实现性能数据的即时查询与可视化展示,极大提升了 Web 性能调优的效率。
该项目核心功能包括利用 Google PageSpeed Insights 进行深度的网页性能分析,支持 Mobile 和 Desktop 双端设备检测。它能生成详尽的 Lighthouse Reports,并提供简化版的关键性能指标(KPI)报告。此外,系统具备智能推荐功能,可根据优先级评分提供可落地的修复建议,并通过智能缓存机制减少 API 调用频率,优化响应速度。
在使用本项目前,请确保您的开发环境已安装 Node.js 20 或更高版本(Node 18 已于 2025 年 4 月停止维护,不再受支持)。此外,您需要准备一个 Google API Key,并确保已在 Google Cloud 控制台中启用了 PageSpeed Insights API 以及(可选的)Chrome UX Report API。
推荐使用自动安装方式,通过 npm 进行全局安装:`npm install -g pagespeed-insights-mcp`。此外,您也可以通过 GitHub Packages 或直接使用 npx 命令运行。对于需要通过环境变量进行配置的场景,建议在安装后通过设置 `GOOGLE_API_KEY` 来完成初始化。
配置完成后,您可以直接在 Claude Desktop 或 Codex 等支持 MCP 协议的客户端中通过自然语言进行交互。例如,您可以直接向 Claude 发送指令,要求其针对特定 URL 获取性能报告,AI 将自动调用该 MCP Server 获取数据并为您解读性能指标。
配置该服务需要设置环境变量 `GOOGLE_API_KEY`。对于 Claude Desktop 用户,需在配置文件中添加 `pagespeed-insights` 节点,并使用 `npx` 命令配合 `pino-pretty` 进行日志记录。Codex 用户则需在 TOML 配置文件中进行相应的 MCP Server 节点定义。
本项目依赖 Google Cloud Platform 提供的 API 服务。开发者需要前往 Google Cloud Console 创建项目,在 'APIs & Services' 库中搜索并启用 'PageSpeed Insights API',随后在 'Credentials' 页面生成专属的 API Key 以供调用。
常见问题说明:若遇到 'Google API key not provided' 错误,请检查 Claude Desktop 配置中的 `GOOGLE_API_KEY` 环境变量是否正确设置;若遇到 'PageSpeed Insights API error: 403',请务必确认您的 Google Cloud 项目中已成功启用 PageSpeed Insights API 权限。
高质量的开源MCP工具,易于使用和集成
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
AI Skill Hub 点评:PageSpeed Insights MCP 的核心功能完整,质量优秀。对于Claude Desktop / Claude Code 用户来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | pagespeed-insights-mcp |
| 原始描述 | 开源MCP工具:MCP server for Google PageSpeed Insights API that enables web page performance a。⭐25 · JavaScript |
| Topics | google-insightsmcpjavascript |
| GitHub | https://github.com/ruslanlap/pagespeed-insights-mcp |
| License | MIT |
| 语言 | JavaScript |
收录时间:2026-05-26 · 更新时间:2026-05-30 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端