PageSpeed Insights MCP Server
PageSpeed Insights MCP Server
六工具 MCP 服务器,适用于 Google PageSpeed Insights 与 Chome UX Report API。可通过 Claude、Cursor 或任何兼容 MCP 的 AI 客户端直接分析、比较和优化网页性能。
⚡ 快速开始(复制粘贴)
{
"mcpServers": {
"pagespeed-insights": {
"command": "npx",
"args": ["-y", "pagespeed-insights-mcp"],
"env": { "GOOGLE_API_KEY": "your-google-api-key" }
}
}
}在 Google Cloud Console 获取免费 API 密钥 → 粘贴到 Claude Desktop 的 claude_desktop_config.json → 重启。完成。(Codex/OpenAI 配置、Docker)
Related MCP server: page-speed-insights-mcp
🔥 它为何与众不同
大多数 PageSpeed Insights MCP 服务器只封装一个工具:“对 URL 运行 PSI”。而此服务器提供六个工作流工具,覆盖完整的性能工作流——不仅仅是分数,而是行动计划:
完整工具包:页面分析、CrUX 真实用户数据(URL + 来源)、Lighthouse 审计、多页面与批量对比、基线和回归跟踪
深度诊断:元素级、网络、JavaScript、图像优化、渲染阻塞和第三方影响分析
可操作输出:推荐引擎将原始 Lightouse 数据转化为按优先级排序的修复方案,外加截图视觉分析
实用附加功能:重复运行的缓存,以及针对 AI 代理可执行而优化的智能推荐
久经考验:发布于 npm,列入官方 MCP 注册表 和 Glama,并通过 Vitest 进行 CI 测试
🎬 查看交互式演示 → — 查看带动画示例的工具实战 备用 URL:https://ruslanlap.github.io/pagespeed-insights-mcp/demo.html
📖 目录
[⚡ 快速开始(复制粘贴)](#- quick-start-copy--paste)
[🔥 它为何与众不同](#- what-makes-it-different)
[⚙️ 客户端配置](#- cient-configuration)
[📊 示例输出](#- ample-output)
[📚 文档](#- ocumentation)
[📝 发布说明](#- lease-notes)
[🎯 为什么你需要它](#- why-you-need-this)
[✨ 功能](#- atures)
[🚀 快速安装](#- quick-installation)
[🔑 获取 Google API 密钥](#- getting-google-api-key)
[⚙️ Claude Desktop 配置](#- claude-desktop-configuration)
[💻 使用方法](#- usage)
[可用工具](# available-tools)
[开发](# development)
[故障排除](# troubleshooting)
[环境要求](# requirements)
[安全](# security)
[致谢](# acknowledgments)
[许可证](# license)
[支持](# support)
客户端配置
Claude Desktop
添加到你的 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"
}
}
}
}Codex / OpenAI
添加到你的配置(TOML):
[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" }注意:
pino-pretty包是正确日志格式化所必需的。上述配置可确保它通过npx自动安装。
面向 Grok Build (config.toml)
添加到 ~/.grok/config.toml(全局)或 <repo>/.grok/config.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
# Recommended companion professional MCPs (add once):
# [mcp_servers.github] — PRs, issues, code search
# [mcp_servers.context7] — fresh library docs (Upstash)
# [mcp_servers.serena] — semantic code intelligence (uses your .serena/ if present)项目级示例(将此仓库的 .grok/config.toml 用于本地 dist/index.js + 更严格的 Serena):
[mcp_servers.pagespeed-insights]
command = "node"
args = ["/home/ubuntuvm/Projects/pagespeed-insights-mcp/dist/index.js"]
env = { GOOGLE_API_KEY = "${GOOGLE_API_KEY}", NODE_ENV = "development" }在 Grok 会话中进行验证:
/mcps(或Ctrl+L→ MCP 标签页)→ 确保 pagespeed-insights 显示 “running”使用工具:
pagespeed-insights__pagesped_analyze_page、pagespeed-insights__pagespeed_get_field_data等(带命名空间)
📊 示例输出
针对 github.com 的真实 pagespeed_analyze_page 结果——一次移动端 Lighthouse 运行。CrUX 数字来自 pagespeed_get_field_data(scope : "origin"):
Lightouse 实验室评分:
类别 | 得分 | 状态 |
Performance (mobile) | 54/100 | 🔴 差 |
Performance (desktop) | 52/100 | 🔴 差 |
核心指标(移动端):
指标 | 数值 | 评级 |
First Contentful Paint | 11.9 s | 🔴 差 |
Largest Contentful Paint | 13.4 s | 🔴 差 |
Total Blocking Time | 30 ms | 优秀 |
Cumulative Layout Shift | 0.07 | 良好 |
Speed Index | 11.9 s | 🔴 差 |
CrUX 现场数据——真实用户,github.com 来源(手机):
指标 | p75(真实用户) |
First Contentful Paint | 1.9 s |
Largest Contentful Paint | 2.2 s |
Interaction to Next Paint | 243 ms |
Cumulative Layout Shift | 0.02 |
每次运行的结果都会有所不同——Lightouse 实验室数据存在噪声(单次运行只是一个样本)。请使用
runs: 3-5获取中位数。实验室与现场数据对比:Lightouse 会限制连接速度(因此移动端为 54/100),而 CrUX 显示的是真实 GitHub 访问者的体验——这两种视图都直接来自此服务器的工具。
📚 文档
我们提供全面的在线文档。
你还可以查看
docs/目录中的原始 Markdown 文件,或在本地运行mkdocs serve。
📝 发布说明
当前版本:v2.0.0。
v2.0.0——六个面向工作流的
pagespeed_*工具取代了 19 个 v1 端点式工具;所有数据工具均支持 Markdown 或 JSON 结构化结果。
此 README 顶部的徽章会在每次发布时自动更新(npm 版本、GitHub 包版本、下载量)。无需手动编辑。
完整的发布历史请参阅 CHANGELOG.md。
为什么你需要它
痛点 1——“我的页面很慢,但不知道为什么。” 打开 PageSpeed Insights,你会得到一屏数据,却仍然不知道先修什么。这个 MCP 为你的 AI 助手提供六个聚焦的工作流,帮你穿透噪音:它会识别出确切的渲染阻塞资源、浪费了 2 MB 的特定图片、消耗主线程 1.5 秒的第三方脚本,并按影响程度排序。问一句“为什么我的网站很慢?”,你得到的是一份按优先级排序的修复清单,而不是 40 项指标的仪表盘。
痛点 2——“我把性能回退发布到了生产环境。” 你的团队节奏很快,每天部署,没有人会在每次合并前运行一次完整的 Lightouse 审计。等到有人注意到 Core Web Vitals 下降时,回退已经上线了。这个 MCP 让任何开发者在 Claude/Cursor 中粘贴一个 URL,就能在几秒内获得完整审计——实验室数据、来自真实 Chome 用户的现场数据(CrUX)、元素级 CLS/LCP 调试。这就好比在工位上发现回退,而非三天后从 SEO 团队的 Slack 消息里才发现。
✨ 功能
核心功能
性能分析:使用 Google PageSpeed Insights 分析网页
📱 多平台支持:移动端和桌面端设备
🔍 详细的 Lightouse 报告,包含全面指标
📊 简化报告,包含关键性能指标
智能推荐,带优先级评分和可操作的修复方案
💾 智能缓存,减少 API 调用并提升性能
🌍 本地化——支持多种语言
快速安装——一条命令完成设置
Docker 支持,用于容器化部署
高级分析工具(新!)
📸 视觉分析——截图、胶片条和整页捕获
🎯 元素级调试——查找导致问题的具体 DOM 元素
🌐 网络瀑布流——详细的请求时序和资源加载
JavaScript 性能分析——执行分解和未使用代码检测
️ 图像优化——具体图像问题及精确节省量
渲染阻塞分析——关键请求链和依赖关系
🔌 第三方影响——按提供商分组的脚本影响
📊 完整审计——所有类别的完整 Lightouse 审计
🚀 快速安装
选项 1:自动安装(推荐)
# Set environment variable
export GOOGLE_API_KEY=your-google-api-keycurl -sSL https://raw.githubusercontent.com/ruslanlap/pagespeed-insights-mcp/master/scripts/install.sh | bash安装程序默认使用公共 npm 包(pagespeed-insights-mcp)。如果要改用 scoped GitHub Packages 构建版本,请先配置 GitHub Packages 认证,然后运行:
curl -sSL https://raw.githubusercontent.com/ruslanlap/pagespeed-insights-mcp/master/scripts/install.sh | \
PAGESPEED_INSIGHTS_MCP_PACKAGE=@ruslanlap/pagespeed-insights-mcp bash选项 2:通过 npm 或 GitHub Packages
通过 npm(公共注册表)
# Global installation from npm
npm install -g pagespeed-insights-mcp
# Or use without installation
npx pagespeed-insights-mcp通过 GitHub Packages
# First configure authentication (see GITHUB_PACKAGES.md for details)
# Then install globally
npm install -g @ruslanlap/pagespeed-insights-mcp注意: 此包在 npm 和 GitHub Packages 上均可用。
对于 npm:使用
npm install pagespeed-insights-mcp对于 GitHub Packages:使用
npm install @ruslanlap/pagespeed-insights-mcp(需要 GitHub 认证)如需从 GitHub Packages 安装的详细说明,请参阅 GITHUB_PACKAGES.md 或访问 GitHub Packages 页面
🔧 配置
MCP 服务器需要一个 Google API 密钥才能访问 PageSpeed Insights API。
# Set environment variable
export GOOGLE_API_KEY=your-google-api-key
# Windows
$env:GOOGLE_API_KEY="your-google-api-key"
# Or pass directly when running
GOOGLE_API_KEY=your-google-api-key npx pagespeed-insights-mcp📝 MCP 配置示例
用于 Claude Desktop(带 pino-pretty 日志):
"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"
}
}用于 Codex(带 pino-pretty 日志):
[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" }注意: 这些示例包含
pino-pretty以获得更好的日志格式。生产环境中如果不使用美化日志,请参阅下面的日志记录部分。
Google Antigravity
示例配置文件位于 examples 目录中。
选项 3:Docker
docker build -t pagespeed-insights-mcp .
docker run -e GOOGLE_API_KEY=your-key pagespeed-insights-mcp🔑 获取 Google API 密钥
要使用此 MCP 服务器,你需要一个已启用 PageSpeed Insights API 的 Google API 密钥。
[!TIP] ⚡ 快速设置链接: 你可以直接前往 Google Cloud 凭据设置页面 在项目中快速创建密钥。
分步指南
前往 Google Cloud Console(或使用 快速设置链接)。
创建新项目或选择现有项目。
启用 PageSpeed Insights API:
导航至 API 和服务 → 库。
搜索 “PageSpeed Insights API” 并点击启用。
创建 API 密钥:
前往 API 和服务 → 凭据。
点击创建凭据 → API 密钥。
复制生成的密钥,并在配置中将其设置为
GOOGLE_API_KEY。
⚙️ Claude Desktop 配置
配置文件路径:macOS ~/Library/Application Support/Claude/claude_desktop_config.json · Windows %APPDATA%\Claude\claude_desktop_config.json · Linux ~/.config/claude/claude_desktop_config.json —— 关于 JSON,请参阅上文的 ⚙️ 客户端配置。编辑完成后,请重启 Claude Desktop。
💻 使用
配置完成后,只需让 Claude 执行以下任一命令:
🔍 整页分析
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⚡ JavaScript 性能
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📊 完整 Lighthouse 审计
Run a full audit including accessibility, SEO, and best practices for https://example.com可用工具(v2)
版本 2 用六个工作流工具取代了原先 19 个端点式工具。这是一个破坏性变更:请更新 MCP 客户端提示、已保存的工具调用和集成,以使用下面的名称。每个返回数据的工具都接受 responseFormat(markdown,默认,或 json),并返回 MCP structuredContent。
Tool | Use it for |
| 对单个页面进行 Lighthouse 健康检查、完整报告、建议、审计结果或 Mermaid 图( |
| 单项聚焦调查: |
| 针对 |
| 比较两个页面的当前状态,或将一个页面与其保存的基线进行比较( |
| 对 1–10 个页面进行分流,并在支持时发送进度通知。 |
| 部署后清除此进程的内存中 API 缓存。 |
从 v1 迁移
v1 工具 | v2 替代 |
|
|
|
|
|
|
|
|
|
|
| 运行 |
示例
{"url":"https://example.com","strategy":"mobile","report":"recommendations","responseFormat":"markdown"}{"url":"https://example.com","focus":"render-blocking","responseFormat":"json"}{"mode":"baseline","url":"https://example.com","strategy":"mobile","runs":3}示例
来自 Claude Desktop 配合 pagespeed-insights-mcp 的示例回答 🔥🔥🔥
开发
为了在开发过程中获得更好的日志格式,建议全局安装 pino-pretty:
npm install -g pino-pretty# Development mode
npm run dev
# Build project
npm run build
# Run built server
npm startMCP 环境中的日志记录 / pino-pretty
此 MCP 服务器使用 pino 进行日志记录,并在 NODE_ENV=development 时启用 pino-pretty 传输。
如果你只想以最简的配置让它正常工作(Claude、Codex 等),请设置:
NODE_ENV=production GOOGLE_API_KEY=your-google-api-key npx pagespeed-insights-mcp或是在你的 MCP 配置中:
"pagespeed-insights": {
"command": "npx",
"args": ["pagespeed-insights-mcp"],
"env": {
"GOOGLE_API_KEY": "your-google-api-key-here",
"NODE_ENV": "production"
}
}如果你希望在开发时通过
nnpx获得美观的日志,可以让nnpx与服务器一同安装pino-pretty:
"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"
}
}故障排除
“未提供 Google API 密钥”
请确保在你的 Claude Desktop 配置中设置了 GOOGLE_API_KEY 环境变量。
“PageSpeed Insights API 错误:403”
请检查你的 Google Cloud 项目中是否已启用 PageSpeed Insights API。
“无效的 URL”
请确保 URL 包含协议——仅接受 http:// 和 https://。其他协议(file://、ftp://、javascript: 等)会在协议层面被拒绝。
要求
Node.js 20.19.0 或更高版本(Node 18 自 2025 年 4 月起已结束生命周期(EOL),不再受支持)。
一个已启用 PageSpeed Insights 与(可选)Chrome UX Report API 的 Google API 密钥。
安全
请私下报告安全问题——不要公开提交 issue。有关披露政策与运维加固说明,请参阅 SECURITY.md。
致谢
特别感谢 @engmsaleh(Mohamed Saleh Zaied)对本项目开发做出的重要贡献。
非常感谢 @system-conf 对本项目成长与发展所做出的卓越而宝贵的贡献。您的奉献、专业知识和持续支持产生了巨大的影响——没有您,这个项目不会有今天的成就。🙏
许可证
Apache-2.0 —— 请参阅 LICENSE。贡献者依据 Apache License 2.0 授予专利权。
支持
如需报告错误或请求新功能,请在仓库中创建 issue。
Available Tools
6 toolspagespeed_analyze_batchAnalyze Multiple PagesARead-onlyIdempotent
Analyze 1–10 public URLs and return per-page results plus success/failure counts. Use pagespeed_analyze_page for one URL or pagespeed_compare_pages for a direct comparison. Example: triage the ten highest-traffic landing pages. Progress notifications are emitted when supported by the client.
| Name | Required | Description | Default |
|---|---|---|---|
| urls | Yes | One to ten public http(s) URLs. | |
| locale | No | BCP-47 locale such as en or uk-UA. | en |
| report | No | Per-page result detail. | summary |
| strategy | No | Lighthouse device profile. mobile is the default. | mobile |
| categories | No | Lighthouse categories to request. | |
| responseFormat | No | markdown is concise and readable; json is machine-readable and is also available as structuredContent. | markdown |
Output Schema
| Name | Required | Description |
|---|---|---|
| tool | Yes | |
| result | Yes | |
| truncated | No | |
| truncationMessage | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnly, idempotent, and non-destructive behavior. The description adds meaningful context beyond annotations: it mentions progress notifications emitted when supported by the client and notes that results include success/failure counts. This gives the agent insight into execution behavior without contradicting annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three sentences, each earning its place: purpose is front-loaded, followed by sibling routing, a practical example, and a behavioral note about progress notifications. There is zero fluff or redundancy, making it easy for an agent to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given six parameters with complete schema documentation, a robust output schema, and annotations covering safety (readOnly, idempotent, non-destructive), the description provides all necessary guidance for correct invocation. It covers usage, alternatives, an example, and a behavioral note—comprehensive for this tool's complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage for all six parameters, including units, defaults, and constraints. The tool description adds no additional parameter-level guidance, but since the schema fully documents semantics, the baseline of 3 is appropriate. The description's mention of '1–10 URLs' aligns with schema constraints but adds no new information.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: analyze 1–10 public URLs and return per-page results plus success/failure counts. It distinguishes itself from sibling tools by explicitly naming pagespeed_analyze_page for a single URL and pagespeed_compare_pages for direct comparison, making selection unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit routing guidance: use pagespeed_analyze_page for one URL or pagespeed_compare_pages for direct comparison. It also includes a concrete example (triage ten highest-traffic landing pages) that grounds the tool in real usage, leaving no ambiguity about when to invoke it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pagespeed_analyze_pageAnalyze a Page with LighthouseARead-onlyIdempotent
Run a PageSpeed Insights Lighthouse analysis for one public page. Start with report=summary for a health check; choose full for audits, recommendations for a prioritized fix list, audit for non-performance categories, or performance-map for Mermaid. Example: analyze a mobile product page and return the three most useful remediation steps. Returns a report plus structured result. The Google API is contacted and results may be served from the local cache.
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Public http(s) URL, for example https://example.com/products. | |
| runs | No | Distinct measurements. Use 3–5 when you need a median and spread. | |
| locale | No | BCP-47 locale such as en or uk-UA. | en |
| report | No | Amount and shape of returned insight. | summary |
| strategy | No | Lighthouse device profile. mobile is the default. | mobile |
| categories | No | Lighthouse categories to request. | |
| responseFormat | No | markdown is concise and readable; json is machine-readable and is also available as structuredContent. | markdown |
Output Schema
| Name | Required | Description |
|---|---|---|
| tool | Yes | |
| result | Yes | |
| truncated | No | |
| truncationMessage | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already mark the tool read-only, idempotent, and non-destructive. The description adds that the Google API is contacted and results may come from a local cache, setting expectations about external dependency and possible staleness. No contradiction with the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Four short sentences: purpose, report-mode guidance, a concrete example, and an external-behavior caveat. Each sentence earns its place, and the core purpose is front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With a fully described schema, enums, annotations covering safety, and an output schema present, the only operational context an agent needs is report-mode selection and the external API/cache behavior — both provided. Nothing significant is missing for correct selection and invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3. The description adds meaning by mapping report enum values to intended use cases and giving a concrete example ('analyze a mobile product page and return the three most useful remediation steps'), which clarifies strategy and report selection beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with 'Run a PageSpeed Insights Lighthouse analysis for one public page' — a specific verb, resource, and scope. Saying 'one public page' differentiates it from batch and compare siblings, and the list of report modes clarifies its capabilities further.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives explicit decision rules for the report parameter ('summary for a health check', 'recommendations for a prioritized fix list'), which tells an agent which mode fits a goal. It does not mention sibling tools by name, but 'one public page' implies single-page scope versus batch analysis.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pagespeed_clear_cacheClear Local PageSpeed CacheAIdempotent
Clear only this server process's in-memory PageSpeed response cache, forcing later analysis calls to contact Google again. Use after a deploy when a cached result is stale. It does not change the target website, files, or remote data; repeating the call is safe.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| tool | Yes | |
| result | Yes | |
| truncated | No | |
| truncationMessage | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the idempotentHint and destructiveHint annotations, the description adds valuable behavioral context: the cache is in-memory and process-local, later calls will contact Google again, and the tool does not alter the target website or remote data. This gives the agent a clear mental model of side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three compact sentences, each earning its place: the first states the action and effect, the second gives the recommended trigger, and the third clarifies safety and non-destructiveness. The most relevant information is front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter tool with an output schema and no nested objects, the description fully covers what the agent needs to decide when to call it and what to expect. No critical behavioral or scoping details are missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, and schema description coverage is 100%, so there is nothing for the description to add about parameters. The baseline of 4 applies because the description correctly focuses on behavior instead.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('Clear') and resource ('this server process's in-memory PageSpeed response cache'), and explicitly contrasts the scope with other tools. This clearly differentiates it from sibling analysis tools like pagespeed_analyze_page or pagespeed_get_field_data.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives an explicit use case: use after a deploy when a cached result is stale. It also states what it does not do, preventing misuse. However, it does not name specific alternatives or explicitly state when not to use it, leaving a small gap.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pagespeed_compare_pagesCompare Pages or a Stored BaselineADestructive
Compare two pages now (mode=pages) or measure one page against its locally stored baseline (mode=baseline). Baseline mode records the first call; use runs=3 or more and rely on guaranteed deltas, not medians alone. Example: compare staging against production, or verify whether a deployed fix improved mobile LCP. replaceBaseline overwrites local baseline state.
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Public http(s) URL, for example https://example.com/products. | |
| mode | Yes | pages compares url and against; baseline compares url to its saved measurement. | |
| runs | No | Use 2–5 for baseline mode; 3 is recommended. | |
| against | No | Second URL, required when mode=pages. | |
| strategy | No | Device profile; part of baseline identity. | mobile |
| categories | No | Lighthouse categories to request. | |
| responseFormat | No | markdown is concise and readable; json is machine-readable and is also available as structuredContent. | markdown |
| replaceBaseline | No | Only baseline mode: overwrite the local stored baseline. |
Output Schema
| Name | Required | Description |
|---|---|---|
| tool | Yes | |
| result | Yes | |
| truncated | No | |
| truncationMessage | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the destructiveHint annotation, the description discloses that baseline mode records the first call, warns to rely on guaranteed deltas rather than medians alone, and states that replaceBaseline overwrites local baseline state. This is meaningful behavioral transparency beyond what annotations provide.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences with no wasted words: the first states the core purpose, the second gives operational guidance, and the third provides examples and the destructive state-change warning. The structure is front-loaded and easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For an 8-parameter tool with full schema descriptions and an output schema, the description covers the key operational nuances: mode selection, first-call baseline behavior, run counts, examples, and state overwriting. Nothing critical for correct invocation is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3. The description adds value by explaining the behavioral semantics of baseline mode's first call and why runs=3 or more is recommended, rather than merely repeating schema defaults.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb and resource: 'Compare two pages now' or 'measure one page against its locally stored baseline.' It clearly distinguishes the two modes and gives concrete examples, making the tool's purpose distinct from sibling tools like pagespeed_analyze_page.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explains when to use pages versus baseline mode and provides practical examples such as comparing staging against production or verifying a deployed fix. It does not explicitly name sibling alternatives or exclusions, but the contexts are clear enough to route an agent correctly.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pagespeed_diagnose_pageDiagnose a Page Performance ProblemARead-onlyIdempotent
Inspect one page through exactly one diagnostic lens: visual, elements, network, javascript, images, render-blocking, or third-parties. Use after pagespeed_analyze_page identifies a problem; do not use it for a general score. Example: focus=render-blocking to identify CSS/JS delaying first render. Returns focused evidence rather than a full Lighthouse dump.
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Public http(s) URL, for example https://example.com/products. | |
| focus | Yes | The single diagnostic lens to return. | |
| strategy | No | Lighthouse device profile. mobile is the default. | mobile |
| responseFormat | No | markdown is concise and readable; json is machine-readable and is also available as structuredContent. | markdown |
Output Schema
| Name | Required | Description |
|---|---|---|
| tool | Yes | |
| result | Yes | |
| truncated | No | |
| truncationMessage | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, openWorldHint=true, idempotentHint=true, and destructiveHint=false, covering safety and side-effect expectations. The description adds a meaningful behavioral constraint: 'exactly one diagnostic lens' and 'Returns focused evidence rather than a full Lighthouse dump', which aligns with and enriches the annotation profile. No contradiction exists.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three sentences of dense, useful information with zero fluff. It front-loads the core purpose, states the usage condition, and embeds a practical example in the same breath. Every sentence earns its place, making it highly efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that there is a full input schema, an output schema is present (per context), and annotations cover safety and idempotence, the description provides everything an agent needs to decide and invoke correctly: what it does, when to use it (vs. analyze), when not to, and a working example. Nothing essential is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so all four parameters are fully documented in the schema itself (baseline 3). The description adds value by providing a concrete example ('focus=render-blocking to identify CSS/JS delaying first render') that clarifies the practical meaning of the focus parameter beyond its enum listing, which justifies a 4.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('Inspect') and resource ('one page') with a defined scope ('exactly one diagnostic lens'), and explicitly distinguishes itself from pagespeed_analyze_page by saying 'do not use it for a general score'. It also lists the available lenses, making the tool's purpose unambiguous and well-differentiated from siblings.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives explicit when-to-use guidance: 'Use after pagespeed_analyze_page identifies a problem' and when-not-to-use: 'do not use it for a general score'. It even provides a concrete example (focus=render-blocking) to illustrate proper invocation, which is more than most tool descriptions offer.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pagespeed_get_field_dataGet Chrome UX Report Field DataARead-onlyIdempotent
Get real-user Core Web Vitals from Chrome UX Report, not Lighthouse lab measurements. Use scope=page for one URL; use scope=origin with a bare origin when the page has insufficient traffic. Example: check mobile LCP and INP for https://example.com/checkout. Returns p75 field metrics or a clear no-data result.
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Public http(s) URL, for example https://example.com/products. | |
| scope | No | page queries one URL; origin aggregates every page on the origin. | page |
| formFactor | No | CrUX device segment. ALL is valid only for scope=origin. | PHONE |
| responseFormat | No | markdown is concise and readable; json is machine-readable and is also available as structuredContent. | markdown |
Output Schema
| Name | Required | Description |
|---|---|---|
| tool | Yes | |
| result | Yes | |
| truncated | No | |
| truncationMessage | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnly, openWorld, idempotent, and non-destructive behavior; the description adds meaningful behavioral context by stating that it returns p75 field metrics or a clear no-data result, and by clarifying real-user field data rather than lab measurements. It does not mention rate limits or auth, but the annotations cover the safety profile.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Four short sentences carry distinct information: purpose, parameter guidance, example, and return behavior. Every sentence earns its place, and the most important scoping guidance is front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For an idempotent, read-only tool with a complete input schema and an output schema, the description covers the key decisions an agent must make: which URL/origin to query, what kind of metrics to expect, and what happens when no data exists. Nothing critical is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds value beyond the schema by explaining when to choose page vs origin, specifically mentioning insufficient traffic, and by giving a concrete mobile LCP/INP example that helps ground the formFactor and metric concepts.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb and resource: get real-user Core Web Vitals from Chrome UX Report. It also explicitly distinguishes itself from Lighthouse lab measurements, which sets it apart from sibling analysis tools without needing to inspect their schemas.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives concrete selection guidance for scope: page for one URL, origin for a bare origin when page traffic is insufficient. It also clarifies that this is not Lighthouse lab data, but it does not name a specific sibling tool like pagespeed_analyze_page as the lab alternative, so the routing is clear but not fully explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
25 tool updates
v2.0.0- Removed
analyze_page_speed - Removed
batch_analyze - Removed
clear_cache - Removed
compare_baseline - Removed
compare_pages - Removed
crux_summary - Removed
full_report - Removed
get_element_analysis - Removed
get_full_audit - Removed
get_image_optimization_details - Removed
get_javascript_analysis - Removed
get_network_analysis - Removed
get_origin_crux - Removed
get_performance_map - Removed
get_performance_summary - Removed
get_recommendations - Removed
get_render_blocking_details - Removed
get_third_party_impact - Removed
get_visual_analysis - Added
pagespeed_analyze_batch - Added
pagespeed_analyze_page - Added
pagespeed_clear_cache - Added
pagespeed_compare_pages - Added
pagespeed_diagnose_page - Added
pagespeed_get_field_data
15 tool updates
v1.7.4- Changed
analyze_page_speed2 fields changed- added
Input schema / properties / runsAdded value: +{ + "default": 1, + "description": "Distinct analyses to run (default 1). >1 reports the median with min-max spread; cached replays (same fetchTime) are dropped and counted", + "maximum": 5, + "minimum": 1, + "type": "integer" +} - changed
Input schema / properties / strategy / descriptionPrevious value: -"Analysis strategy"New value: +"Device to simulate: mobile (default), desktop, or both"
- Changed
batch_analyze1 field changed- changed
Input schema / properties / strategy / descriptionPrevious value: -"Analysis strategy"New value: +"Device to simulate: mobile (default), desktop, or both"
- Changed
compare_pages1 field changed- changed
Input schema / properties / strategy / descriptionPrevious value: -"Analysis strategy"New value: +"Device to simulate: mobile (default), desktop, or both"
- Changed
full_report2 fields changed- added
Input schema / properties / runsAdded value: +{ + "default": 1, + "description": "Distinct analyses to run (default 1). >1 reports the median with min-max spread; cached replays (same fetchTime) are dropped and counted", + "maximum": 5, + "minimum": 1, + "type": "integer" +} - changed
Input schema / properties / strategy / descriptionPrevious value: -"Analysis strategy"New value: +"Device to simulate: mobile (default), desktop, or both"
- Changed
get_element_analysis1 field changed- changed
Input schema / properties / strategy / descriptionPrevious value: -"Analysis strategy"New value: +"Device to simulate: mobile (default), desktop, or both"
- Changed
get_full_audit1 field changed- changed
Input schema / properties / strategy / descriptionPrevious value: -"Analysis strategy"New value: +"Device to simulate: mobile (default), desktop, or both"
- Changed
get_image_optimization_details1 field changed- changed
Input schema / properties / strategy / descriptionPrevious value: -"Analysis strategy"New value: +"Device to simulate: mobile (default), desktop, or both"
- Changed
get_javascript_analysis1 field changed- changed
Input schema / properties / strategy / descriptionPrevious value: -"Analysis strategy"New value: +"Device to simulate: mobile (default), desktop, or both"
- Changed
get_network_analysis1 field changed- changed
Input schema / properties / strategy / descriptionPrevious value: -"Analysis strategy"New value: +"Device to simulate: mobile (default), desktop, or both"
- Changed
get_performance_map1 field changed- changed
Input schema / properties / strategy / descriptionPrevious value: -"Analysis strategy"New value: +"Device to simulate: mobile (default), desktop, or both"
- Changed
get_performance_summary1 field changed- changed
Input schema / properties / strategy / descriptionPrevious value: -"Analysis strategy"New value: +"Device to simulate: mobile (default), desktop, or both"
- Changed
get_recommendations2 fields changed- added
Input schema / properties / runsAdded value: +{ + "default": 1, + "description": "Distinct analyses to run (default 1). >1 reports the median with min-max spread; cached replays (same fetchTime) are dropped and counted", + "maximum": 5, + "minimum": 1, + "type": "integer" +} - changed
Input schema / properties / strategy / descriptionPrevious value: -"Analysis strategy"New value: +"Device to simulate: mobile (default), desktop, or both"
- Changed
get_render_blocking_details1 field changed- changed
Input schema / properties / strategy / descriptionPrevious value: -"Analysis strategy"New value: +"Device to simulate: mobile (default), desktop, or both"
- Changed
get_third_party_impact1 field changed- changed
Input schema / properties / strategy / descriptionPrevious value: -"Analysis strategy"New value: +"Device to simulate: mobile (default), desktop, or both"
- Changed
get_visual_analysis1 field changed- changed
Input schema / properties / strategy / descriptionPrevious value: -"Analysis strategy"New value: +"Device to simulate: mobile (default), desktop, or both"
16 tool updates
v1.7.0- Changed
analyze_page_speed1 field changed- changed
Input schema / properties / strategy / enumPrevious value: -[ - "mobile", - "desktop" -]New value: +[ + "mobile", + "desktop", + "both" +]
- Changed
batch_analyze1 field changed- changed
Input schema / properties / strategy / enumPrevious value: -[ - "mobile", - "desktop" -]New value: +[ + "mobile", + "desktop", + "both" +]
- Added
compare_baseline - Changed
compare_pages1 field changed- changed
Input schema / properties / strategy / enumPrevious value: -[ - "mobile", - "desktop" -]New value: +[ + "mobile", + "desktop", + "both" +]
- Changed
full_report1 field changed- changed
Input schema / properties / strategy / enumPrevious value: -[ - "mobile", - "desktop" -]New value: +[ + "mobile", + "desktop", + "both" +]
- Changed
get_element_analysis1 field changed- changed
Input schema / properties / strategy / enumPrevious value: -[ - "mobile", - "desktop" -]New value: +[ + "mobile", + "desktop", + "both" +]
- Changed
get_full_audit1 field changed- changed
Input schema / properties / strategy / enumPrevious value: -[ - "mobile", - "desktop" -]New value: +[ + "mobile", + "desktop", + "both" +]
- Changed
get_image_optimization_details1 field changed- changed
Input schema / properties / strategy / enumPrevious value: -[ - "mobile", - "desktop" -]New value: +[ + "mobile", + "desktop", + "both" +]
- Changed
get_javascript_analysis1 field changed- changed
Input schema / properties / strategy / enumPrevious value: -[ - "mobile", - "desktop" -]New value: +[ + "mobile", + "desktop", + "both" +]
- Changed
get_network_analysis1 field changed- changed
Input schema / properties / strategy / enumPrevious value: -[ - "mobile", - "desktop" -]New value: +[ + "mobile", + "desktop", + "both" +]
- Changed
get_performance_map1 field changed- changed
Input schema / properties / strategy / enumPrevious value: -[ - "mobile", - "desktop" -]New value: +[ + "mobile", + "desktop", + "both" +]
- Changed
get_performance_summary1 field changed- changed
Input schema / properties / strategy / enumPrevious value: -[ - "mobile", - "desktop" -]New value: +[ + "mobile", + "desktop", + "both" +]
- Changed
get_recommendations1 field changed- changed
Input schema / properties / strategy / enumPrevious value: -[ - "mobile", - "desktop" -]New value: +[ + "mobile", + "desktop", + "both" +]
- Changed
get_render_blocking_details1 field changed- changed
Input schema / properties / strategy / enumPrevious value: -[ - "mobile", - "desktop" -]New value: +[ + "mobile", + "desktop", + "both" +]
- Changed
get_third_party_impact1 field changed- changed
Input schema / properties / strategy / enumPrevious value: -[ - "mobile", - "desktop" -]New value: +[ + "mobile", + "desktop", + "both" +]
- Changed
get_visual_analysis1 field changed- changed
Input schema / properties / strategy / enumPrevious value: -[ - "mobile", - "desktop" -]New value: +[ + "mobile", + "desktop", + "both" +]
1 tool update
v1.5.0- Added
get_origin_crux
1 tool update
v1.4.0- Added
get_performance_map
3 tool updates
v1.2.7- Added
get_javascript_analysis - Added
get_network_analysis - Added
get_third_party_impact
3 tool updates
v1.2.6- Removed
get_javascript_analysis - Removed
get_network_analysis - Removed
get_third_party_impact
16 tool updates
v1.2.2- First observed
analyze_page_speed - First observed
batch_analyze - First observed
clear_cache - First observed
compare_pages - First observed
crux_summary - First observed
full_report - First observed
get_element_analysis - First observed
get_full_audit - First observed
get_image_optimization_details - First observed
get_javascript_analysis - First observed
get_network_analysis - First observed
get_performance_summary - First observed
get_recommendations - First observed
get_render_blocking_details - First observed
get_third_party_impact - First observed
get_visual_analysis
TDQS
Each tool has a distinct workflow: single-page analysis, batch analysis, focused diagnostics, field data, comparisons/baselines, and cache control. The only mild overlap is between analyze_page with audit/recommendation reports and diagnose_page, but the descriptions explicitly position diagnose as a follow-up for specific problem areas.
All tools share a consistent pagespeed_ prefix followed by a clear verb_noun pattern: analyze_page, diagnose_page, get_field_data, compare_pages, analyze_batch, clear_cache. The naming is predictable, uniform, and makes the action and target easy to infer.
Six tools is a well-scoped set for a PageSpeed Insights server. Each tool covers a meaningful part of the workflow without redundancy or bloat, and the count feels appropriate for both simple and more advanced performance analysis tasks.
The tool surface covers the core domain well: single and batch Lighthouse analysis, targeted diagnostics, real-user field data, comparison/baselining, and cache management. There are no obvious dead ends or missing operations that would prevent an agent from completing a typical PageSpeed investigation.
Maintenance
Related MCP Connectors
- RampifyOAuthdev.rampify
SEO MCP server: crawl your site, find AI-visibility gaps, and ship the fix from your coding agent.
Marketo MCP server for AI. 130 tools to operate Marketo from Claude, Cursor, or ChatGPT.
Cloudflare Workers MCP server: api-perf-analyzer
Pay-per-call AI evaluation MCP server. Score LLM outputs against benchmark rubrics via Workers AI.
Related MCP Servers
- AlicenseAqualityDmaintenanceCore Web Vitals analysis powered by Lighthouse. Four tools: analyze a URL, compare two URLs, check against thresholds, or crawl an entire site. Works with Claude Code, Cursor, Windsurf, and any MCP-compatible AI tool.420MIT
- FlicenseNot gradedqualityCmaintenanceAn MCP server that wraps the Google PageSpeed Insights API to analyse web performance, providing tools for scores, Core Web Vitals, opportunities, diagnostics, and batch analysis.-
- AlicenseNot gradedqualityCmaintenanceThis MCP server integrates Google PageSpeed Insights to analyze website performance, accessibility, best practices, SEO, and PWA on mobile and desktop, returning detailed audits and optimization opportunities.MIT
- AlicenseNot gradedqualityBmaintenanceAn MCP server that pulls PageSpeed Insights and Google Search Console data across multiple owned sites, enabling cross-site performance reports and synthesis via Claude.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ruslanlap/pagespeed-insights-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server