Skip to main content
Glama
README.md
<div align="center">
  <img src="logo.svg" alt="WPMCP Logo" width="400"/>
  
  # WordPress MCP Server
  
  <p><strong>Enable AI to manage WordPress sites like a professional developer</strong></p>
  <p>190+ tools for complete WordPress control</p>

  <a href="https://glama.ai/mcp/servers/@RaheesAhmed/wordpress-mcp-server">Also Available on glama.ai</a> | <a href="https://www.cursor.store/mcp/RaheesAhmed/wordpress-mcp-server">Cursor.store</a>

  
  [![npm version](https://img.shields.io/npm/v/wpmcp.svg)](https://www.npmjs.com/package/wpmcp)
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
  [![WordPress](https://img.shields.io/badge/WordPress-5.0+-blue.svg)](https://wordpress.org)
  
</div>

---

Video Demo : https://youtu.be/6hwMqXQFKN0

## šŸ’ Support This Project

If this project helps you, consider supporting its development:

**Cryptocurrency Donation**

| **Select Coin** | **Select Network** | **Contract** | **Deposit Address** |
|-----------------|-------------------|--------------|---------------------|
| šŸŖ™ **USDT** (TetherUS) | šŸ”— **TRX** (Tron TRC20) | Ending in `jLj6t` | `TBJBb7fKyRdhqmWETyZoNP4X98mPk2Jxrt` |

Your support helps maintain and improve this project! šŸ™


WPMCP server gives AI agents complete control over WordPress sites. Connect it to Claude, Cline, or any MCP-compatible AI, and manage WordPress through natural language.

**Key Capabilities:**
- āœ… **Content Management** - Posts, pages, media, users, comments
- āœ… **File System Access** - Read and write theme/plugin files
- āœ… **Theme Customization** - Create child themes, modify styles, customize block themes
- āœ… **Plugin Control** - Activate, deactivate, and modify plugins
- āœ… **Menu Management** - Create menus, add items, assign to locations
- āœ… **Custom Content Types** - Manage post types and taxonomies
- āœ… **Shortcodes & Cron** - Execute shortcodes, schedule tasks
- āœ… **Widget System** - Manage sidebars and widgets
- āœ… **Database Operations** - Execute queries, manage options, inspect tables
- āœ… **WooCommerce Integration** - Products, orders, customers, inventory, reports
- āœ… **Gutenberg Blocks** - Block types, patterns, reusable blocks, templates
- āœ… **Advanced SEO** - Sitemaps, redirects, schema markup, Open Graph, analysis
- āœ… **Security Monitoring** - Site health, updates, integrity checks, debug logs
- āœ… **Performance Optimization** - Cache management, database optimization, image processing
- āœ… **Backup & Migration** - Full/partial backups, restore, export/import, cloning
- āœ… **User Roles** - Custom roles, capabilities, permissions, role management
- āœ… **Complete Security** - Multi-layer validation and automatic backups




## Quick Start

### 1. Install

```bash
npm i -g wpmcp@3.0.0
```

### 2. Configure

Add to your MCP client (Claude Desktop, Cline, etc.):

```json
{
  "mcpServers": {
    "wordpress": {
      "command": "npx",
      "args": ["-y", "wpmcp@3.0.0"],
      "env": {
        "WORDPRESS_URL": "https://your-site.com",
        "WORDPRESS_USERNAME": "admin",
        "WORDPRESS_PASSWORD": "your-app-password"
      }
    }
  }
}
```

### 3. Install WordPress Plugin (Required)

1. Install `wpmcp-plugin/wpmcp.zip` to `/wp-content/plugins/wpmcp-plugin/`
2. Activate via WordPress Admin → Plugins → "WordPress MCP Server Plugin"
3. Ensure you have `edit_themes` and `edit_plugins` capabilities

**What the plugin enables:**
- File system operations (read, write, delete, copy, move)
- Shortcode execution
- Cron job management
- All advanced WordPress features

See [`wpmcp-plugin/README.md`](./wpmcp-plugin/README.md) for detailed setup guide.

### 4. Use

```
"Create a child theme called 'My Custom Theme'"
"Activate Akismet plugin"
"Read the style.css file from my theme"
"Create a blog post about WordPress and publish it"
```

## Available Tools (130+)

**šŸ‘‰ See [`WPMCP_TOOLS.MD`](./WPMCP_TOOLS.MD) for complete detailed list of all 130 tools.**

| Category | Tools | What You Can Do |
|----------|-------|-----------------|
| **Posts** (15) | create, update, delete, search, schedule, publish, duplicate, bulk | Manage all blog content |
| **Pages** (4) | create, update, delete, hierarchy | Build site structure |
| **Media** (5) | upload, update, delete, featured images | Manage images and files |
| **Users** (4) | create, update, delete, roles | User management |
| **Categories** (4) | create, update, delete, hierarchy | Organize content |
| **Tags** (2) | create, get | Tag content |
| **Comments** (4) | create, update, delete, moderate | Manage discussions |
| **Settings** (4) | get, update site settings | Configure WordPress |
| **SEO** (2) | meta description, focus keywords | Optimize for search |
| **File System** (8) | read, write, delete, copy, move | Edit any file |
| **Theme Manager** (13) | activate, child themes, theme.json, templates | Complete theme control |
| **Plugin Manager** (10) | activate, deactivate, read/write files | Full plugin control |
| **Menu Manager** (8) | create, add items, assign locations | Full navigation control |
| **Custom Types** (7) | get post types, taxonomies, manage terms | Advanced content types |
| **Shortcodes** (3) | list, execute, check existence | Shortcode system |
| **Cron Jobs** (5) | list, schedule, unschedule, run manually | Task scheduling |
| **Widgets** (6) | get sidebars, widgets, types, update | Widget management |
| **Database** (6) | execute queries, manage options, list tables | Database operations |
| **WooCommerce** (15) | products, orders, customers, inventory, coupons | E-commerce management |
| **Gutenberg Blocks** (12) | block types, patterns, reusable blocks, templates | Modern block editor |
| **Security** (7) | site health, updates, integrity, debug logs | Security monitoring |
| **Performance** (8) | cache, optimization, cleanup, image processing | Performance tuning |

## What You Can Do

### Content Management
```
"Create a blog post about AI and publish it"
"Upload an image and set it as featured image for post 5"
"Get all draft posts"
"Create a new page called 'About Us'"
```

### Theme Customization
```
"Create a child theme of Twenty Twenty-Five"
"Read my theme's functions.php file"
"Add custom CSS to make headers blue"
"Get the theme.json configuration"
"List all files in my theme"
```

### Menu Management Examples
```typescript
// Create menu
{
  "name": "Main Navigation",
  "description": "Primary site menu"
}

// Add menu item
{
  "title": "Home",
  "url": "https://yoursite.com",
  "menus": 3
}

// Get menu locations
// No parameters needed

// Assign menu to location
{
  "location": "primary",
  "menuId": 3
}
```

### Plugin Management
```
"Show me all installed plugins"
"Activate the Contact Form 7 plugin"
"Read the main WooCommerce plugin file"
"Deactivate Hello Dolly"
"Check if Yoast SEO is installed"
```

### Menu Management
```
"Create a new menu called 'Main Navigation'"
"Add a Home link to the menu"
"Get all registered menu locations"
"Assign the Main Navigation menu to primary location"
"Show me all menu items in the Main menu"
```

### Custom Post Types & Taxonomies
```
"Show me all registered post types"
"Get details for the 'page' post type"
"Get all taxonomies"
"Show me all categories"
"Create a new category called 'Technology'"
```

### Shortcodes
```
"List all registered shortcodes"
"Execute [gallery ids='1,2,3']"
"Check if 'contact-form' shortcode exists"
```

### Cron Jobs & Scheduled Tasks
```
"Show me all scheduled cron jobs"
"Schedule a daily backup task"
"Run WordPress cron manually"
"Get available cron schedules"
```

### Widgets
```
"Get all widget areas"
"Show me all available widget types"
"Get widgets in the sidebar"
"List inactive widgets"
```

### File Operations
```
"Read style.css from my theme"
"Create a new custom.css file in my theme"
"Copy functions.php to functions-backup.php"
"Delete old-template.php with backup"
```

## Security Features

All operations are secure:
- āœ… Only allowed directories (themes, plugins, uploads)
- āœ… Only safe file extensions (.php, .css, .js, etc.)
- āœ… Malware pattern detection
- āœ… PHP syntax validation
- āœ… Automatic backups before changes
- āœ… WordPress permission system
- āœ… File size limits (10MB)

## WordPress Authentication

**Self-Hosted WordPress:**
1. Use your WordPress admin username and password
2. Basic Authentication is built into the plugin

**WordPress.com:**
1. Requires Business plan or higher
2. Generate Application Password in Settings → Security

## Project Structure

```
src/tools/
ā”œā”€ā”€ posts.ts          # 15 post management tools
ā”œā”€ā”€ pages.ts          # 4 page tools
ā”œā”€ā”€ media.ts          # 5 media tools
ā”œā”€ā”€ filesystem.ts     # 8 file system tools
ā”œā”€ā”€ themes.ts         # 13 theme management tools
ā”œā”€ā”€ plugins.ts        # 10 plugin management tools
ā”œā”€ā”€ menus.ts          # 8 menu management tools
└── all-features.ts   # Users, categories, tags, comments, settings, SEO

filesystem-plugin/
└── wpmcp-filesystem.php  # Required for file operations
```

## Development

```bash
# Clone repository
git clone https://github.com/RaheesAhmed/wordpress-mcp-server.git
cd wordpress-mcp-server

# Install dependencies
npm install

# Build
npm run build

# Run
npm start
```

## Testing

All features tested on live WordPress:
- āœ… 21/21 tests passed
- āœ… File operations working
- āœ… Theme management verified
- āœ… Plugin control confirmed
- āœ… Security validated


## API Examples

### Create Post
```typescript
{
  "title": "My Post",
  "content": "<p>Content here</p>",
  "status": "publish"
}
```

### Create Child Theme
```typescript
{
  "parentTheme": "twentytwentyfive",
  "childName": "My Custom Theme"
}
```

### Activate Plugin
```typescript
{
  "plugin": "akismet/akismet"
}
```

### Read Theme File
```typescript
{
  "theme": "mytheme",
  "filePath": "functions.php"
}
```

### Write File
```typescript
{
  "path": "wp-content/themes/mytheme/custom.css",
  "content": "/* Custom styles */",
  "createBackup": true
}
```

## Contributing

1. Fork the repository
2. Create feature branch (`git checkout -b feature/name`)
3. Commit changes (`git commit -m 'Add feature'`)
4. Push to branch (`git push origin feature/name`)
5. Open Pull Request

## License

MIT License - see [LICENSE](LICENSE)

---

## šŸ’ Support This Project

If you find this project valuable, consider supporting its continued development:

**Cryptocurrency Donation**

| **Coin** | **Network** | **Contract Address** | **Deposit Address** |
|----------|-------------|----------------------|---------------------|
| šŸŖ™ **USDT** (TetherUS) | šŸ”— **TRX** (Tron TRC20) | Ending in `jLj6t` | `TBJBb7fKyRdhqmWETyZoNP4X98mPk2Jxrt` |

**Copy Address:**
```
TBJBb7fKyRdhqmWETyZoNP4X98mPk2Jxrt
```

Your contributions help keep this project active and growing! Thank you for your support! šŸ™

---

**Built for AI-powered WordPress development** šŸš€

TDQS

C2.7/5.0

Scored across 190 tools

Disambiguation3/5

Many tools have clear resource-action separation (posts, users, themes, plugins), but there are overlapping pairs like wordpress_get_posts vs wordpress_search_posts, wordpress_get_plugins vs wordpress_get_plugins_detailed, and wordpress_get_site_info vs wordpress_get_site_health that could cause selection ambiguity. With 190 tools, the sheer volume increases the chance of picking a near-duplicate.

Naming Consistency4/5

Most tools follow a consistent wordpress_<verb>_<noun> pattern (create_post, get_posts, delete_user). However, there are inconsistencies: wordpress_wc_is_active vs wordpress_get_plugins (non-verb prefix), wordpress_theme_exists vs get_ forms, and wordpress_run_cron vs wordpress_list_cron_jobs. These are minor deviations from an otherwise uniform convention.

Tool Count2/5

190 tools is excessive for a single MCP server. The scope spans core content, themes, plugins, files, users, WooCommerce, SEO, performance, security, and database operations, creating a monolithic surface that is difficult to navigate.

Completeness4/5

The tool surface is incredibly comprehensive, covering posts, pages, media, users, taxonomies, comments, themes, plugins, menus, widgets, WooCommerce, and system maintenance. Gaps are minor (e.g., no comment spam moderation, no specific user registration tool), but most obvious workflows are represented.

Maintenance

ActivityInactive
ResponsivenessNo issues