You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
# Create Heroku appheroku create your-wp-manager# Set environment variablesheroku config:set WORDPRESS_URL="https://your-site.com/wp-json/mcp/v1/sse"heroku config:set ACCESS_TOKEN="your-token"heroku config:set SECRET_KEY="your-secret-key"# Deploygit push heroku main
API Endpoints
Posts
GET /api/posts - List posts
GET /api/posts/<id> - Get single post
POST /api/posts - Create post
PUT /api/posts/<id> - Update post
DELETE /api/posts/<id> - Delete post
Media
POST /api/media/upload - Upload from URL
POST /api/ai/image - Generate AI image
Site Info
GET /api/health - Health check
GET /api/plugins - List plugins
GET /api/users - List users
Project Structure
wordpress-mcp-manager/├── app.py # Main Flask application├── templates.py # HTML templates├── static/│ └── app.js # Frontend JavaScript├── requirements.txt # Python dependencies├── .env.example # Environment template├── run.py # Development server├── README.md # This file└── Dockerfile # Docker configuration
Adding New Features
The application is designed to be easily extensible. To add new features:
Add API endpoints inapp.py
Add MCP client methods in theWordPressMCPClient class
Add frontend functions instatic/app.js
Update UI intemplates.py
Example: Adding Instagram Integration
# In app.py - Add new client classclassInstagramClient:def__init__(self,access_token):self.access_token=access_tokendefget_recent_posts(self,limit=10):# Instagram API implementationpass# Add new route@app.route('/api/instagram/posts')defget_instagram_posts():# Implementationpass
Troubleshooting
Connection Issues
Verify WordPress URL and access token
Check that AIWU plugin is active
Ensure WordPress site is accessible
CORS Errors
Make sure Flask-CORS is installed
Check that the frontend is served from the same domain
Performance Issues
Increase timeout values for slow WordPress sites
Use gunicorn with multiple workers for production
Consider caching for frequently accessed data
AIWU MCP Response Format Issues
The AIWU MCP plugin returns data in a nested format that requires special parsing:
Solution: Thecall_mcp_function method automatically detects and parses this nested structure, extracting the JSON string fromcontent[0].text and converting it to the expected array format.
Chat Interface Errors
If chat commands fail, check the MCP logs in the console
Use the debug endpoint/api/debug/posts to inspect raw MCP responses
Ensure the WordPress site returns valid JSON in the expected nested format
Security Notes
Always use HTTPS in production
Keep access tokens secure
Use strong secret keys
Consider adding authentication for multi-user deployments
License
MIT License - see LICENSE file for details
Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
Support
For issues and questions:
Check the troubleshooting section
Review WordPress and AIWU plugin documentation
Open an issue on GitHub
About
WordPress MCP Manager - A Flask web app for managing WordPress sites through AIWU MCP with Instagram integration