Complete guide to integrating WordPress MCP Server with Cline AI assistant
Cline is a powerful VS Code extension that brings AI assistance directly to your editor. With MCP server support, Cline can interact with your WordPress sites through natural language commands.
- Natural Language Interface - Control WordPress through conversational commands
- Integrated Development - WordPress management without leaving VS Code
- Automation - Streamline content creation and site management workflows
- Multi-Site Support - Manage multiple WordPress sites from one interface
Via VS Code Marketplace:
code --install-extension cline.clineManual Installation:
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "Cline"
- Click "Install"
Global Installation:
npm install -g mcp-wordpressOr use NPX (recommended):
# NPX will automatically download and run the latest version
npx mcp-wordpress --version# Test MCP server
npx mcp-wordpress wp_test_auth
# Check Cline extension
code --list-extensions | grep cline-
Open Cline Settings
- Open Command Palette (Ctrl+Shift+P)
- Type "Cline: Open Settings"
- Or navigate to File > Preferences > Settings > Extensions > Cline
-
Add MCP Server Configuration
In Cline settings, add:
{ "cline.mcpServers": { "wordpress": { "command": "npx", "args": ["-y", "mcp-wordpress"], "env": { "WORDPRESS_SITE_URL": "https://your-site.com", "WORDPRESS_USERNAME": "your-username", "WORDPRESS_APP_PASSWORD": "your-app-password" } } } }
For managing multiple WordPress sites:
{
"cline.mcpServers": {
"wordpress-main": {
"command": "npx",
"args": ["-y", "mcp-wordpress"],
"env": {
"WORDPRESS_SITE_URL": "https://main-site.com",
"WORDPRESS_USERNAME": "admin",
"WORDPRESS_APP_PASSWORD": "xxxx-xxxx-xxxx-xxxx"
}
},
"wordpress-blog": {
"command": "npx",
"args": ["-y", "mcp-wordpress"],
"env": {
"WORDPRESS_SITE_URL": "https://blog.company.com",
"WORDPRESS_USERNAME": "editor",
"WORDPRESS_APP_PASSWORD": "yyyy-yyyy-yyyy-yyyy"
}
},
"wordpress-store": {
"command": "npx",
"args": ["-y", "mcp-wordpress"],
"env": {
"WORDPRESS_SITE_URL": "https://store.company.com",
"WORDPRESS_USERNAME": "shop-manager",
"WORDPRESS_APP_PASSWORD": "zzzz-zzzz-zzzz-zzzz"
}
}
}
}Performance Optimization:
{
"cline.mcpServers": {
"wordpress": {
"command": "node",
"args": ["./node_modules/mcp-wordpress/dist/index.js"],
"env": {
"WORDPRESS_SITE_URL": "https://your-site.com",
"WORDPRESS_USERNAME": "your-username",
"WORDPRESS_APP_PASSWORD": "your-app-password",
"MCP_CACHE_ENABLED": "true",
"MCP_CACHE_TTL": "300",
"MCP_REQUEST_TIMEOUT": "30000",
"DEBUG": "mcp-wordpress:*"
},
"timeout": 30000
}
}
}Test Connection:
You: "Test my WordPress connection"
Cline: "I'll test your WordPress connection using the MCP server..."
Result: ✅ Authentication successful! Connected to: Your Site Name
List Recent Posts:
You: "Show me my recent WordPress posts"
Cline: "Let me fetch your recent posts..."
Result: 📊 Posts Summary: 15 total posts
📝 Status Breakdown: publish: 12, draft: 3
🌐 Source: https://your-site.com
Create New Post:
You: "Create a new WordPress post titled 'AI in Web Development' with content about modern AI tools"
Cline: "I'll create a new post about AI in web development..."
Result: ✅ Post "AI in Web Development" created successfully (ID: 123)
🔗 Edit: https://your-site.com/wp-admin/post.php?post=123&action=edit
Search Content:
You: "Search for all posts containing 'tutorial' in my WordPress site"
Cline: "Searching for posts containing 'tutorial'..."
Result: Found 8 results for "tutorial":
- [post] Complete WordPress Tutorial
- [post] CSS Grid Tutorial
- [page] Tutorial Archive
Update Existing Post:
You: "Update post ID 123 to change its status to published"
Cline: "I'll update the post status to published..."
Result: ✅ Post 123 updated successfully
Status changed from draft to publish
Manage Media:
You: "Upload the image 'hero-banner.jpg' from my desktop to WordPress"
Cline: "I'll upload the image to your WordPress media library..."
Result: ✅ Media uploaded successfully (ID: 456)
📎 File: hero-banner.jpg
🔗 URL: https://your-site.com/wp-content/uploads/2024/01/hero-banner.jpg
Check Site Health:
You: "Check my WordPress site health and performance"
Cline: "I'll check your site health and performance metrics..."
Result: 📊 Site Health Report:
- Cache hit rate: 67%
- Average response time: 245ms
- Total posts: 150
- Total users: 12
User Management:
You: "List all users with admin role on my WordPress site"
Cline: "I'll list all administrator users..."
Result: 👥 Administrator Users:
- John Doe (john@example.com) - Last login: 2024-01-14
- Jane Smith (jane@example.com) - Last login: 2024-01-15
Backup Content:
You: "Export all my WordPress posts as a backup"
Cline: "I'll export your WordPress posts..."
Result: 📦 Backup created: wordpress-posts-2024-01-15.json
📊 Exported: 150 posts, 25 pages, 8 media items
Site-Specific Operations:
You: "List posts from my blog site and store site"
Cline: "I'll list posts from both sites..."
Result: 📝 Blog Site (blog.company.com): 45 posts
📝 Store Site (store.company.com): 23 posts
Cross-Site Content:
You: "Create the same post on both my main site and blog site"
Cline: "I'll create the post on both sites..."
Result: ✅ Post created on main-site (ID: 123)
✅ Post created on blog-site (ID: 456)
AI-Powered Blog Post Creation:
You: "Create a comprehensive blog post about 'WordPress Security Best Practices' with:
- SEO-optimized title
- Meta description
- 1500+ words
- Proper heading structure
- Call-to-action"
Cline: "I'll create a comprehensive WordPress security blog post..."
[Generates content with AI]
[Uses wp_create_post with optimized content]
[Adds meta description and SEO elements]
[Sets proper categories and tags]
Content Series Management:
You: "Create a 5-part tutorial series about 'WordPress Development' with:
- Sequential numbering
- Cross-references between posts
- Same category and tags
- Published on schedule"
Cline: "I'll create a 5-part tutorial series..."
[Creates multiple posts with wp_create_post]
[Sets up proper taxonomy structure]
[Schedules posts for publication]
Regular Maintenance Tasks:
You: "Perform my weekly WordPress maintenance routine:
- Check site performance
- List recent comments for moderation
- Clear cache
- Generate performance report"
Cline: "I'll perform your weekly maintenance routine..."
[Uses wp_performance_stats]
[Uses wp_list_comments with pending status]
[Uses wp_cache_clear]
[Generates comprehensive report]
Security Audit Workflow:
You: "Perform a security audit of my WordPress site:
- Check user permissions
- Review recent login activity
- Validate authentication settings
- Generate security report"
Cline: "I'll perform a security audit..."
[Uses wp_list_users with role analysis]
[Uses wp_get_auth_status]
[Reviews user capabilities]
[Generates security recommendations]
Theme Development Support:
You: "Help me test my new WordPress theme:
- Create sample posts for each post format
- Test with different content lengths
- Verify category and tag display"
Cline: "I'll help test your theme with sample content..."
[Creates posts with various formats]
[Tests different content scenarios]
[Verifies taxonomy display]
Plugin Testing:
You: "Test my WordPress plugin functionality:
- Create test posts
- Test plugin features
- Verify data integrity"
Cline: "I'll test your plugin functionality..."
[Creates test content]
[Executes plugin-specific operations]
[Validates results]
1. MCP Server Not Responding
Error: "MCP server 'wordpress' is not responding"
Solution:
1. Check if MCP server is installed: npx mcp-wordpress --version
2. Verify credentials in configuration
3. Test connection manually: npx mcp-wordpress wp_test_auth
4. Check VS Code output panel for errors
2. Authentication Failures
Error: "Authentication failed: 401 Unauthorized"
Solution:
1. Verify WordPress application password format (no quotes)
2. Check username spelling and case sensitivity
3. Ensure Application Passwords are enabled in WordPress
4. Test with curl:
curl -u username:app-password https://your-site.com/wp-json/wp/v2/users/me
3. Timeout Issues
Error: "Request timeout after 30 seconds"
Solution:
1. Increase timeout in configuration:
"timeout": 60000
2. Check WordPress site performance
3. Verify network connectivity
4. Enable debug mode for detailed logs
Enable Debug Logging:
{
"cline.mcpServers": {
"wordpress": {
"command": "npx",
"args": ["-y", "mcp-wordpress"],
"env": {
"WORDPRESS_SITE_URL": "https://your-site.com",
"WORDPRESS_USERNAME": "your-username",
"WORDPRESS_APP_PASSWORD": "your-app-password",
"DEBUG": "mcp-wordpress:*"
}
}
}
}View Debug Output:
- Open VS Code Output panel (View > Output)
- Select "Cline" from the dropdown
- Look for MCP server logs and errors
Optimize MCP Server Performance:
{
"cline.mcpServers": {
"wordpress": {
"command": "node",
"args": ["./node_modules/mcp-wordpress/dist/index.js"],
"env": {
"WORDPRESS_SITE_URL": "https://your-site.com",
"WORDPRESS_USERNAME": "your-username",
"WORDPRESS_APP_PASSWORD": "your-app-password",
"MCP_CACHE_ENABLED": "true",
"MCP_CACHE_TTL": "300",
"MCP_REQUEST_TIMEOUT": "30000",
"MCP_MAX_CONNECTIONS": "10"
}
}
}
}Cline Configuration Optimization:
{
"cline.autoStart": false,
"cline.maxConcurrentRequests": 3,
"cline.requestTimeout": 30000,
"cline.enableCaching": true
}- Never commit credentials to version control
- Use environment variables for sensitive data
- Regularly rotate WordPress application passwords
- Enable HTTPS for all WordPress connections
- Use minimal required user permissions
- Enable caching for frequently accessed data
- Set appropriate request timeouts
- Use connection pooling for multiple requests
- Monitor resource usage
- Optimize WordPress site performance
- Use descriptive command language
- Be specific about site targets in multi-site setups
- Regularly test integrations
- Document custom workflows
- Keep extensions updated
- Share workspace configuration with team
- Document custom MCP server configurations
- Use consistent naming conventions
- Maintain integration documentation
- GitHub Issues: Report problems
- Community Forum: Get help
- Email Support: support@your-domain.com
This guide is regularly updated. Last updated: 2024-01-15
For Cline-specific questions, visit the Cline GitHub repository