Elementor Mcp Agent

io.github.Mogacode-ma由 GitHub 账号 Mogacode-ma 发布v1.3.0更新于 Oct 24, 2026

Agency-grade MCP for WordPress Elementor — multi-site, safe edits, templates, versions.

概览

AI 生成的概览

让助手管理 WordPress Elementor 站点:读取和编辑页面与组件、处理模板、执行备份并截图。

可以做什么
这是一个面向使用 Elementor 的 WordPress 站点的 MCP 服务器。它提供列出站点与页面、读取页面和组件结构、添加、更新、移动、复制或删除组件、在单个页面、单个站点或全部已配置站点上执行查找替换、导出与导入模板、列出并恢复备份、通过 SSH 运行 WP-CLI 命令,以及截取和比较页面截图等工具。写入类工具会先备份、校验生成的数据、刷新 CSS,并重新读取页面以确认写入已生效。
适用场景
适合管理多个 Elementor 站点的代理机构或站长,让助手在带备份和回滚的前提下完成重复的页面与组件编辑、模板迁移和批量文本替换。对没有 Elementor 内容的单一站点或只做只读浏览的场景意义不大。
运行要求
通过 npx 在本地运行(需要 Node.js)。需要在 ELEMENTOR_MCP_SITES 中提供站点对象的 JSON 数组,每项包含 id、url、username 和 WordPress 应用程序密码;可选使用 ELEMENTOR_MCP_CONFIG_PATH 指定配置文件路径,用 ELEMENTOR_MCP_DEFAULT_SITE_ID 设置默认站点。可选的每站点 SSH 配置可启用 WP-CLI 工具。需要能访问这些站点的网络,截图功能还需要无头 Chrome。
安装前请注意
ELEMENTOR_MCP_SITES 以明文保存站点地址、用户名和应用程序密码,应视为机密。相关工具会写入、移动、复制和删除页面与组件,在单个或全部站点上执行查找替换,并可运行 WP-CLI 命令;破坏性操作需要二次确认,部分命令模式被硬性拦截。没有 SSH 时备份可能写入本地 JSON 文件。写入可能报告成功却未真正保存,需核对结果。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Elementor Mcp Agent,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

elementor-mcp-agent

[npm version] [License: MIT] [Mogacode-ma/elementor-mcp-agent MCP server] [GitHub stars]

Agency-grade MCP server for WordPress Elementor. Multi-site management, safe Elementor edits with backup + auto-rollback + CSS flush, template export/import, global widget detection, screenshots, WP-CLI escape hatch.

Built for agencies running many client sites on Elementor / Elementor Pro who want Claude (or any MCP client) to drive the toil — without breaking pages.


How this was built

elementor-mcp-agent was built end-to-end with Claude Code over ~48 hours. The process is intentionally open:

  • Architecture, code, tests, docs — all generated through Claude Code pair-programming sessions
  • The 7 bugs documented in this post-mortem were caught in real E2E testing against a live WordPress + Elementor install, not after the fact
  • v1.2's post-write verification pattern was shipped 2 hours after a reader's comment (Mads Hansen on Dev.to) — the changelog credits the source

This isn't vibe-coded software thrown over the wall. Every release ran through lint + typecheck + 27 unit tests + (for v1.0) full E2E against a real WordPress install before publishing. The MCP itself hardcodes guardrails that prevent the model from making destructive WP-CLI calls.

I run a small WordPress agency and use this tool every day on client sites. If you're skeptical about agentic codegen for production infrastructure, the entire commit history is in the open — judge for yourself.


Why this exists

There are 25+ WordPress MCP servers on GitHub today. None targets the agency multi-site workflow with:

  • Real backup before every edit (postmeta via WP-CLI when SSH available, JSON file fallback — never silently lost)
  • Two-call confirmation for any destructive op (TTL 60s)
  • JSON validation + auto-rollback if an edit produces invalid Elementor data
  • 3-level CSS flush fallback (REST → wp-cli native → option/meta delete → re-save)
  • Global widget awareness — preflight check warns if a page references shared widgets
  • WP-CLI escape hatch for everything the REST API can't do safely
  • Screenshots via headless Chrome (no puppeteer dep)

Install

bash
npx -y elementor-mcp-agent

Configure

bash
export ELEMENTOR_MCP_SITES='[{  "id": "client-acme",  "url": "https://acme.example.com",  "username": "admin",  "application_password": "xxxx xxxx xxxx xxxx xxxx xxxx",  "ssh": {    "host": "host.example.com",    "user": "username",    "port": 22,    "path": "/path/to/wordpress",    "wp_cli_path": "wp"  }}]'

Generate the WordPress Application Password at https://{your-site}/wp-admin/profile.php#application-passwords-section.

The ssh block is optional but unlocks 8 additional tools (WP-CLI escape hatch + reliable custom-postmeta backups). The MCP works without SSH — backups go to local JSON files instead.

wp_cli_path auto-detects if omitted (tries wp, then ~/bin/wp.phar, then ~/wp-cli.phar).

Claude Desktop config

json
{  "mcpServers": {    "elementor": {      "command": "npx",      "args": ["-y", "elementor-mcp-agent"],      "env": {        "ELEMENTOR_MCP_SITES": "[{\"id\":\"acme\",\"url\":\"https://acme.com\",\"username\":\"admin\",\"application_password\":\"...\"}]"      }    }  }}

Tools (34)

Sites & health

  • list_sites — enumerate the pool
  • ping_site — auth + version probe
  • site_health — multi-call health snapshot

