wp-mcp
wp-mcp
![]()
MCP 服务器,可将 Claude Code 变成一位完整的 WordPress 操作员——内容、媒体、插件、主题,以及直接编辑主题文件——适用于任何站点,包括没有 SSH/WP-CLI 的共享主机。
工作原理
由两部分组成:
bridge/wp-mcp-connector.zip——一个为每个站点上传一次的小型 WordPress 插件。它提供基于令牌的连接、文件端点(限定在wp-content范围内)、插件/主题安装器,以及一个独立的rescue.php,即使损坏的 PHP 编辑已导致站点宕机,也能恢复备份。server.mjs——在 Claude Code 中注册的 MCP 服务器。它与该插件以及 WordPress 的核心 REST API 通信。
连接生命周期(完整的安全模型)
在站点上上传
wp-mcp-connector.zip(插件 → 安装插件 → 上传插件)并启用它。在 wp-admin → 设置 → WP MCP → 生成令牌(选择有效期:1 小时 / 8 小时 / 24 小时 / 7 天)。 令牌仅显示一次。新令牌会替换之前的任何令牌。
告诉 Claude:
connect to https://example.com with token wpmcp_xxx, call it "clientx"。开始工作:编辑主题文件、安装插件、撰写文章,随你操作。
说
disconnect from clientx——令牌会在站点上被吊销,并在本地被遗忘。下次会话:生成一个新令牌,重新连接。
任何地方都不会留有常驻凭据。sites.json(已加入 .gitignore,chmod 600)只保存当前已连接的站点。
Related MCP server: AutoWP MCP Server
设置(仅需一次,在这台 Mac 上执行)
cd ~/mcp/wp-mcp && npm install
claude mcp add --scope user wordpress -- node ~/mcp/wp-mcp/server.mjs工具
工具 | 作用 |
| 连接生命周期 |
| 文章、页面、任意自定义文章类型 |
| 本地文件 → 媒体库 |
| 列出 / 安装(wp.org 的 slug 或 zip URL)/ 启用 / 停用 / 更新 / 删除 |
| 列出 / 安装 / 启用 / 删除 |
| 直接操作 |
| 从自动生成的 |
| 更改后清除已知的页面缓存(Jetpack Boost、WP Super Cache / W3TC、LiteSpeed) |
| 原始 REST 逃生通道( |
安全说明
每次对现有文件执行
wp_file_write时,都会先保存<file>.wpmcp-bak。如果对functions.php的编辑导致站点白屏,wp_file_restore仍然有效:rescue.php在完全不加载 WordPress 的情况下运行。文件访问仅限于
wp-content。要允许访问整个 WP 根目录(例如编辑wp-config.php),请在 wp-config.php 中添加define('WPMCP_ALLOW_FULL', true);。仅使用 HTTPS 站点——令牌会在请求头中传输。
某些共享主机会剥离
Authorization请求头;服务器还会发送X-WPMCP-Token,该请求头在所有测试过的环境中均不会丢失。在多站点(multisite)环境中,插件/主题安装需要超级管理员的令牌。
传递给
wp_content_create/wp_content_update的 HTML 默认会包裹在原始 HTML(raw HTML)块中,这样 WordPress 的 autop 过滤器就无法重新格式化结构化标记(传入autop_safe: false可选择退出)。所有请求都会发送类似浏览器的 User-Agent——某些共享主机的 WAF 会以不透明的 403 拒绝非浏览器代理。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityAmaintenanceEnables comprehensive WordPress site management through natural language in Claude Desktop, supporting multiple sites with 59 tools for content creation, media management, user administration, and performance monitoring.71363102MIT
- AlicenseBqualityBmaintenanceConnects Claude to WordPress sites through the REST API, enabling AI-assisted content creation, publishing, media management, user administration, and site maintenance tasks through natural language.472222MIT
- AlicenseNot gradedqualityFmaintenanceEnables AI models like Claude to manage WordPress sites through the WordPress REST API, supporting operations like post creation, taxonomy management, and site configuration. It features secure authentication via Application Passwords and provides tools for comprehensive content administration.681MIT
- AlicenseNot gradedqualityBmaintenanceEnables Claude Code to read, edit, and manage WordPress pages, posts, shortcodes, and media via the WordPress REST API.93MIT
Related MCP Connectors
Security-first WordPress MCP server. 129 tools for Claude, ChatGPT, Gemini. Free on wp.org.
Live SEO workflow tools for Claude Code, Codex, and AI agents.
Publish to self-hosted WordPress from AI agents: markdown, images, SEO, and Notion sync.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/srimalonline/wp-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server