M
MCP Wordpress
作者 @CCwithAi
MCP server by CCwithAi
创建于 5/7/2026
更新于 about 3 hours ago
README
Repository documentation and setup instructions
CCwithAI WordPress MCP Server
A powerful Model Context Protocol (MCP) server for full WordPress content management. Manage posts, pages, media, and SEO metadata (Yoast/RankMath) directly through any MCP-compatible AI client (like Claude Desktop).
Designed for the CCwithAI ecosystem, this server allows a single deployment to manage multiple WordPress sites via environment variables.
🚀 Features
- Content Management: Create, read, update, and publish posts and pages.
- Media Handling: Upload images and set featured images (automatically validates featured images before publishing).
- Gutenberg Compatibility: Automatically wraps raw HTML in the exact
wp:group>wp:htmlblock structure used by modern WordPress themes. - Advanced SEO: Deep integration with Yoast SEO and RankMath (Titles, Descriptions, Focus Keywords, OG tags, and Canonical URLs).
- Schema Support: Supports custom JSON-LD schema injection via the AI SEO KISS plugin.
- Multi-Site Ready: Configure site-specific connections via environment variables.
🛠️ Installation & Setup
1. Prerequisites
- Node.js (v18+) or Docker
- A WordPress site with Application Passwords enabled.
2. Generate WordPress Application Password
- Log in to your WordPress Admin dashboard.
- Go to Users → Profile.
- Scroll down to the Application Passwords section.
- Enter a name for the new password (e.g.,
Claude-MCP). - Click Add New Application Password.
- CRITICAL: Copy the 24-character password immediately. You will not be able to see it again.
3. Choose your Deployment Method
Option A: Local Node.js (Easiest for development)
git clone https://github.com/CCwithAi/MCP-WordPress.git
cd MCP-WordPress
npm install
npm run build
Option B: Docker (Recommended for stability)
# Build the image
docker build -t wordpress-mcp .
# Run the container
docker run -d --name wordpress-mcp \
-e WP_SITE_URL="https://your-wordpress-site.com" \
-e WP_USERNAME="your_username" \
-e WP_APP_PASSWORD="xxxx xxxx xxxx xxxx xxxx xxxx" \
wordpress-mcp
🤖 Configuration for AI Clients
Claude Desktop Setup
Edit your claude_desktop_config.json:
- Mac:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Using Docker (Recommended)
{
"mcpServers": {
"wordpress-mcp": {
"command": "docker",
"args": [
"exec",
"-i",
"-e", "WP_SITE_URL=https://your-site.com",
"-e", "WP_USERNAME=your_username",
"-e", "WP_APP_PASSWORD=xxxx xxxx xxxx xxxx xxxx xxxx",
"wordpress-mcp",
"node",
"dist/index.js"
]
}
}
}
Using Local Node
{
"mcpServers": {
"wordpress-mcp": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/MCP-WordPress/dist/index.js"],
"env": {
"WP_SITE_URL": "https://your-site.com",
"WP_USERNAME": "your_username",
"WP_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
}
}
}
}
📝 Usage Notes
Content Formatting
The server automatically handles block markup. When you provide html_content, it is wrapped in:
<!-- wp:group {"align":"full",...} -->
<div class="wp-block-group alignfull"><!-- wp:html -->
YOUR_CONTENT_HERE
<!-- /wp:html --></div>
<!-- /wp:group -->
Mandatory Featured Images
By default, the server enforces a "Featured Image" requirement for blog posts to ensure high-quality presentation.
- Use
wp_upload_image_from_urlto upload an image. - Use the returned
idasfeatured_media_idinwp_create_post.
📄 License
MIT License. Created by CCwithAI.
快速设置
此服务器的安装指南
安装包 (如果需要)
npx @modelcontextprotocol/server-mcp-wordpress
Cursor 配置 (mcp.json)
{
"mcpServers": {
"ccwithai-mcp-wordpress": {
"command": "npx",
"args": [
"ccwithai-mcp-wordpress"
]
}
}
}