Pages

  • list_elementor_pages — pages in builder mode
  • read_page_elementor — parsed summary + optional full tree
  • list_widgets_in_page — flat widget inventory with excerpts
  • list_global_widgets — shared widgets (edit one → affects every page using it)
  • preflight_check — validate a page is safe to edit
  • elementor_find_replace — text replace with dry-run → token → apply → backup → validate → rollback if invalid
  • list_elementor_backups / restore_elementor_backup — full restore chain with pre-restore safety backup
  • duplicate_elementor_page — clone within a site (data + page_settings + edit_mode)

Templates

  • list_elementor_templates — Theme Builder distinguished from regular library
  • export_elementor_template — portable JSON
  • import_elementor_template — drop into target site
  • apply_template_to_page — push template data onto an existing page

WP-CLI escape hatch (require SSH)

  • wp_cli_run — arbitrary wp-cli command with destructive-pattern detection + confirmation
  • wp_search_replace — wp search-replace with mandatory dry-run
  • wp_elementor_flush_css — 3-level fallback
  • wp_plugin_list / wp_plugin_update (with confirmation)

Visual

  • screenshot_page — headless Chrome PNG of any URL
  • compare_screenshots — SHA-256 + byte-delta

Widgets (v1.1 — widget-level CRUD)

  • read_widget — fetch one widget by id (read-only)
  • update_widget_settings — shallow-merge settings, with backup + validate + flush
  • delete_widget — remove a widget from its parent container
  • duplicate_widget — clone as sibling with fresh id
  • swap_widget_type — replace widgetType + settings, preserve id + position
  • add_widget — append a widget into a parent container
  • move_widget — move a widget between containers (with position)

Bulk & fleet (v1.1)

  • bulk_find_replace_site — find/replace across every Elementor page of one site, per-page backup + validate + flush
  • fleet_find_replace — same across every site in the pool (sequential, dry-run mandatory)
  • restore_from_file — restore _elementor_data from a JSON file backup, with pre-restore safety backup

Fleet

  • check_elementor_versions — flag outdated installs against wordpress.org latest

Post-write verification (v1.2)

Every mutating widget tool re-reads the page from canonical WP after the write and surfaces persisted state to the model. The HTTP write API can lie — return 200 OK while plugin filters or REST quirks silently drop the payload. This contract makes that observable.

Every applied response carries:

jsonc
{  "mutated": true,                  // false = no-op OR silent drop  "warnings": [],                   // non-fatal issues  "verification": {    "method": "Re-read /wp/v2/pages/42 and check widget abc settings…",    "reread_ok": true,    "matches_requested": true,      // false = write API lied    "persisted": { /* canonical state */ },    "notes": "…explanation when something diverged"  }}

If verification.matches_requested === false, treat as a failure even if the HTTP layer said OK. The original payload survives in backup_meta_key — restore via restore_elementor_backup.


Safety guarantees

Hardcoded in src/elementor/policies.ts:

ts
BACKUP_BEFORE_WRITE                 = trueBACKUP_PAGE_SETTINGS                = trueVALIDATE_JSON_AFTER_EDIT            = trueBLOCK_GLOBAL_WIDGET_WRITES_BY_DEFAULT = trueCONFIRMATION_TTL_SECONDS            = 60GLOBAL_WIDGET_CONFIRMATION_TTL_SECONDS = 30FLUSH_CSS_AFTER_WRITE               = trueMAX_ELEMENTOR_DATA_BYTES            = 5_000_000

And these wp-cli patterns are hard-blocked regardless of confirmation:

  • rm -rf
  • sudo *
  • db reset --yes / db drop --yes

End-to-end verified

v1.0.0 was tested in real conditions against a live WordPress install with Elementor 4.0.9:

  • ✅ 21/24 tools validated end-to-end at the v1.0.0 baseline (the suite now exposes 34 — see Tools)
  • ✅ find_replace → backup → restore round-trip preserves data
  • ✅ duplicate_page copies data + page_settings + edit_mode
  • ✅ apply_template_to_page with auto-backup
  • ✅ wp_cli_run destructive flow (post delete) requires confirmation
  • ✅ screenshots identical detection via SHA-256
  • ✅ CSS flush uses wp elementor flush-css when SSH available, falls back to option-delete otherwise

7 bugs found during testing, all fixed:

  • REST API silently drops unregistered postmeta writes → switched to WP-CLI primary for backups
  • wp not in SSH PATH on managed hosts → auto-detection + wp_cli_path config
  • SSH post-quantum banner pollution → stderr filter
  • Default Kit returned as "widget" → client-side filter
  • _elementor_page_settings type object/string mismatch → normalisation
  • Chrome cold-start screenshot timeout → bumped to 60s
  • Templates listing same filter bug → fixed

Roadmap

v1.1 ✅ shipped

  • Widget-level CRUD: read_widget, update_widget_settings, delete_widget, duplicate_widget, swap_widget_type, add_widget, move_widget
  • bulk_find_replace_site (across all Elementor pages of one site)
  • fleet_find_replace (across all sites in pool)
  • restore_from_file

v1.2

  • Global styles read/write
  • Theme Builder template push across sites
  • Section/column-level operations

v2.0

  • WooCommerce-aware tools
  • Visual diff (pixel comparison)
  • Schedule + cron scheduling

If this saved you time

The fastest way to support the project is a ⭐ star on GitHub — it helps other agencies running Elementor sites find this and tells me what to keep building.

You can also:

  • Open an issue for bugs, edge cases, or missing tools
  • Start a discussion for design or workflow questions
  • Share what you built with it — I'd love to hear

License

MIT — © 2026 MogaCode.


Développé par Mogacode, agence de référencement en abonnement : sites qui rankent.

来源:README.md,提交 6001358

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.3.0最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。