A unified Model Context Protocol (MCP) server for WordPress content management and Elementor page building. This server merges WordPress CRUD operations with comprehensive Elementor visual editing capabilities, providing 82 tools for AI-assisted website management.
- 41 WordPress Content Tools: Manage posts, pages, categories, comments, media, users, plugins, and menus
- 24 Elementor Page Building Tools: Create and manipulate sections, containers, widgets, and page structure
- 12 Global Settings Tools: Control Elementor theme colors, fonts, CSS, and render rebuilds (requires CommunityTech plugin)
- 5 SiteSEO Tools: Read and update SEO metadata, run audits, and manage global SiteSEO settings
- Full TypeScript: Type-safe tool definitions and handlers
- Modular Architecture: Clean separation of concerns across 14 tool modules
- Node.js >= 18
- A WordPress site with REST API enabled
- An Application Password for authentication (see below)
- Elementor plugin installed (for page building tools)
- CommunityTech plugin installed (for global settings tools)
git clone https://github.com/Community-Tech-UK/mcp-wordpress-elementor.git
cd mcp-wordpress-elementor
npm install
npm run build- Go to WordPress Admin > Users > Profile
- Scroll to Application Passwords
- Enter a name (e.g. "Claude Code MCP")
- Click Add New Application Password
- Copy the password immediately — it won't be shown again
Create or edit .mcp.json in your project directory:
{
"mcpServers": {
"wordpress": {
"command": "node",
"args": ["/absolute/path/to/mcp-wordpress-elementor/build/cli.js"],
"env": {
"WORDPRESS_API_URL": "https://your-site.com",
"WORDPRESS_USERNAME": "your-username",
"WORDPRESS_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
}
}
}
}Then open Claude Code from the directory containing .mcp.json. The WordPress tools will be available automatically.
The server implements the standard MCP protocol via stdio. Point your client at build/cli.js and pass the three environment variables above.
The 11 global settings tools (colors, fonts, theme style, CSS regeneration, widget registry) require the CommunityTech plugin on your WordPress site.
- Download the latest release
- WordPress Admin > Plugins > Add New > Upload Plugin — upload the zip
- Activate the plugin
Without it, the 60 WordPress + Elementor page building tools still work fine.
Instead of duplicating server entries, use a sites file so a single server instance can switch between sites at runtime.
1. Create a sites.json file:
{
"my-site": {
"url": "https://my-site.com",
"username": "admin",
"password": "xxxx xxxx xxxx xxxx xxxx xxxx"
},
"other-site": {
"url": "https://other-site.com",
"username": "admin",
"password": "yyyy yyyy yyyy yyyy yyyy yyyy"
}
}2. Point .mcp.json at it:
{
"mcpServers": {
"wordpress": {
"command": "node",
"args": ["/path/to/mcp-wordpress-elementor/build/cli.js"],
"env": {
"WORDPRESS_SITES_FILE": "/path/to/sites.json"
}
}
}
}The server auto-connects to the first site on startup. Two extra tools become available:
list_sites— shows all configured sites and which is activeselect_site— switches to a different site by name; all subsequent tool calls target it
Alternatively, pass the JSON inline via WORDPRESS_SITES instead of using a file.
If neither WORDPRESS_SITES_FILE nor WORDPRESS_SITES is set, the server falls back to single-site mode using WORDPRESS_API_URL/WORDPRESS_USERNAME/WORDPRESS_PASSWORD.
| Variable | Required | Description |
|---|---|---|
WORDPRESS_API_URL |
Yes* | Your WordPress site URL |
WORDPRESS_USERNAME |
Yes* | WordPress username |
WORDPRESS_PASSWORD |
Yes* | Application password (also accepts WORDPRESS_APP_PASSWORD) |
WORDPRESS_SITES_FILE |
No | Path to a JSON file with multiple site configs (replaces the three above) |
WORDPRESS_SITES |
No | Inline JSON string with multiple site configs (fallback for WORDPRESS_SITES_FILE) |
DISABLE_ELEMENTOR |
No | Set true to disable 24 page building tools |
DISABLE_ELEMENTOR_GLOBAL_SETTINGS |
No | Set true to disable 11 global settings tools |
* Not required when WORDPRESS_SITES_FILE or WORDPRESS_SITES is set.
Posts
list_posts- List posts with filtersget_post- Get post by IDcreate_post- Create new postupdate_post- Update existing postdelete_post- Delete post
Pages
list_pages- List pages with filtersget_page- Get page by IDcreate_page- Create new pageupdate_page- Update existing pagedelete_page- Delete page
Categories
list_categories- List categoriesget_category- Get category by IDcreate_category- Create new categoryupdate_category- Update categorydelete_category- Delete category
Comments
list_comments- List comments with filtersget_comment- Get comment by IDcreate_comment- Create new commentupdate_comment- Update commentdelete_comment- Delete comment
Media
list_media- List media library itemscreate_media- Upload media fileedit_media- Update media metadatadelete_media- Delete media item
Users
list_users- List usersget_user- Get user by IDcreate_user- Create new userupdate_user- Update userdelete_user- Delete user
Plugins
list_plugins- List installed pluginsget_plugin- Get plugin detailsactivate_plugin- Activate plugindeactivate_plugin- Deactivate plugincreate_plugin- Create plugin file
Plugin Repository
search_plugin_repository- Search WordPress.org pluginsget_plugin_details- Get plugin info from repository
Menus
list_menus- List navigation menuslist_menu_items- List items in a menucreate_menu_item- Create a new menu itemupdate_menu_item- Update an existing menu itemdelete_menu_item- Delete a menu item
Data Management
get_elementor_data- Get complete page JSONupdate_elementor_data- Update page JSONget_elementor_data_chunked- Get page data in chunks for large pagesbackup_elementor_data- Create JSON backupget_elementor_templates- List saved templates
Structure Analysis
get_page_structure- Get hierarchical page outlineget_elementor_elements- List all elements with IDs
Sections & Containers
create_elementor_section- Create new sectioncreate_elementor_container- Create new container (flexbox)add_column_to_section- Add column to sectionduplicate_section- Clone existing sectionreorder_top_level_sections- Change section order
Element Operations
delete_elementor_element- Remove element by IDreorder_elements- Change element order within parentcopy_element_settings- Copy settings between elementsfind_elements_by_type- Search for elements by widget type
Widget Management
add_widget_to_section- Add widget to section/columninsert_widget_at_position- Insert widget at specific positionclone_widget- Duplicate widgetmove_widget- Move widget to different containerupdate_elementor_widget- Update widget settingsget_elementor_widget- Get widget data by IDupdate_elementor_section- Update section settingsget_widget_content- Get rendered widget HTML
Requires CommunityTech WordPress plugin
Kit Settings
get_elementor_kit_settings- Get all global settings
Colors
get_elementor_global_colors- Get color paletteupdate_elementor_global_colors- Update global colors
Typography
get_elementor_global_fonts- Get typography settingsupdate_elementor_global_fonts- Update global fonts
Theme Style
get_elementor_theme_style- Get theme-level stylesupdate_elementor_theme_style- Update theme styles
Cache & Utilities
get_elementor_css_variables- Get CSS variable definitionsclear_elementor_cache_by_page- Clear page cacheregenerate_elementor_css- Rebuild CSS filesrebuild_elementor_render- Rebuild rendered Elementor HTML after data updateslist_available_widgets- List registered widget types
Requires CommunityTech WordPress plugin and SiteSEO
get_seo_metadata- Get SEO metadata for a post or pageupdate_seo_metadata- Update SEO metadata for a post or pageaudit_seo- Audit SEO coverage across posts and pagesget_seo_settings- Read global SiteSEO settingsupdate_seo_settings- Update global SiteSEO settings
npm run dev # Watch mode with tsx
npm run build # TypeScript compilation
npm test # Run unit + integration tests
npm run test:watch # Test watch mode
npm run test:smoke # Smoke tests against live WordPress siteThe test suite includes:
- Unit tests: Tool handler logic and utilities
- Integration tests: WordPress API interactions (require test site)
- Smoke tests: End-to-end validation against live site
Set WORDPRESS_TEST_API_URL, WORDPRESS_TEST_USERNAME, and WORDPRESS_TEST_PASSWORD for integration testing.
src/
├── tools/ # 14 tool modules (posts, pages, elementor, etc.)
├── utils/ # Shared utilities
│ ├── element-traversal.ts # Element tree navigation
│ ├── id-generator.ts # Unique ID generation
│ └── data-operations.ts # JSON manipulation
├── types/ # TypeScript types and Zod schemas
├── config/ # Feature flags and configuration
└── server.ts # MCP server entry point
Each tool module exports:
- Tool definitions: MCP tool schemas with input validation
- Handler functions: Implementation logic for each tool
- Type safety: Full TypeScript coverage with Zod runtime validation
- Element Traversal: Recursive tree walking for finding/updating Elementor elements
- ID Generation: Collision-free 8-character hex IDs for Elementor elements
- Data Operations: Immutable JSON transformations with validation
After updating Elementor JSON via update_elementor_data, the CSS cache does not automatically regenerate. Use regenerate_elementor_css (requires CommunityTech plugin) or manually open the page in Elementor editor and save.
Pages with extensive Elementor data may hit API payload limits. Use get_elementor_data_chunked for large pages.
Contributions are welcome. Please ensure:
- TypeScript compilation passes (
npm run build) - Tests pass (
npm test) - Code follows existing patterns
- New tools include Zod schemas and proper error handling
GPL-3.0-or-later
This project merges:
- @instawp/mcp-wp - WordPress CRUD operations
- wp-elementor-mcp - Elementor page building tools
Built with @modelcontextprotocol/sdk ^1.4.1.