WordPress MCP Server
Manage WordPress sites and create content with AI-generated featured images.
WordPress MCP Server π
A Model Context Protocol (MCP) server that enables AI assistants to manage WordPress sites and create content with AI-generated featured images.
β¨ Features
- π Multi-Site Management - Control multiple WordPress sites from a single interface
- π€ AI-Powered Content - Create articles with automatic featured image generation using DALL-E 3
- π Smart Publishing - Full control over categories, tags, and post status
- π Secure Authentication - Uses WordPress Application Passwords for API access
- π International Support - Full Unicode support for Hebrew, Arabic, and other languages
- β‘ Bulk Operations - Create multiple articles across different sites efficiently
π― Use Cases
- Content Agencies - Manage multiple client WordPress sites from one place
- Blog Networks - Publish content across multiple blogs simultaneously
- AI-Assisted Writing - Let AI help create content with relevant images
- Multilingual Publishing - Create content in any language with proper support
π Prerequisites
- Python 3.8 or higher
- Claude Desktop (or any MCP-compatible client)
- WordPress sites with REST API enabled
- OpenAI API key (for image generation)
π Quick Start
1. Clone and Install
git clone https://github.com/seomentor/wpmcp.git
cd wpmcp
pip install -r requirements.txt
2. Configure WordPress Sites
Edit config/wordpress_sites.yaml:
sites:
- id: "site1"
name: "My WordPress Blog"
url: "https://myblog.com"
username: "your-username"
password: "your-app-password"
3. Set Up OpenAI (Optional, for images)
Create a .env file:
OPENAI_API_KEY=your-api-key-here
β οΈ Important Note: If you have an OPENAI_API_KEY already set in your Windows/Mac environment variables, it might override the one in .env. To avoid conflicts:
- Remove any existing
OPENAI_API_KEYfrom your system environment variables, OR - Add the API key directly to Claude Desktop config (see option 2 below)
4. Configure Claude Desktop
Add to Claude's config file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"wordpress": {
"command": "python",
"args": ["-m", "src.server"],
"cwd": "C:/path/to/wordpress-mcp-server"
}
}
}
Option 2: Include OpenAI API Key in Claude Config (Recommended if having issues)
{
"mcpServers": {
"wordpress": {
"command": "python",
"args": ["-m", "src.server"],
"cwd": "C:/path/to/wordpress-mcp-server",
"env": {
"OPENAI_API_KEY": "your-openai-api-key-here"
}
}
}
}
5. Start Using!
In Claude Desktop:
"Create an article about AI trends with an image on site1"
π Documentation
Available Commands
| Command | Description | Example |
|---|---|---|
| List sites | Show all configured sites | "Show me all WordPress sites" |
| Create article | Create a new post | "Create an article about Python on site1" |
| Create with image | Create post with AI image | "Create article with image about space on blog1" |
| Test connection | Verify site access | "Test connection to site1" |
| Get categories | List site categories | "Show categories on site1" |
| Get tags | List site tags | "Show tags on site1" |
WordPress Setup
-
Enable REST API (enabled by default in WordPress 5.0+)
-
Create Application Password:
- Go to Users β Profile β Application Passwords
- Generate new password
- Use in configuration
-
Required Permissions:
edit_posts- Create and edit postsupload_files- Upload mediamanage_categories- Create categoriesmanage_post_tags- Create tags
π¨ Image Generation
The server uses OpenAI's DALL-E 3 for automatic image generation:
- Automatic prompts - Generated from article title and content
- Smart filenames - SEO-friendly names based on content
- Direct upload - Images uploaded directly to WordPress media library
- Featured image - Automatically set as post featured image
Costs
- Standard quality: ~$0.04 per image
- HD quality: ~$0.08 per image
π§ Advanced Configuration
Environment Variables
OPENAI_API_KEY=sk-... # OpenAI API key for image generation
Configuration Options
settings:
default_post_status: "draft" # draft, publish, private
default_post_format: "standard"
max_retries: 3
timeout: 30
π Troubleshooting
Diagnostic Tool
Run the diagnostic script to check your setup:
python scripts/diagnose.py
This will check:
- Python version
- Required dependencies
- Configuration files
- Environment variables
- OpenAI API key conflicts
- Connection to OpenAI
Common Issues
"Server disconnected"
- Check Python installation
- Verify path in Claude config
- Check for error messages in terminal
"Image generation failed"
- Verify OpenAI API key is valid
- Check API credits
- Ensure proper .env file format
- Check if you have conflicting
OPENAI_API_KEYin system environment variables - Try adding the API key directly to Claude Desktop config (see Option 2 above)
"Authentication failed"
- Regenerate WordPress application password
- Check username is correct
- Verify site URL includes protocol (https://)
π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
- Model Context Protocol by Anthropic
- WordPress REST API team
- OpenAI for DALL-E 3
π Support
- π§ Email: shay@seomentor.co.il
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
Made with β€οΈ by Shay Amos for WordPress developers, SEO`s and AI enthusiasts
Visit my website for more cool apps :) https://www.seomentor.co.il
Related Servers
Obsidian
Interact with your Obsidian vault using natural language.
n8n Workflow Builder
Create, manage, and execute n8n workflows using natural language.
MCP-Zentao
An API integration for the Zentao project management system, supporting task management and bug tracking.
BakalΓ‘Εi
Access data from the BakalΓ‘Εi school system, including schedules, absences, and grades, through a standardized API.
Feishu/Lark OpenAPI MCP
Connect AI agents with the Feishu/Lark platform for automation, including document processing, conversation management, and calendar scheduling.
Trello
Interact with Trello boards, lists, and cards using the Trello REST API.
IT Tools
Provides access to over 70 IT tools and utilities for developers and IT professionals, including encoding, text manipulation, and network tools.
Jira MCP Server by CData
A read-only MCP server for Jira, enabling LLMs to query live Jira data using the CData JDBC Driver.
Rednote MCP
An automated tool for searching and commenting on the social media platform Xiaohongshu (Rednote) using Playwright.
Ghost CMS
Automate Ghost CMS with full CRUD operations, bulk actions, and advanced features.