Content
# WordPress Elementor MCP Server
MCP server for managing WordPress Elementor pages via the WordPress REST API.
## Setup
1. **Install dependencies:**
```bash
npm install
```
2. **Configure WordPress sites:**
Copy `.env.example` to `.env`:
```bash
cp .env.example .env
```
Edit `.env` and add your WordPress site details:
```
WP_SITE_1_URL=https://yoursite.com
WP_SITE_1_USERNAME=admin
WP_SITE_1_APP_PASSWORD=your-app-password-here
```
For multiple sites, add more entries:
```
WP_SITE_2_URL=https://anothersite.com
WP_SITE_2_USERNAME=admin
WP_SITE_2_APP_PASSWORD=another-app-password
```
3. **Generate WordPress Application Password:**
- Log into your WordPress admin panel
- Go to Users → Profile
- Scroll to "Application Passwords"
- Create a new application password
- Copy the generated password (format: `xxxx xxxx xxxx xxxx xxxx xxxx`)
## Usage
### Running the server
```bash
npm start
```
### Configure in Claude Desktop
Add to your Claude Desktop config file:
**MacOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
```json
{
"mcpServers": {
"wordpress-elementor": {
"command": "node",
"args": ["C:\\Users\\spenc\\WebstormProjects\\elementor-mcp\\index.js"]
}
}
}
```
## Available Tools
### 1. `list_sites`
List all configured WordPress sites.
### 2. `list_pages`
List pages from a WordPress site.
**Parameters:**
- `site_id` (required): Site ID (e.g., 'site1')
- `per_page` (optional): Number of pages (default: 10, max: 100)
- `search` (optional): Search term
### 3. `get_page`
Get details of a specific page.
**Parameters:**
- `site_id` (required): Site ID
- `page_id` (required): WordPress page ID
### 4. `create_page`
Create a new WordPress page with Elementor.
**Parameters:**
- `site_id` (required): Site ID
- `title` (required): Page title
- `status` (optional): Page status (draft, publish, pending, private)
- `elementor_data` (optional): Elementor JSON data
### 5. `update_page`
Update an existing page.
**Parameters:**
- `site_id` (required): Site ID
- `page_id` (required): WordPress page ID
- `title` (optional): New title
- `status` (optional): New status
- `elementor_data` (optional): Updated Elementor JSON data
### 6. `get_elementor_data`
Get Elementor-specific metadata for a page.
**Parameters:**
- `site_id` (required): Site ID
- `page_id` (required): WordPress page ID
## WordPress REST API Setup
Ensure your WordPress site has:
1. REST API enabled (enabled by default)
2. Application Passwords enabled (WordPress 5.6+)
3. Elementor plugin installed
## Security
- Never commit `.env` file (it's in `.gitignore`)
- Application passwords are stored locally only
- Use HTTPS URLs for production sites