- Elementor WordPress MCP Server
Elementor WordPress MCP Server
Elementor WordPress MCP Server
A Model Context Protocol (MCP) server for interacting with WordPress and Elementor. This server provides AI assistants with the ability to manage WordPress content, posts, pages, media, and Elementor templates through the WordPress REST API.
Features
- WordPress Content Management: Full CRUD operations for posts and pages
- True Elementor Integration: Create, read, and update real Elementor content with sections, columns, and widgets
- Automatic Post/Page Detection: Elementor functions intelligently work with both posts and pages
- Rich Content Creation: Build complex layouts with headings, text editors, buttons, images, and styling
- Content Conversion: Transform regular WordPress content into Elementor-powered pages
- Media Management: Upload and manage WordPress media library
- Environment Variable Support: Easy configuration via environment variables
- Authentication: Secure connection using WordPress application passwords
- Type-Safe: Built with TypeScript for better development experience
Prerequisites
- Node.js 18 or higher
- WordPress site with REST API enabled
- WordPress Application Password (not regular password)
- Elementor plugin (for Elementor-specific features)
Installation
Option 1: NPX (Recommended)
The easiest way to use this MCP server:
npx wp-elementor-mcp
Option 2: Local Development
For local development or modification:
- Clone this repository:
git clone https://github.com/Huetarded/wp-elementor-mcp.git cd wp-elementor-mcp - Install dependencies:
npm install - Build the server:
npm run build
WordPress Setup
Creating an Application Password
- Log into your WordPress admin dashboard
- Go to Users → Profile (or Users → All Users → Edit your user)
- Scroll down to Application Passwords section
- Enter a name for the application (e.g., "MCP Server")
- Click Add New Application Password
- Important: Copy the generated password immediately - you won't see it again!
Required WordPress Permissions
Your WordPress user should have sufficient permissions to:
- Create, edit, and delete posts/pages
- Upload media files
- Access Elementor data (if using Elementor features)
Usage
Configuration (Environment Variables - Recommended)
The recommended way to configure the MCP server is through environment variables. Add this configuration to your MCP client (e.g., Claude Desktop):
{
"mcpServers": {
"elementor-wordpress": {
"command": "npx",
"args": ["wp-elementor-mcp"],
"env": {
"WORDPRESS_BASE_URL": "https://yoursite.com",
"WORDPRESS_USERNAME": "your-wp-username",
"WORDPRESS_APPLICATION_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
}
}
}
}
Environment Variables:
WORDPRESS_BASE_URL: Your WordPress site URL (e.g.,https://yoursite.com)WORDPRESS_USERNAME: Your WordPress usernameWORDPRESS_APPLICATION_PASSWORD: The application password you generated
Alternative: Manual Configuration
If you prefer not to use environment variables, you can manually configure the connection:
- Start the MCP server without environment variables
- Use the
configure_wordpresstool with your WordPress credentials:- baseUrl: Your WordPress site URL (e.g.,
https://yoursite.com) - username: Your WordPress username
- applicationPassword: The application password you generated
- baseUrl: Your WordPress site URL (e.g.,
Running the Server Locally
npm start
Available Tools
WordPress Configuration
configure_wordpress- Set up connection to your WordPress site (optional if environment variables are configured)
Posts & Pages
get_posts- Retrieve WordPress posts with filtering optionsget_post- Get a specific post by IDcreate_post- Create new postsupdate_post- Update existing postsget_pages- Retrieve WordPress pagescreate_page- Create new WordPress pagesupdate_page- Update existing WordPress pages
Elementor
get_elementor_templates- Get Elementor templates (requires Elementor Pro)get_elementor_data- Get Elementor page/post dataupdate_elementor_data- Update Elementor page/post data
Media
get_media- Browse WordPress media libraryupload_media- Upload files to WordPress media library
Example Usage
Here are some example commands you can use with an MCP client:
Setup with Environment Variables (Recommended)
No initial setup needed - the server automatically connects using your environment variables!
Alternative Manual Setup
Use the configure_wordpress tool to connect to my WordPress site at https://mysite.com with username "admin" and application password "xxxx xxxx xxxx xxxx xxxx xxxx"
Create a Post
Create a new WordPress post with title "Hello World" and content "<h1>Welcome to my blog!</h1><p>This is my first post created via MCP.</p>"
Create a Page
Create a new WordPress page with title "About Us" and content "<h1>About Our Company</h1><p>Learn more about our mission and values.</p>"
Update a Page
Update page ID 5 with new title "Updated About Page" and add additional content about our team
Get Elementor Data
Get the Elementor data for page ID 9
Create Elementor Content
Update page ID 37 with Elementor content including a hero section with heading "Welcome to Our Site", a text widget with introduction content, and a call-to-action button
Convert Regular Content to Elementor
Update post ID 31 to use Elementor with a section containing a heading widget, text editor widget with rich content, and an image widget
Upload Media
Upload the image file at /path/to/image.jpg to WordPress with title "My Image" and alt text "A beautiful image"
Development
Building
npm run build
Development Mode (with auto-rebuild)
npm run dev
Project Structure
├── src/
│ └── index.ts # Main MCP server implementation
├── dist/ # Compiled JavaScript output
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
└── README.md # This file
Troubleshooting
Connection Issues
- Verify your WordPress site has the REST API enabled
- Check that your application password is correct
- Ensure your WordPress user has sufficient permissions
- Try accessing
https://yoursite.com/wp-json/wp/v2/in your browser
Elementor Issues
- Elementor template features require Elementor Pro
- Make sure Elementor is activated and up to date
- The
get_elementor_dataandupdate_elementor_datafunctions work with both posts and pages (automatically detects the correct endpoint) - If you experience timeouts with Elementor functions, ensure you're using version 1.2.2 or later
- Some Elementor endpoints may not be available depending on your setup
Permission Errors
- Verify your WordPress user role has necessary capabilities
- Check if any security plugins are blocking REST API access
- Ensure proper authentication headers are being sent
Security Notes
- Never share your application passwords
- Use HTTPS for your WordPress site in production
- Consider IP restrictions for sensitive operations
- Regularly rotate application passwords
Contributing
Feel free to submit issues, feature requests, or pull requests to improve this MCP server.
License
MIT License - see LICENSE file for details.