Back to MCP directory
publicPublicdnsLocal runtime

enemyrr_mcp-server-pagespeed

一个基于Model Context Protocol的服务,提供Google PageSpeed Insights网页性能分析功能,使AI模型能通过标准化接口评估网页加载表现。

article

README

🚀 @enemyrr/mcp-server-pagespeed

这是一个提供谷歌页面速度洞察分析的模型上下文协议(MCP)服务器。借助该服务器的统一接口,AI模型能够对网页性能进行分析。

点击访问

🚀 快速开始

📦 安装指南

在 Cursor IDE 中的安装与配置

  1. 克隆项目并构建:
git clone https://github.com/enemyrr/mcp-server-pagespeed.git
cd mcp-server-pagespeed
npm install
npm run build
  1. 在 Cursor IDE 设置中添加服务器:
    • 打开命令面板(Cmd/Ctrl + Shift + P)
    • 搜索“MCP: 添加服务器”
    • 填写字段:
      • 名称:pagespeed
      • 类型:command
      • 命令:node /绝对路径/to/mcp-server-pagespeed/build/index.js

⚠️ 重要提示

请将 /absolute/path/to/ 替换为实际克隆并构建项目的路径。

命令行使用

直接运行:

npx mcp-server-pagespeed

💻 使用示例

基础用法

use_mcp_tool({
  server_name: "pagespeed",
  tool_name: "analyze_pagespeed",
  arguments: {
    url: "https://example.com"
  }
});

高级用法

上述代码使用谷歌页面速度洞察 API 分析网页。该工具返回以下内容:

  • 整体性能得分(0 - 100)
  • 加载体验指标
    • 首内容绘制时间(FCP)
    • 首输入延迟(FID)
  • 顶部5条改进建议,包括:
    • 标题
    • 描述
    • 潜在影响
    • 当前值

✨ 主要特性

  • 网页性能实时分析
  • 详细的加载体验指标
  • 优先级排序的改进建议
  • 详尽的错误处理
  • TypeScript 支持

🔧 技术细节

该服务器为以下情况提供详细错误信息:

  • 无效 URL
  • API 请求失败
  • 连接问题
  • 无效工具调用

🤝 贡献指南

欢迎贡献!请随意提交 Pull Request 到 项目仓库

📄 许可证

本项目采用 MIT 许可证。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client