Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

WordPress MCP Manager - A Flask web app for managing WordPress sites through AIWU MCP with Instagram integration

NotificationsYou must be signed in to change notification settings

richhinkle/wordpress-mcp-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A standalone Flask application that provides a web interface for managing WordPress sites via the AIWU MCP (Model Context Protocol) plugin.

Features

  • WordPress Post Management - Create, edit, publish, and delete posts
  • AI Image Generation - Generate images using AIWU's AI capabilities
  • Media Upload - Upload images from URLs to WordPress media library
  • Site Information - View plugins, users, and site health
  • Search & Filter - Find posts by content, status, or keywords
  • Responsive Design - Works on desktop, tablet, and mobile
  • 🔄Instagram Integration - Coming soon!

Prerequisites

  1. WordPress site with AIWU plugin installed and configured
  2. Python 3.8+ installed on your system
  3. AIWU MCP access token from your WordPress admin

Quick Start

1. Clone and Setup

# Clone the repositorygit clone<repository-url>cd wordpress-mcp-manager# Create virtual environmentpython -m venv venv# Activate virtual environment# On Windows:venv\Scripts\activate# On macOS/Linux:source venv/bin/activate# Install dependenciespip install -r requirements.txt

2. Configuration

# Copy environment templatecp .env.example .env# Edit .env file with your WordPress detailsWORDPRESS_URL=https://your-site.com/wp-json/mcp/v1/sseACCESS_TOKEN=your-32-character-access-tokenSECRET_KEY=your-secret-key-for-flaskDEBUG=truePORT=5000

3. Run the Application

# Development serverpython run.py# Or run directlypython app.py

Visithttp://localhost:5000 in your browser.

Production Deployment

Using Gunicorn

# Install gunicorn (already in requirements.txt)pip install gunicorn# Run with gunicorngunicorn --bind 0.0.0.0:5000 --workers 2 app:app

Using Docker

# Build Docker imagedocker build -t wordpress-mcp-manager.# Run containerdocker run -p 5000:5000 \  -e WORDPRESS_URL="https://your-site.com/wp-json/mcp/v1/sse" \  -e ACCESS_TOKEN="your-token" \  -e SECRET_KEY="your-secret" \  wordpress-mcp-manager

Deploy to Heroku

# 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:

  1. Add API endpoints inapp.py
  2. Add MCP client methods in theWordPressMCPClient class
  3. Add frontend functions instatic/app.js
  4. 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:

Expected Format:

{"content": [    {"text":"[{\"ID\": 1,\"post_title\":\"...\"}]","type":"text"    }  ]}

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

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

Support

For issues and questions:

  1. Check the troubleshooting section
  2. Review WordPress and AIWU plugin documentation
  3. Open an issue on GitHub

About

WordPress MCP Manager - A Flask web app for managing WordPress sites through AIWU MCP with Instagram integration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp