Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/wbimran/wp-mcp-server/archive/refs/heads/main.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
WordPress MCP Server
Connect AI tools (Claude, OpenCode, Codex, Cursor) to your WordPress site using the Model Context Protocol (MCP).
Author: Mohammad Imran
WordPress.org: https://profiles.wordpress.org/imranmd/
GitHub: https://github.com/wbimran/wordpress-mcp-server
What is this?
This project has two parts:
- WordPress Plugin (
wp-plugin/) — Adds secure REST API endpoints to your WordPress site - MCP Server (
mcp-server/) — A Node.js bridge that speaks MCP protocol and connects to those endpoints
Together they let any MCP-compatible AI tool read your WordPress data in real time.
Features
| Tool | What it does |
|---|---|
get_site_info |
Site name, URL, theme, WP version, plugin status |
get_posts |
List posts with search, pagination, post type filter |
get_single_post |
Full post content by ID |
get_users |
Users with role filter |
get_plugins |
All installed plugins + active status |
get_comments |
Comments with post/status filter |
get_terms |
Categories, tags, any taxonomy |
get_media |
Media library files |
get_products |
WooCommerce products (price, SKU, stock) |
get_bp_members |
BuddyPress community members |
get_bp_activity |
BuddyPress activity feed |
Installation
Step 1 — Install the WordPress Plugin
- Copy the
wp-plugin/wbcom-mcp-server.phpfile to your WordPress/wp-content/plugins/wbcom-mcp-server/directory - Activate the plugin in WordPress Admin → Plugins
- Go to Settings → MCP Server
- Click Generate Key and save the API key (copy it — you'll need it next)
Step 2 — Set up the MCP Server
cd mcp-server
npm install
cp .env.example .env
Edit .env:
WP_URL=https://yoursite.com
WP_MCP_API_KEY=your-key-from-step-1
Step 3 — Add to Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"wordpress": {
"command": "node",
"args": ["/absolute/path/to/mcp-server/src/index.js"],
"env": {
"WP_URL": "https://yoursite.com",
"WP_MCP_API_KEY": "your-secret-key"
}
}
}
}
Step 4 — Test with OpenCode / Claude
Start Claude or OpenCode and ask:
- "What plugins are installed on my WordPress site?"
- "Show me the last 5 published posts"
- "List all BuddyPress members"
- "What WooCommerce products do I have?"
Security
- All endpoints require the
X-MCP-API-Keyheader - Keys are compared using
hash_equals()to prevent timing attacks - Plugin content is stripped of HTML before returning
- No write operations — this is a read-only server
Requirements
- WordPress 5.8+
- PHP 7.4+
- Node.js 18+
- Optional: WooCommerce (for
/products) - Optional: BuddyPress (for
/bp-members,/bp-activity)
License
GPL-2.0