Token导航 LogoToken导航TokenDH.com
Wp Audit MCP logo
运维云端未说明官方级别未说明来源级核验

Wp Audit MCP

MCP Server

一个专为WP Engine上的WordPress网站设计的审计和优化工具,通过MCP服务器提供自动化的网站审计、数据库清理、SEO检查和CloudFlare设置修复功能。

工具数

10

提示词数

0

GitHub Stars

1

资源数

0
TypeScriptClaude云端部署Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

markahope-aag

提供方

markahope-aag

最后核验

2026/5/17 20:20

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

WP审核MCP服务器

MCP(模型上下文协议)服务器,用于在WP引擎上进行全面的WordPress站点审核。

这是什么?

这是一个MCP服务器,它提供 克劳德代码 用于审计和优化WP Engine上托管的WordPress网站的专用工具。您不必手动运行PHP脚本和API调用,只需让Claude审核网站,它就会自动使用这些工具。

运作原理

┌─────────────────────────────────────────────────────────────────┐
│ Your Computer                                                   │
│                                                                 │
│  Claude Code ◄──stdio──► wp-audit-mcp (Node.js)                │
│                               │                                 │
│                               ├──SSH──► WP Engine sites         │
│                               │         (runs WP-CLI/PHP)       │
│                               │                                 │
│                               └──HTTPS──► CloudFlare API        │
└─────────────────────────────────────────────────────────────────┘
  1. 克劳德代码 将MCP服务器作为本地子进程启动
  2. 它们通过stdin/stdout(非网络)进行通信
  3. 当你让克劳德审计一个网站时,它会调用MCP工具
  4. MCP服务器通过SSH连接到WP引擎并运行PHP脚本
  5. 对于CloudFlare,它直接进行API调用

特性

工具说明
wp_baseline完整的网站审计(内容计数、数据库大小、SEO状态、插件工件)
wp_cleanup数据库清理(孤立数据、修订、瞬态、操作调度器)
wp_plugin_artifacts从已删除的插件中删除剩余的表/选项
wp_seo_check检查元描述覆盖率
wp_seo_fix自动生成或手动设置元描述
wp_rocket_fix检查并优化WP Rocket设置
wp_clear_cache清除所有缓存(WordPress、WP Rocket、页面构建器、WP引擎)
cloudflare_check审核CloudFlare安全设置
cloudflare_fix应用推荐的CloudFlare设置
ahrefs_extract解析和总结Ahrefs网站审计导出

______________________________________________________________________

安装

先决条件

1.Node.js 18+

下载自 或使用版本管理器:

# Check your version
node --version  # Should be v18.x or higher

# macOS (with Homebrew)
brew install node

# Windows (with Chocolatey)
choco install nodejs

# Linux (Ubuntu/Debian)
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs

2.克劳德密码

如果你还没有安装Claude Code:

npm install -g @anthropic-ai/claude-code

3.SSH访问WP引擎

您需要对WP引擎站点进行基于SSH密钥的身份验证。

生成SSH密钥(如果您没有):

ssh-keygen -t ed25519 -C "your-email@example.com"

将您的公钥添加到WP引擎:

  1. 登录 WP引擎门户
  2. 首选 我的资料SSH密钥
  3. 点击 添加SSH密钥
  4. 粘贴内容 ~/.ssh/id_ed25519.pub

测试连接:

# Replace SITEID with your WP Engine environment name
ssh SITEID@SITEID.ssh.wpengine.net 'echo "Connected successfully"'

4.CloudFlare Global API密钥(可选)

仅当您想使用CloudFlare工具时才需要。

  1. 登录 CloudFlare仪表板
  2. 单击您的个人资料图标→ 我的资料
  3. 首选 API令牌 标签
  4. 找到 全球API密钥 → Click 视图
  5. 复制密钥(运行CloudFlare工具时需要此密钥)

注: 使用全局API密钥,而不是API令牌。全球API密钥适用于所有区域。

______________________________________________________________________

分步安装

步骤1:克隆存储库

# Clone to a permanent location (not in a project folder)
git clone https://github.com/markahope-aag/wp-audit-mcp.git ~/wp-audit-mcp

# Or on Windows
git clone https://github.com/markahope-aag/wp-audit-mcp.git C:\tools\wp-audit-mcp

步骤2:安装依赖关系并构建

cd ~/wp-audit-mcp   # or C:\tools\wp-audit-mcp on Windows

# Install Node.js dependencies
npm install

# Build the TypeScript code
npm run build

你应该看到一个 dist/ 使用编译的JavaScript创建的文件夹。

步骤3:配置Claude代码

