PP

phialsbasement/pagespeed-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

13 stars 10 forks 质量 59 趋势 20MIT

使用此 MCP 服务器拉出页面速度数据 .

概览

一个模型上下文协议(MCP)服务器,可以扩展带有PageSpeed Insights功能的AI助手能力. 这个服务器充当了AI模型和Google的"PageSpeed Inspects API"之间的桥梁,能够对网站进行详细的性能分析. PageSpeed MCP服务器通过允许AI助手进行全面的网络性能分析来增强他们的能力. 集成后,AI模型可以为任何给定的URL请求和解释详细的性能度量表,Core Web Vitals,以及其他关键的网络性能数据.

概述(AI 翻译)

一个模型上下文协议(MCP)服务器,可以扩展带有PageSpeed Insights功能的AI助手能力. 这个服务器充当了AI模型和Google的"PageSpeed Inspects API"之间的桥梁,能够对网站进行详细的性能分析.

□ 概览

PageSpeed MCP服务器通过允许AI助手进行全面的网络性能分析来增强他们的能力. 集成后,AI模型可以为任何给定的URL请求和解释详细的性能度量表,Core Web Vitals,以及其他关键的网络性能数据.

□ 安装

通过 Smithery 安装

要通过 Smithery 为 Claude 桌面自动安装 PageSpeed 服务器 :

手动安装

□ 配置

将 PageSpeed MCP 添加到您的 AI 助手( 在此情况下为 Claude) 配置文件 :

□ 详细能力

性能计量分析

  • 第一幅内容丰富的绘画
  • 内容最丰富的油漆(LCP)
  • 互动时间(TTI)
  • 总封锁时间(TBT)
  • 累积布局变化( CLS)
  • 速度指数
  • 第一字节的时间(TTFB)

最佳做法评估

  • HTTPS的使用
  • JavaScript 错误监测
  • 浏览器控制台警告
  • 折旧的API用途

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

PageSpeed MCP Server

A Model Context Protocol (MCP) server that extends AI assistant capabilities with PageSpeed Insights functionality. This server acts as a bridge between AI models and Google’s PageSpeed Insights API, enabling detailed performance analysis of websites.

Overview

The PageSpeed MCP server is designed to enhance AI assistants’ capabilities by allowing them to perform comprehensive web performance analysis. When integrated, AI models can request and interpret detailed performance metrics, Core Web Vitals, and other critical web performance data for any given URL.

Installation

Installing via Smithery

To install PageSpeed Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install mcp-pagespeed-server --client claude

Manual Installation

npm install pagespeed-mcp-server

Configuration

Add the PageSpeed MCP to your AI assistant’s(claude in this case) configuration file:

{
    "pagespeed": {
        "command": "node",
        "args": ["path/to/mcp-pagespeed-server/dist/index.js"],
        "env": {
           "GOOGLE_API_KEY": ""
        }
    }
}

Detailed Capabilities

Performance Metrics Analysis

  • First Contentful Paint (FCP)
  • Largest Contentful Paint (LCP)
  • Time to Interactive (TTI)
  • Total Blocking Time (TBT)
  • Cumulative Layout Shift (CLS)
  • Speed Index
  • Time to First Byte (TTFB)

Best Practices Assessment

  • HTTPS usage
  • JavaScript error monitoring
  • Browser console warnings
  • Deprecated API usage
  • Image aspect ratio analysis
  • Link security checks

SEO Analysis

  • Meta description validation
  • Robots.txt validation
  • Structured data validation
  • Crawlable links verification
  • Meta tags assessment
  • Mobile friendliness

Accessibility Audits

  • ARIA attribute validation
  • Color contrast checking
  • Heading hierarchy analysis
  • Alt text verification
  • Focus management assessment
  • Keyboard navigation testing

Resource Optimization

  • Image optimization suggestions
  • JavaScript bundling analysis
  • CSS optimization recommendations
  • Cache policy validation
  • Resource minification checks
  • Render-blocking resource identification

API Response Structure

The MCP server provides detailed JSON responses including:

{
    "lighthouseResult": {
        "categories": {
            "performance": { /* Performance metrics */ },
            "accessibility": { /* Accessibility results */ },
            "best-practices": { /* Best practices audit */ },
            "seo": { /* SEO findings */ }
        },
        "audits": {
在 GitHub 查看完整 README

安装

npx -y @smithery/cli install mcp-pagespeed-server --client claude
新手?先看 mcpskill.org 教程 →