Claude MCP Integration
The AIWU Claude MCP (Model Context Protocol) integration allows Claude AI to directly interact with your WordPress website through a secure server-side connection. This feature enables Claude to perform WordPress administrative tasks through natural language conversation.
System Requirements
- WordPress 5.0 or higher
- AIWU Pro plugin (latest version)
- Valid SSL certificate (HTTPS required)
- Public IP address accessible to Claude.ai
- PHP 7.4 or higher
Important: Claude cannot connect to sites without valid TLS certificates or localhost/private IP addresses.
Setup Instructions
Step 1: Enable MCP in AIWU Settings
- Navigate to WordPress Admin → AIWU → Settings → Plugin Settings
- Locate the Model Context Protocol section
- Enable the following options:
- Enable MCP: Check this box to activate the MCP server
- Access Token: (Optional) Generate a 32-character security token
- Enable MCP logging: Check to log all MCP requests for debugging

Step 2: Configure Claude Connection
- Go to Claude.ai
- Navigate to Settings → Connectors
- Click Add custom connector
- Enter your MCP endpoint URL:
- Without token:
https://your-site.com/wp-json/mcp/v1/sse
- With token:
https://your-site.com/wp-json/mcp/v1/sse?token=your-access-token
- Without token:

Step 3: Configure Tool Permissions
- In Claude.ai, find your connected MCP server
- Click Tools and settings
- Enable/disable specific tools Claude can access
- Configure permission prompts (Claude will ask before using tools)

Available MCP Functions
The AIWU MCP server provides 36 WordPress functions organized into 8 categories:
System Functions
mcp_ping
– Test connection and retrieve basic site infowp_list_plugins
– List installed WordPress plugins
Content Management
wp_get_post_types
– Retrieve available post typeswp_get_posts
– Fetch posts with filtering optionswp_get_post
– Get single post by IDwp_create_post
– Create new posts/pageswp_update_post
– Update existing posts/pageswp_delete_post
– Delete posts/pageswp_count_posts
– Count posts by status
Post Meta & Custom Fields
wp_get_post_meta
– Retrieve post custom fieldswp_update_post_meta
– Set/update post custom fieldswp_delete_post_meta
– Remove post custom fields
Taxonomies (Categories & Tags)
wp_get_taxonomies
– List available taxonomieswp_get_terms
– Fetch taxonomy termswp_create_term
– Create new categories/tagswp_update_term
– Update existing termswp_delete_term
– Delete termswp_get_post_terms
– Get terms assigned to postswp_add_post_terms
– Assign terms to postswp_count_terms
– Count terms in taxonomies
Media Management
wp_get_media
– List media library fileswp_upload_media
– Upload files to media librarywp_update_media
– Update media metadatawp_delete_media
– Delete media fileswp_set_featured_image
– Set post featured imageswp_count_media
– Count media filesaiwu_image
– Generate AI images via AIWU
User Management
wp_get_users
– Retrieve user accountswp_create_user
– Create new user accountswp_update_user
– Update user profiles
Comments
wp_get_comments
– Fetch comments with filteringwp_create_comment
– Add new commentswp_update_comment
– Update/moderate commentswp_delete_comment
– Delete comments
Site Options
wp_get_option
– Get WordPress site optionswp_update_option
– Set WordPress site options
Security Configuration
Access Token Setup
If you set an Access Token in AIWU settings, append it to your MCP URL:
https://your-site.com/wp-json/mcp/v1/sse?token=your-32-character-token
WordPress Permissions
MCP functions respect WordPress user roles and capabilities. The connecting user must have appropriate permissions for each operation.
Logging
When Enable MCP logging is active, all requests and responses are logged to:
/wp-content/plugins/aiwu/logs/mcp-YYYY-MM-DD.log
Server-Side Caching Configuration
Critical: Server-Side Events (SSE) streams must not be cached. Configure your server:
Cloudflare
Add a Page Rule to bypass cache for:
https://your-site.com/wp-json/mcp/v1/sse*
Set: Cache Level = Bypass
NGINX
Add to your server configuration:
location /wp-json/mcp/v1/sse {
add_header Cache-Control "no-cache, no-store, must-revalidate";
add_header Pragma "no-cache";
add_header Expires "0";
}
Apache
Add to .htaccess:
<LocationMatch "/wp-json/mcp/v1/sse">
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "0"
</LocationMatch>
Developer Hooks
AIWU provides hooks for extending MCP functionality:
aiwu_allow_mcp
Filter to customize MCP authentication:
add_filter( 'aiwu_allow_mcp', function( $allowed, $request ) {
// Custom authentication logic
return $allowed;
}, 10, 2 );
aiwu_mcp_tools
Filter to add custom MCP tools:
add_filter( 'aiwu_mcp_tools', function( $tools ) {
$tools['custom_function'] = [
'name' => 'custom_function',
'description' => 'Your custom function',
'inputSchema' => [
'type' => 'object',
'properties' => [
'param1' => [
'type' => 'string',
'description' => 'Parameter description'
]
]
]
];
return $tools;
});
aiwu_mcp_callback
Action to handle custom MCP tool calls:
add_action( 'aiwu_mcp_callback', function( $tool_name, $arguments ) {
if ( $tool_name === 'custom_function' ) {
// Handle your custom function
return [
'content' => [
[
'type' => 'text',
'text' => 'Custom function result'
]
]
];
}
}, 10, 2 );
Usage Examples
Basic Content Creation
Claude, create a new blog post titled "WordPress MCP Integration" with a brief introduction about the technology.
Bulk Operations
Claude, update all posts in the "Technology" category to add the tag "AI" and set the excerpt to the first paragraph of each post.
Media Management
Claude, generate a header image for the post "WordPress Tips" and set it as the featured image.
User Management
Claude, create a new author account for "John Smith" with the email john@example.com and assign the Editor role.
Troubleshooting
Connection Issues
- Verify HTTPS certificate is valid
- Check that your site is publicly accessible
- Confirm MCP is enabled in AIWU settings
- Review server caching configuration
Permission Errors
- Verify WordPress user has required capabilities
- Check if specific MCP tools are enabled in Claude
- Review access token configuration
Performance Issues
- Monitor server resources during MCP operations
- Check MCP logs for errors
- Consider rate limiting for bulk operations
Best Practices
- Always backup your site before testing MCP operations
- Test on staging before using on production sites
- Use access tokens for additional security
- Monitor logs regularly for unusual activity
- Limit tool permissions to only what Claude needs
- Keep AIWU updated for latest security patches
Support
For technical issues with MCP integration:
- Check MCP logs for error details
- Verify server configuration requirements
- Test connection with
mcp_ping
function - Contact AIWU support with log excerpts if needed
The MCP integration is designed to be secure and reliable, but always follow WordPress security best practices when granting AI access to your site.