克劳德代码使用 .mcp.json 了解MCP服务器的文件。您需要将此服务器添加到该文件中。

选项A:使用配置脚本

# Run from your project directory (where you use Claude Code)
~/wp-audit-mcp/configure.sh .

# Windows
C:\tools\wp-audit-mcp\configure.sh .

选项B:手动配置

创建或编辑 .mcp.json 在您的项目目录中:

{
  "mcpServers": {
    "wp-audit": {
      "command": "node",
      "args": ["/Users/yourname/wp-audit-mcp/dist/index.js"]
    }
  }
}

重要提示: 使用完整的绝对路径 dist/index.js:

  • macOS/Linux: /Users/yourname/wp-audit-mcp/dist/index.js
  • 窗户: C:/tools/wp-audit-mcp/dist/index.js (使用正斜杠)

步骤4:重新启动Claude代码

# Start Claude Code in your project directory
cd /path/to/your/project
claude

当Claude Code启动时,它将自动启动MCP服务器。您应该看到它连接时没有错误。

步骤5:验证安装

问克劳德:

What MCP tools do you have available for WordPress audits?

Claude应该列出wp_baseline、wp_cleanup和其他工具。

______________________________________________________________________

配置详情

.mcp.json文件

.mcp.json 文件告诉克劳德代码启动哪些MCP服务器。它可以放置在:

  • 项目目录 (推荐)-该项目可用的工具
  • 主目录 (~/.mcp.json)-全球可用的工具

多服务器示例:

{
  "mcpServers": {
    "wp-audit": {
      "command": "node",
      "args": ["/Users/yourname/wp-audit-mcp/dist/index.js"]
    },
    "memory": {
      "command": "npx",
      "args": ["-y", "@anthropic/mcp-memory"],
      "env": {
        "MEMORY_FILE_PATH": "./.claude/memory.json"
      }
    }
  }
}

工具如何连接到WP引擎

MCP服务器使用SSH连接到WP引擎并运行WP-CLI命令:

# This is what happens behind the scenes
ssh SITEID@SITEID.ssh.wpengine.net 'wp eval-file /tmp/script.php'

site_id 您提供的参数是 WP引擎环境名称,您可以在以下网址找到:

  • WP引擎门户URL: my.wpengine.com/installs/SITEID
  • 或者在网站的“概述”页面中

SSH配置(可选)

为了方便起见,您可以将WP引擎站点添加到 ~/.ssh/config:

Host wpengine-mysite
    HostName mysite.ssh.wpengine.net
    User mysite
    IdentityFile ~/.ssh/id_ed25519

这不会影响MCP服务器的工作方式,但会使手动SSH更容易。

______________________________________________________________________

用法

基本命令

安装后,只需自然地与Claude交谈:

Audit the WordPress site "mysite" on WP Engine

或者更具体地说:

Use wp_baseline with site_id "mysite"

示例会话

You: I need to audit the site "clientsite" - check SEO, clean up the database,
     and fix CloudFlare settings. Zone ID is abc123def456.

Claude: I'll run a comprehensive audit. Let me start with the baseline...
        [Uses wp_baseline]

        Now checking SEO meta descriptions...
        [Uses wp_seo_check]

        I found 15 pages missing meta descriptions. Should I auto-generate them?

You: Yes, generate them.

Claude: [Uses wp_seo_fix with mode "auto"]
        Done. Now checking CloudFlare...
        [Uses cloudflare_check]

        Found issues: SSL is "flexible" (should be "full"), TLS 1.0 (should be 1.2).
        Should I fix these?

You: Yes, fix all CloudFlare issues.

Claude: [Uses cloudflare_fix]
        All CloudFlare settings updated. Let me clear all caches...
        [Uses wp_clear_cache]

        Audit complete! Here's the summary...

______________________________________________________________________

工具参考

wp_baseline

在WordPress网站上运行全面的基线审计。

Parameters:
  site_id: WP Engine environment name (required)

Returns: Content counts, database size, orphaned data, SEO status,
         WP Rocket settings, deleted plugin artifacts

wp_清理

清理孤立数据并优化数据库。

Parameters:
  site_id: WP Engine environment name (required)
  delete_revisions: Delete post revisions (default: true)

Actions: Removes orphaned postmeta, termmeta, commentmeta, auto-drafts,
         transients, old action scheduler entries. Closes pingbacks.

wp_pluginartifacts

从已删除的插件中删除数据库工件。

Parameters:
  site_id: WP Engine environment name (required)
  plugins: Array of plugins to clean (optional - cleans all if empty)
           Options: yoast, rankmath, aioseo, wsal, revslider,
                    layerslider, woocommerce, jetpack
  dry_run: Preview changes without applying (default: false)

