
一个提供Google PageSpeed Insights分析的模型上下文协议服务器. 这个服务器使AI模型能够通过标准化的界面分析网页性能.
概览
一个提供Google PageSpeed Insights分析的模型上下文协议服务器. 这个服务器使AI模型能够通过标准化的界面分析网页性能. 2. 在 Cursor IDE 设置中添加服务器: - 打开命令调色板(Cmd/Ctrl + Shift + P) - 搜索"MCP: 添加服务器" - 填入字段: - 名称:页面速度 - 类型:命令 - 命令:节点/绝对/path/to/mcp-server-pagespeed/building/index.js : 将/绝对/路径/去/替换为您克隆和构建工程的实际路径. 使用 Google PageSpeed Insights API 分析一个网页.
概述(AI 翻译)
一个提供Google PageSpeed Insights分析的模型上下文协议服务器. 这个服务器使AI模型能够通过标准化的界面分析网页性能.
□ 为光标 IDE 安装和设置
-
克隆和建设项目:
-
在光标 IDE 设置中添加服务器 :
- 打开命令调色板(Cmd/Ctrl + Shift + P)
- 搜索“ MCP: 添加服务器”
- 填入:
- 名称:
pagespeed - 类型:
command - 命令:
node /absolute/path/to/mcp-server-pagespeed/build/index.js
** 注**:将
/absolute/path/to/替换为您克隆和构建项目的实际路径。
□命令行使用
只要运行:
□ 可用的工具
QQ 分析页速 使用 Google PageSpeed Insights API 分析一个网页.
工具返回 :
- 总体业绩得分(0-100)
- 装入经验衡量标准
- 第一幅内容丰富的画
- 第一次输入延迟
- 五大改进建议:
- 标题
- 说明
- 潜在影响
- 现值
□ 特性
- 实时网页业绩分析
- 详细的加载经验衡量标准
- 优先改进建议
- 全面处理错误
- 类型脚本支持
□ 处理错误
本页由 AI 翻译,技术细节请以原文为准。
README
@enemyrr/mcp-server-pagespeed
A Model Context Protocol server that provides Google PageSpeed Insights analysis. This server enables AI models to analyze webpage performance through a standardized interface.
Installation & Setup for Cursor IDE
- Clone and build the project:
git clone https://github.com/enemyrr/mcp-server-pagespeed.git
cd mcp-server-pagespeed
npm install
npm run build
- Add the server in Cursor IDE settings:
- Open Command Palette (Cmd/Ctrl + Shift + P)
- Search for “MCP: Add Server”
- Fill in the fields:
- Name:
pagespeed - Type:
command - Command:
node /absolute/path/to/mcp-server-pagespeed/build/index.js
- Name:
Note: Replace
/absolute/path/to/with the actual path where you cloned and built the project.
Command-line Usage
Just run:
npx mcp-server-pagespeed
Available Tools
analyze_pagespeed
Analyze a webpage using Google PageSpeed Insights API.
use_mcp_tool({
server_name: "pagespeed",
tool_name: "analyze_pagespeed",
arguments: {
url: "https://example.com"
}
});
The tool returns:
- Overall performance score (0-100)
- Loading experience metrics
- First Contentful Paint
- First Input Delay
- Top 5 improvement suggestions with:
- Title
- Description
- Potential impact
- Current value
Features
- Real-time webpage performance analysis
- Detailed loading experience metrics
- Prioritized improvement suggestions
- Comprehensive error handling
- TypeScript support
Error Handling
The server provides detailed error messages for:
- Invalid URLs
- API request failures
- Connection issues
- Invalid tool calls
Contributing
Contributions are welcome! Please feel free to submit a Pull Request to https://github.com/enemyrr/mcp-server-pagespeed
License
MIT
安装
npx mcp-server-pagespeed