WordPress plugin that exposes a REST API + MCP (Model Context Protocol) abilities for AI-driven Elementor page editing.
Build, edit, and manage Elementor pages programmatically — designed to be used by AI agents (Claude, GPT, etc.) or any HTTP client.
Breaking rename: Formerly “Elementor MCP API” (
elementor-mcp-api). Public REST/MCP paths, ability IDs, and tool names now usemcp-api-for-elementor. Update clients andmcp.jsonconfigs. The GitHub repository ismcp-api-for-elementor.
- Full CRUD on Elementor pages, elements, and templates
- Granular element editing — update a single widget's settings without touching the rest
- Element operations — add, remove, duplicate, move elements in the page tree
- Global kit management — read/write colors, fonts, and site-wide settings
- Widget discovery — list all available widgets and get their control schemas
- MCP protocol support — auto-registers 24 abilities via the core Abilities API when WordPress MCP Adapter is active, including
get-instructionsfor always-current agent guidance - CSS cache management — flush Elementor CSS after changes
- WordPress 6.9+ (the Abilities API is in core — the standalone abilities-api plugin repo is archived)
- PHP 8.0+
- Elementor (free or Pro)
- For MCP (Cursor / Claude / etc.): WordPress MCP Adapter plugin (required — without it
/wp-json/mcp-api-for-elementor/mcpwill 404) - Authentication: WordPress Application Passwords (recommended) or cookie auth
- Authorization: page read/write requires
edit_pages(+ per-pageedit_post); media import / build-page with images also requiresupload_files; publish requirespublish_pages; kit/templates/CSS flush requiremanage_options
REST base: https://your-site.com/wp-json/mcp-api-for-elementor/v1
MCP tools use the names below exactly as shown in the client (ability mcp-api-for-elementor/foo → tool mcp-api-for-elementor-foo). See MCP Integration.
| Method | Endpoint | MCP Tool | Description |
|---|---|---|---|
| — | — | mcp-api-for-elementor-get-instructions |
Latest agent instructions (workflow, tool catalog, patterns, gotchas) |
| GET | /pages |
mcp-api-for-elementor-list-pages |
List WordPress pages with Elementor status |
| GET | /page/{id}/structure |
mcp-api-for-elementor-get-page-structure |
Compact page tree (IDs, types, hints) |
| GET | /page/{id} |
mcp-api-for-elementor-get-page-data |
Full Elementor element tree |
| PUT | /page/{id} |
mcp-api-for-elementor-save-page-data |
Replace the full element tree |
| PATCH | /page/{id}/meta |
mcp-api-for-elementor-update-page-meta |
Update title, slug, excerpt, status, Yoast SEO |
| GET | /page/{id}/settings |
mcp-api-for-elementor-get-page-settings |
Get Elementor page/document settings (Body Style) |
| PATCH | /page/{id}/settings |
mcp-api-for-elementor-update-page-settings |
Merge page settings; optional unset keys; flushes post CSS |
| POST | /page |
mcp-api-for-elementor-create-page |
Create a page with optional Elementor content |
| POST | /build-page |
mcp-api-for-elementor-build-page |
Create or update a full page (optional image import) |
| Method | Endpoint | MCP Tool | Description |
|---|---|---|---|
| GET | /page/{id}/element/{eid} |
mcp-api-for-elementor-get-element |
Get one element’s full data |
| PATCH | /page/{id}/element/{eid} |
mcp-api-for-elementor-update-element |
Merge settings into an element |
| POST | /page/{id}/element |
mcp-api-for-elementor-add-element |
Add a container or widget |
| DELETE | /page/{id}/element/{eid} |
mcp-api-for-elementor-remove-element |
Remove an element (and children) |
| POST | /page/{id}/element/{eid}/duplicate |
mcp-api-for-elementor-duplicate-element |
Clone an element with new IDs |
| POST | /page/{id}/element/{eid}/move |
mcp-api-for-elementor-move-element |
Move an element to a new parent/position |
| — | — | mcp-api-for-elementor-generate-element |
Build well-formed element JSON via the Element Factory (MCP only) |
| Method | Endpoint | MCP Tool | Description |
|---|---|---|---|
| GET | /templates |
mcp-api-for-elementor-list-templates |
List Theme Builder templates and conditions |
| POST | /template |
mcp-api-for-elementor-create-template |
Create a header/footer/single/archive/etc. template |
| Method | Endpoint | MCP Tool | Description |
|---|---|---|---|
| GET | /kit |
mcp-api-for-elementor-get-kit |
Read global kit settings |
| PUT | /kit |
mcp-api-for-elementor-update-kit |
Merge global kit settings (flushes CSS) |
| Method | Endpoint | MCP Tool | Description |
|---|---|---|---|
| GET | /widgets |
mcp-api-for-elementor-list-widgets |
List registered Elementor widgets |
| GET | /widget/{name}/schema |
mcp-api-for-elementor-get-widget-schema |
Control schema for a widget type |
| GET | /widget/{name}/defaults |
— | Ready-to-use element JSON with defaults (REST only) |
| Method | Endpoint | MCP Tool | Description |
|---|---|---|---|
| POST | /flush-css |
mcp-api-for-elementor-flush-css |
Flush Elementor CSS cache |
| POST | /media/import |
— | Import an image from the upload jail (REST only; also via mcp-api-for-elementor-build-page) |
API="https://your-site.com/wp-json/mcp-api-for-elementor/v1"
AUTH="username:your-application-password"
# List pages
curl -s -u "$AUTH" "$API/pages"
# Get page structure (always start here)
curl -s -u "$AUTH" "$API/page/8/structure"
# Update an element's title color
curl -s -X PATCH -u "$AUTH" -H "Content-Type: application/json" \
-d '{"settings":{"title_color":"#333333"}}' \
"$API/page/8/element/f8703b57"
# Flush CSS after changes
curl -s -X POST -u "$AUTH" "$API/flush-css"This plugin can expose its capabilities via the Model Context Protocol for direct AI agent integration:
-
Use WordPress 6.9+ — the Abilities API ships in core (standalone plugin archived; no separate Abilities install needed)
-
Install and activate the official WordPress MCP Adapter plugin
Download the latestmcp-adapter.zipfrom Releases → Plugins → Add New → Upload Plugin → Activate -
Activate this plugin — it auto-registers 24 abilities and a dedicated MCP server (no extra WordPress config)
-
Create an Application Password for a user with the capabilities you need (admin recommended)
-
Verify the MCP route exists (must not 404):
curl -s -o /dev/null -w "%{http_code}\n" https://your-site.com/wp-json/mcp-api-for-elementor/mcpA working install returns something other than
404. If you still get404, MCP Adapter is missing/inactive — the REST API under/wp-json/mcp-api-for-elementor/v1can work while MCP tools do not. -
Add the server to your client
mcp.json(see below), then reload MCP servers in the client -
Call
mcp-api-for-elementor-get-instructionsfirst before page work — it returns the latest workflow, tool catalog, patterns, and gotchas for this plugin version (no local skill file required)
MCP endpoint: https://your-site.com/wp-json/mcp-api-for-elementor/mcp
This plugin registers its own MCP Adapter server on that path (hook: mcp_adapter_init). The adapter’s generic default server (/wp-json/mcp/mcp-adapter-default-server) is a useful smoke test that MCP Adapter itself is active, but is not required for these Elementor tools. The full REST ↔ MCP mapping is in API & MCP Tools.
MCP clients (Cursor, Claude Desktop, VS Code, etc.) read a JSON config that registers servers. Use the HTTP bridge with @automattic/mcp-wordpress-remote:
{
"mcpServers": {
"mcp-api-for-elementor": {
"command": "npx",
"args": ["-y", "@automattic/mcp-wordpress-remote@latest"],
"env": {
"WP_API_URL": "https://your-site.com/wp-json/mcp-api-for-elementor/mcp",
"WP_API_USERNAME": "your-wp-username",
"WP_API_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx",
"OAUTH_ENABLED": "false"
}
}
}
}Replace:
WP_API_URL— your site’s Elementor MCP endpoint (/wp-json/mcp-api-for-elementor/mcp) — must be the real hostname, not theyour-site.complaceholderWP_API_USERNAME— WordPress usernameWP_API_PASSWORD— Application Password (spaces are fine)OAUTH_ENABLED— set to"false"when using Application Passwords (required by@automattic/mcp-wordpress-remote)
If Cursor shows a green status but “No tools, prompts, or resources”, the proxy likely cached a failed init (common right after installing MCP Adapter). Toggle the server off/on or reload MCP servers so it reconnects against the live /mcp route. Also, sometimes it's due to the mcp.json definition title being too long or having characters like periods.
- Sequential PATCH calls: Never run multiple PATCH calls in parallel on the same page. Each PATCH loads, modifies, and saves the full page — parallel calls overwrite each other. Cross-page parallelism is safe.
- Flush CSS: Always call
/flush-cssafter visual changes — Elementor caches CSS aggressively. Requiresmanage_options. - Element IDs: Always provide valid 8-character hex IDs when creating elements.
- PATCH merges settings: Only send the settings you want to change, not the full settings object.
- Default page status:
POST /pageandPOST /build-pagedefault todraft. Publishing requirespublish_pages. - Media import jail:
POST /media/importonly accepts real image files underwp-content/uploads/mcp-api-for-elementor-import/(legacyelementor-mcp-import/still accepted). - MCP tools: Exposed on
/wp-json/mcp-api-for-elementor/mcp(authenticated Application Password session; dedicated admin password recommended).
GPL-3.0 — see LICENSE
Not available at the moment.
- Download or clone this repository into
wp-content/plugins/and use the plugin slug folder name:cd wp-content/plugins/ git clone https://github.com/NorseGaud/mcp-api-for-elementor.git - Activate the plugin in WordPress admin
- Create an Application Password in Users → Your Profile → Application Passwords
| Tool | Version | Notes |
|---|---|---|
| PHP | 8.0+ (8.1 recommended) | Same floor as the plugin; CI uses 8.1 |
| Composer | 2.x | Dev deps: PHPCS, WPCS, PHPUnit |
| Git | any recent | Pre-commit hook lives in .githooks/ |
| Python 3 | optional | Only for upload-sftp.py (pip install paramiko) |
Runtime stack for local testing is unchanged: WordPress 6.9+, Elementor, and MCP Adapter if you exercise MCP.
git clone https://github.com/NorseGaud/mcp-api-for-elementor.git
cd mcp-api-for-elementor
composer install
git config core.hooksPath .githookscomposer install creates vendor/ (gitignored), including vendor/bin/phpcs. Without it, the pre-commit hook fails with a clear error.
Point core.hooksPath at .githooks once per clone so full-tree PHPCS runs before each commit (same as CI).
composer lint # PHPCS (WordPress Coding Standards via phpcs.xml.dist)
composer lint:fix # Auto-fix what PHPCS can
composer test # PHPUnit (phpunit.xml.dist)CI on the edge branch also runs PHP syntax checks, PHPCS, PHPUnit, and WordPress Plugin Check (strict) against a release-shaped package.
.githooks/pre-commit runs full-tree PHPCS via phpcs.xml.dist (same as CI composer lint), not only staged files. On violations it blocks the commit and prompts you to fix (composer lint:fix, re-check with composer lint, re-stage, commit again). Install deps and enable the hooks path (see Setup) before committing.
Use upload-sftp.py from the repo root to push the plugin into a remote WordPress wp-content/plugins/ directory. Requires paramiko (pip install paramiko).
Credentials are read from environment variables (nothing is stored in the script):
| Variable | Required | Description |
|---|---|---|
SFTP_HOST |
yes | SFTP hostname |
SFTP_USER |
yes | SFTP username |
SFTP_PASS |
yes | SFTP password |
SFTP_PORT |
no | Port (default 22) |
SFTP_HOST=sftp.example.com SFTP_PORT=32022 \
SFTP_USER=myuser SFTP_PASS='secret' \
python3 upload-sftp.pyThe script locates wp-content/plugins, uploads into mcp-api-for-elementor/, and overwrites matching remote files on re-run. It skips .git, .gitignore, and the upload script itself. Remote files that no longer exist locally are not deleted.