Actions: Drops orphaned tables, deletes leftover options

wp_seo_check

检查页面/帖子的元描述状态。

Parameters:
  site_id: WP Engine environment name (required)
  post_type: 'page', 'post', or 'all' (default: 'page')

Returns: Count of pages with/without meta descriptions, list of missing

wp_seo_fix

向内容添加元描述。

Parameters:
  site_id: WP Engine environment name (required)
  mode: 'auto' or 'manual' (default: 'auto')
  post_type: For auto mode (default: 'page')
  descriptions: For manual mode - {postId: "description"} object
  dry_run: Preview changes (default: false)

Auto mode: Extracts first 155 chars from page content
Manual mode: Sets specific descriptions for specific post IDs

wp_rocket_fix

检查并修复WP火箭设置。

Parameters:
  site_id: WP Engine environment name (required)
  dry_run: Preview changes (default: false)

Fixes: Enables cache preload, sitemap preload, lazy loading, mobile cache

wp_clear_cache

清除网站上的所有缓存。

Parameters:
  site_id: WP Engine environment name (required)

Clears: WordPress object cache, transients, WP Rocket, WP Super Cache,
        Elementor, Beaver Builder, Divi, WP Engine page cache

cloudflare_check

检查CloudFlare安全和性能设置。

Parameters:
  zone_id: CloudFlare Zone ID (required)
  email: CloudFlare account email (required)
  api_key: CloudFlare Global API Key (required)

Checks: SSL mode, min TLS version, HSTS, Bot Fight Mode,
        AI bot protection, crawler protection

cloudflare_fix

应用推荐的CloudFlare设置。

Parameters:
  zone_id: CloudFlare Zone ID (required)
  email: CloudFlare account email (required)
  api_key: CloudFlare Global API Key (required)
  fix_ssl: Fix SSL to 'full' (optional)
  fix_tls: Fix min TLS to 1.2 (optional)
  fix_hsts: Enable HSTS with 6-month max-age (optional)
  fix_bots: Enable bot protection (optional)
  fix_all: Apply all fixes (default: auto-detects what's needed)

ahrefs_提取物

提取并总结Ahrefs站点审计ZIP文件。

Parameters:
  zip_path: Full path to Ahrefs ZIP export (required)
  output_dir: Directory to extract to (optional)

Returns: Summary of errors, warnings, and notices from the audit

______________________________________________________________________

典型审计工作流程

  1. 基线: wp_baseline -了解网站的当前状态
  2. 阿雷夫斯: ahrefs_extract -解析Ahrefs审计文件(如果提供)
  3. 云耀: cloudflare_checkcloudflare_fix -修复安全设置
  4. 数据库: wp_cleanupwp_plugin_artifacts -清理数据库
  5. 搜索引擎优化: wp_seo_checkwp_seo_fix -修复缺失的元描述
  6. 缓存: wp_rocket_fix -优化WP火箭
  7. 完成: wp_clear_cache -清除所有缓存

______________________________________________________________________

故障排除

“SSH连接失败”

  1. 验证SSH密钥是否已添加到WP引擎门户
  2. 手动测试: ssh SITEID@SITEID.ssh.wpengine.net 'echo test'
  3. 检查一下 site_id 与WP引擎环境名称完全匹配

“找不到MCP服务器”

  1. 验证中的路径 .mcp.json 绝对正确
  2. 检查一下 npm run build 已完成,无错误
  3. 验证 dist/index.js 存在

“CloudFlare身份验证失败”

  1. 使用 全球API密钥,不是API令牌
  2. 验证电子邮件是否与您的CloudFlare登录信息匹配
  3. 检查区域ID是否正确(在CloudFlare仪表板概述中找到)

工具未出现在Claude中

  1. 完全重新启动Claude代码
  2. 检查 .mcp.json 位于当前目录中
  3. Claude代码启动时查找错误

______________________________________________________________________

支持的平台

  • 视窗 -通过Git Bash、WSL或原生(路径中有正斜杠)
  • macOS -本地终端
  • Linux -本地终端

______________________________________________________________________

发展

# Run in development mode (watches for changes)
npm run dev

# Build for production
npm run build

# The server communicates via stdio, so to test manually:
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | node dist/index.js

______________________________________________________________________

许可证

麻省理工学院

______________________________________________________________________

贡献

问题和拉取请求欢迎访问 .

目录标签

目录标签

TypeScriptClaude云端部署WordPress审计本地部署网站优化数据库清理SEO工具CloudFlare配置

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

api-key

工具数量(toolCount,工具数)

10

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明api-key部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP