wpagent-mcp
wpagent-mcp
一个 MCP 服务器,让 Claude —— 或任何兼容 MCP 的客户端 —— 真正操作 WordPress 站点:插件、内容、主题、菜单、媒体、用户、WooCommerce、Elementor 和 WP-CLI。
它通过免费的 WpAgent 桥接插件,经 REST API 与你的站点通信,每个请求都使用 HMAC-SHA256 签名。不涉及任何站点凭据,也没有数据经过第三方服务:连接就是客户端 → 你的 WordPress,直连。
安装
无需提前安装任何东西 —— 下面的配置会按需获取它。
在你的 WordPress 站点上安装 WpAgent 插件并激活它。
在 WordPress 管理后台中,打开 WpAgent 并生成一个 API 密钥。选择你希望助手拥有的权限;只读密钥是稳妥的起步方式。
将服务器添加到你的 MCP 客户端。对于 Claude Desktop,在
claude_desktop_config.json中:
{
"mcpServers": {
"wpagent": {
"command": "npx",
"args": ["-y", "wpagent-mcp"],
"env": {
"WP_SITE_URL": "https://your-site.com",
"WP_API_KEY_ID": "wpaia_xxxxxxxxxxxx",
"WP_API_SECRET": "the secret shown once when you generated the key"
}
}
}
}对于 Claude Code:
claude mcp add wpagent \
--env WP_SITE_URL=https://your-site.com \
--env WP_API_KEY_ID=wpaia_xxxxxxxxxxxx \
--env WP_API_SECRET=... \
-- npx -y wpagent-mcp环境变量
变量 | 必需 | 说明 |
| 是 | 你站点的基础 URL,无尾部斜杠 |
| 是 | 插件中显示的密钥 ID |
| 是 | 密钥,生成时仅显示一次 |
| 否 | 一个友好名称;默认为主机名 |
Related MCP server: Bridgistic
它能做什么
区域 | 示例 |
插件 | 列出、搜索 wordpress.org、安装、激活、停用、更新、删除 |
内容 | 文章、页面、产品、任意自定义文章类型,支持元数据和特色图片 |
主题 | 列出、搜索、安装、激活、主题修改、自定义 CSS、标志、颜色 |
WooCommerce | 设置、订单、优惠券、配送区域、支付网关、税率、统计 |
结构 | 菜单、小工具、侧边栏、分类法、术语、重定向 |
媒体 | 浏览、上传、删除 |
用户与评论 | 列出、创建、更新、审核 |
审计 | 对安全性、SEO、性能进行最佳实践检查,支持自动修复 |
WP-CLI | 允许列表中的命令,默认关闭,除非在 |
它不会做什么
该 API 无法访问任意 PHP、无法访问你的数据库、也无法访问 wp-config.php。WP-CLI 执行处于禁用状态,除非站点所有者在服务器上添加 define('WPAIA_ENABLE_WPCLI', true);,即便如此,也只运行允许列表中的命令 —— db、eval、eval-file、shell、server、config 和 package 始终被拒绝。
安全性
每个请求都使用 HMAC-SHA256 签名并带有时间戳;超过五分钟的请求会被拒绝。
权限按密钥划分,并在每条路由上进行检查,因此只读密钥始终保持只读。
每次调用都会写入审计日志,你可以在 WordPress 管理后台中查看。
在 WordPress 中吊销密钥会立即生效。
在执行破坏性操作前,请让助手先确认,并保留一份最新备份 —— 当你要求时,它可以删除内容。
相关项目
WpAgent —— 基于同一桥接插件构建的托管仪表盘,提供免费的只读套餐
桥接插件采用 GPL-2.0-or-later 许可;本服务器采用 MIT 许可。
许可证
MIT © KipDev
Available Tools
58 toolswp_activate_pluginA
Activate an installed WordPress plugin. You can provide the plugin file path (e.g. "woocommerce/woocommerce.php"), slug (e.g. "woocommerce"), or name.
Inputs: plugin (required).
wp_activate_themeA
Switch the active WordPress theme. Provide the theme slug (directory name).
Inputs: slug (required).
wp_audit_best_practicesA
Audit the WordPress site for best practices. Returns a checklist covering security (SSL, debug mode, file editing, admin user, XML-RPC, spam protection, security plugin), SEO (permalinks, SEO plugin), performance (caching plugin), maintenance (backups, auto-updates, WP/plugin updates), and theme (child theme). Each check includes a status (pass/fail/warning) and whether it can be auto-fixed.
Inputs: no named parameters.
wp_cli_executeA
Execute a WP-CLI command. Deny by default: only allowlisted commands run (cache, comment, core, cron, language, media, menu, option, plugin, post, rewrite, role, sidebar, site, term, theme, transient, user, widget). db, eval, eval-file, shell, server, config and package are refused, as are the --require, --exec, --ssh, --http and --path flags. Quote any value containing shell metacharacters. The feature is off unless the site owner set WPAIA_ENABLE_WPCLI in wp-config.php — call wp_cli_status first. Do NOT include the "wp" prefix (e.g., "plugin list", "cache flush").
Inputs: command (required).
wp_cli_list_commandsA
List the allowlisted WP-CLI commands and their permitted subcommands, plus the refused global flags. Anything absent from the list is refused.
Inputs: no named parameters.
wp_cli_statusA
Check WP-CLI availability. Returns whether the feature is enabled in wp-config.php, whether proc_open is available, the WP-CLI path and version. Call this before any WP-CLI command.
Inputs: no named parameters.
wp_create_contentB
Create a new WordPress post, page, or product. For WooCommerce products, you can set prices, SKU, stock, etc.
Inputs: type (required), title (required), sku, meta, +17 more.
wp_create_userC
Create a new WordPress user with username, email, and optional role/name fields.
Inputs: email (required), username (required), role, password, +3 more.
wp_deactivate_pluginB
Deactivate an active WordPress plugin.
Inputs: plugin (required).
wp_delete_commentB
Permanently delete a comment.
Inputs: id (required).
wp_delete_contentA
Delete a WordPress post, page, or product. By default moves to trash; use force=true to permanently delete.
Inputs: id (required), type (required), force.
wp_delete_mediaB
Delete a media file from the WordPress media library.
Inputs: id (required), force.
wp_delete_optionB
Delete a WordPress option by key.
Inputs: key (required).
wp_delete_pluginA
Delete a WordPress plugin (deactivates it first if active). This permanently removes the plugin files.
Inputs: plugin (required).
wp_elementor_get_pageA
Get the Elementor data for a page/post by its ID. Returns the full element tree (sections > columns > widgets), page settings, and metadata. Use this to understand the current structure before making modifications.
Inputs: id (required).
wp_elementor_list_templatesA
List all saved Elementor templates (sections, pages, headers, footers, etc.).
Inputs: no named parameters.
wp_elementor_statusA
Check if Elementor is active and get its version.
Inputs: no named parameters.
wp_elementor_update_pageA
Update the Elementor data for a page/post. Send the full element tree as JSON. The structure follows Elementor's hierarchy: sections (elType: "section") contain columns (elType: "column") which contain widgets (elType: "widget", widgetType: "heading"|"text-editor"|"image"|etc.). Each element has an "id" (8-char hex), "settings" object, and "elements" array for children. Always read the page first with wp_elementor_get_page to understand the current structure.
Inputs: id (required), elements (required), page_settings.
wp_elementor_widget_typesA
List all available Elementor widget types with their names, titles, icons, and categories. Use this to know which widgets you can use when building pages.
Inputs: no named parameters.
wp_fix_best_practicesA
Apply auto-fixes for best practice issues. Currently supports fixing: "permalinks" (sets to /%postname%/) and "xmlrpc" (disables via mu-plugin). Pass an array of fix IDs to apply.
Inputs: fixes (required).
wp_get_commentA
Get a single comment with full details by its ID.
Inputs: id (required).
wp_get_contentA
Get a single WordPress content item by ID with full details including content, meta fields, categories, tags, and WooCommerce product data if applicable.
Inputs: id (required), type (required).
wp_get_mediaA
Get detailed information about a single media file including all available sizes and URLs.
Inputs: id (required).
wp_get_optionA
Get a single WordPress option value by key. Common options: blogname, blogdescription, timezone_string, date_format, time_format, permalink_structure, posts_per_page, etc.
Inputs: key (required).
wp_get_options_batchB
Get multiple WordPress options at once. Provide a comma-separated list of option keys.
Inputs: keys (required).
wp_get_userB
Get detailed information about a specific WordPress user by ID.
Inputs: id (required).
wp_install_pluginA
Install a plugin from the WordPress.org repository by its slug. Optionally activate it immediately after installation.
Inputs: slug (required), activate.
wp_install_themeA
Install a theme from WordPress.org by its slug. Optionally activate it after installation.
Inputs: slug (required), activate.
wp_list_commentsB
List comments with optional filtering by status (approve, hold, spam, trash, all), post ID, and search.
Inputs: page, search, status, post_id, +1 more.
wp_list_contentA
List WordPress content (posts, pages, products, or any custom post type). Supports search, pagination, and filtering by status.
Inputs: type (required), page, order, search, +4 more.
wp_list_mediaB
List media files in the WordPress media library. Can filter by MIME type (image/jpeg, video/mp4, etc.) and search by name.
Inputs: page, search, per_page, mime_type.
wp_list_pluginsA
List all installed WordPress plugins with their status (active/inactive), version, and update availability.
Inputs: no named parameters.
wp_list_themesA
List all installed WordPress themes with their status (active/inactive), version, and parent theme info.
Inputs: no named parameters.
wp_list_usersB
List WordPress users with optional filtering by role, search query, and pagination.
Inputs: page, role, order, search, +2 more.
wp_reply_commentA
Reply to a comment as the site administrator.
Inputs: content (required), post_id (required), parent_id (required).
wp_search_pluginsA
Search the WordPress.org plugin directory. Use this to find plugins by name or keyword before installing them.
Inputs: query (required), per_page.
wp_search_themesA
Search the WordPress.org theme directory for themes matching a query.
Inputs: query (required), per_page.
wp_set_optionsA
Set one or more WordPress options. Provide an object of key-value pairs. Note: some sensitive options (siteurl, admin_email, etc.) are blocked for security.
Inputs: options (required).
wp_site_healthA
Check if the WordPress site is reachable and the WP AI Assistant plugin is active.
Inputs: no named parameters.
wp_site_infoA
Get comprehensive WordPress site information including version, plugins, theme, post types, WooCommerce status, and server details.
Inputs: no named parameters.
wp_update_comment_statusA
Change a comment status: approve, hold (unapprove), spam, or trash.
Inputs: id (required), status (required).
wp_update_contentA
Update an existing WordPress post, page, or product. Only provide the fields you want to change.
Inputs: id (required), type (required), sku, meta, +11 more.
wp_update_pluginA
Update a WordPress plugin to the latest version from WordPress.org.
Inputs: plugin (required).
wp_update_userB
Update an existing WordPress user (email, role, name fields).
Inputs: id (required), role, email, last_name, +2 more.
wp_upload_mediaA
Upload a file to the WordPress media library using base64-encoded data. Maximum file size: 10MB.
Inputs: data (required), filename (required), alt, title.
wp_woocommerce_create_couponB
Create a new WooCommerce coupon with discount rules.
Inputs: code (required), amount (required), expiry_date, product_ids, +6 more.
wp_woocommerce_create_tax_rateB
Create a new WooCommerce tax rate for a specific country/state.
Inputs: name (required), rate (required), country (required), state, +3 more.
wp_woocommerce_get_orderA
Get full details of a single WooCommerce order including line items, billing/shipping addresses, and payment info.
Inputs: id (required).
wp_woocommerce_get_settingsA
Get WooCommerce settings by group. Available groups: "general" (store address, currency), "products" (weights, stock), "shipping", "checkout" (guest checkout, etc.), "emails".
Inputs: group.
wp_woocommerce_list_couponsB
List all WooCommerce coupons with their discount types, amounts, and usage stats.
Inputs: per_page.
wp_woocommerce_list_ordersA
List WooCommerce orders with customer info, totals, and status. Supports filtering by status and pagination.
Inputs: page, status, per_page.
wp_woocommerce_list_tax_ratesA
List all WooCommerce tax rates configured on the site.
Inputs: no named parameters.
wp_woocommerce_payment_gatewaysA
List all available WooCommerce payment gateways with their enabled/disabled status.
Inputs: no named parameters.
wp_woocommerce_shipping_zonesA
List WooCommerce shipping zones with their configured shipping methods.
Inputs: no named parameters.
wp_woocommerce_statsA
Get WooCommerce sales statistics for a given period: total revenue, order count, average order value, and customer count.
Inputs: period.
wp_woocommerce_statusA
Check if WooCommerce is installed and active. Returns store details: currency, address, product/order counts, and enabled features.
Inputs: no named parameters.
wp_woocommerce_update_payment_gatewayC
Enable/disable or configure a WooCommerce payment gateway.
Inputs: id (required), title, enabled, options, +1 more.
wp_woocommerce_update_settingsB
Update WooCommerce settings. Provide key-value pairs of woocommerce_ prefixed options. For example: {"woocommerce_currency": "EUR", "woocommerce_default_country": "FR"}.
Inputs: settings (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 58 tools
Most tools follow a clear resource+action split (plugin, content, order, comment, media, user), but a few overlap: wp_site_info vs wp_site_health, wp_get_content vs wp_elementor_get_page, and wp_cli_execute can replicate many dedicated tools. Descriptions generally prevent misselection.
The overwhelming pattern is wp_<domain>_<verb>_<noun> in snake_case, which is predictable and easy to navigate. Deviations include noun-only names like wp_woocommerce_shipping_zones, wp_woocommerce_payment_gateways, and wp_elementor_widget_types, plus nominal names like wp_site_info and wp_site_health.
With 58 tools, this is far beyond the typical well-scoped MCP surface and creates a large namespace for an agent to navigate. While each subdomain is heavily covered, the count is excessive for a single server and many tools could be consolidated or exposed as subcommands.
The server covers a broad range of domains with solid CRUD cycles for content, plugins, media, options, and comments. However, notable lifecycle gaps remain: themes have no update/delete, WooCommerce coupons and tax rates have no update/delete, and users have no delete operation.
Maintenance
Related MCP Connectors
WordPress plugin exposing 60 MCP tools via OAuth 2.1: posts, pages, media, users, comments and SEO.
Manage WordPress blogs and WooCommerce shops from Claude, ChatGPT, Cursor and other MCP apps.
Security-first WordPress MCP server. 129 tools for Claude, ChatGPT, Gemini. Free on wp.org.
WordPress MCP; OAuth, connected site and eligible subscription or trial required.
Related MCP Servers
FlicenseNot gradedqualityAmaintenanceProduction MCP server that runs as a WordPress plugin, exposing 40+ tools for managing posts, pages, custom post types, WooCommerce products, media, users, and menus from any MCP client. Includes API key + OAuth 2.0 authentication, rate limiting (60 req/min per IP), and activity logging. Free on WordPress.org10-- AlicenseNot gradedqualityAmaintenanceProvides a secure MCP bridge to interact with WordPress sites via signed requests, scoped keys, and approval workflows.1GPL 2.0
- AlicenseNot gradedqualityCmaintenanceManages WordPress sites over the REST API, enabling users, posts/pages, media, ACF fields, and Elementor page operations through MCP-compatible clients.MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP-compatible clients to manage a WordPress site through the native REST API, including reading and creating posts and tags, uploading media, and assigning featured images with write safeguards.MIT