WordPress管理服务

通过Claude Code配置MCP服务器,实现对WordPress站点的全面管理,包括文章、页面、媒体、SEO和缓存等功能。

  • by arturseo-geo
  • 本地部署
  • 3 星标
  • 更新于
在 GitHub 查看 arturseo-geo/mcp-wordpress-setup

使用说明

Claude代码的WordPress MCP服务器设置

建造于 阿图尔·费雷拉 @ GEO实验室 · 𝕏 @TheGEO_Lab · 领英 · 红迪

配置的分步指南 mcp wordpress MCP服务器 克劳德代码,让Claude完全可以通过REST API管理你的WordPress网站-帖子、页面、媒体、SEO、缓存等等。

包括a 关键解决方法 对于一个bug mcp-wordpress v3.1.13,其中已发布的bin入口点无法启动。

这是给谁的

  • Claude Code用户 谁想从CLI管理WordPress
  • WordPress开发人员 首次设置MCP
  • 任何尝试过mcp wordpress的人 并遭遇了无声的失败(垃圾桶漏洞)

这涵盖了什么

  • ✅ 先决条件 --Node.js版本要求,Claude代码安装
  • ✅ 应用程序密码创建 --逐步WordPress管理员演练
  • ✅ .mcp.json 配置 --使用正确的路径验证工作配置
  • ✅ 关键垃圾箱错误解决方法 --为什么 mcp-wordpress 二进制在v3.1.13中无声失败以及如何指向 dist/index.js 相反
  • ✅ 路径发现 --用于查找Node.js二进制文件和mcp wordpress安装位置的命令
  • ✅ 验证 --如何确认MCP服务器正在运行
  • ✅ 生产测试 --生产中使用的图案 thegeolab.net

快速开始

# 1. Install mcp-wordpress
npm install -g mcp-wordpress

# 2. Create Application Password in WordPress admin
#    Users > Profile > Application Passwords

# 3. Add to ~/.mcp.json (IMPORTANT: use dist/index.js, not the bin script)
{
  "mcpServers": {
    "wordpress": {
      "command": "/path/to/node",
      "args": ["/path/to/node_modules/mcp-wordpress/dist/index.js"],
      "env": {
        "WORDPRESS_SITE_URL": "https://your-site.com",
        "WORDPRESS_USERNAME": "your-username",
        "WORDPRESS_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
      }
    }
  }
}
# 4. Find your paths
which node                                          # Node binary
echo "$(npm root -g)/mcp-wordpress/dist/index.js"  # mcp-wordpress entry point

垃圾桶漏洞(v3.1.13)

已发布的二进制文件(bin/mcp-wordpress.js)包含一个 isMainModule 当Node通过bin符号链接调用文件时,检查失败。因此,呼叫 mcp-wordpress 直接会默默地什么都不做-- main() 从不执行。

修复: 将MCP配置指向 dist/index.js 而不是二进制。这反映在上面的配置中。

相关转载


由以下人员建造和维护 阿图尔·费雷拉 · thegeolab.net · MIT许可证