Enable MCP in WooCommerce in your online store to connect AI models directly to your WooCommerce data. By doing this, you can automate workflows, manage products and orders more efficiently, and deliver personalized shopping experiences. The Model Context Protocol (MCP) makes it easy for AI tools to interact with your store securely and reliably.
In this guide, you’ll learn how to Enable MCP in WooCommerce, why it matters for modern online stores, and the simple steps to set it up for seamless performance. Whether you’re a developer or a store owner, this tutorial will help you unlock the true power of AI-driven eCommerce.
What’s Available in WooCommerce MCP
WooCommerce’s MCP integration provides AI assistants with structured access to core store operations:
Product Management Tools
- List products with filtering and pagination
- Retrieve detailed product information
- Create new products
- Update existing products
- Delete products
Order Management Tools
- List orders with filtering and pagination
- Retrieve detailed order information
- Create new orders
- Update existing orders
Remote WordPress MCP Server
- Runs within WordPress as a plugin
- Exposes the
/wp-json/woocommerce/mcpendpoint - Processes incoming HTTP requests and converts them to MCP protocol messages
- Manages tool discovery and execution
WordPress Abilities System
- The WordPress Abilities System provides a simple and consistent way to define and manage what different tools or users can do.
- It works as a middle layer between MCP tools and real WordPress actions, making communication easier and more secure.
- This system also allows flexible ways to perform tasks — whether through REST API connections, direct database actions, or other custom methods.
Core Components
1. MCP Adapter Provider (MCPAdapterProvider.php)
- Starts and manages the setup of the MCP server.
- Checks if the MCP integration feature is enabled.
- Controls which abilities are available and manages their namespaces.
2. Abilities Registry (AbilitiesRegistry.php)
- Keeps all WooCommerce abilities organized in one place.
- Connects the WordPress Abilities API with WooCommerce features.
- Helps the MCP server find and use available abilities.
3. REST Bridge Implementation (AbilitiesRestBridge.php)
- A test version that links REST API actions with WordPress abilities.
- Clearly defines abilities and provides data structures (schemas) for products and orders.
- Shows how abilities can be built using existing REST controllers.
4. WooCommerce Transport (WooCommerceRestTransport.php)
- Manages API key authentication for WooCommerce.
- Ensures all requests use HTTPS for security.
- Checks user permissions based on their API key access level.
Integration for Enable MCP in WooCommerce
The MCP feature is managed using the mcp_integration feature flag.
You can turn it on through code (programmatically) by adding the required configuration or function in your setup.
add_filter( 'woocommerce_features', function( $features ) {
$features['mcp_integration'] = true;
return $features;
});
Alternatively, you can enable it via WooCommerce CLI:
wp option update woocommerce_feature_mcp_integration_enabled yes
Authentication and Security for Enable MCP in WooCommerce
API Key Requirements
MCP clients authenticate using WooCommerce REST API keys in the X-MCP-API-Key header:
X-MCP-API-Key: ck_your_consumer_key:cs_your_consumer_secret
To create API keys:
- Navigate to WooCommerce → Settings → Advanced → REST API
- Click Add Key
- Set appropriate permissions (
read,write, orread_write) - Generate and securely store the consumer key and secret
HTTPS Enforcement
MCP requests require HTTPS by default. For local development, you can disable this requirement:
add_filter( 'woocommerce_mcp_allow_insecure_transport', '__return_true' );
Permission Validation
The transport layer validates operations against API key permissions:
readpermissions: Allow GET requestswritepermissions: Allow POST, PUT, PATCH, DELETE requestsread_writepermissions: Allow all operations
Server Endpoint
The WooCommerce MCP server is available at:
https://yourstore.com/wp-json/woocommerce/mcp
Connecting MCP Clients to WooCommerce
Proxy Architecture
How the Current MCP Implementation Works
The current MCP setup uses a local proxy to connect MCP clients with WordPress servers.
- MCP Clients (like Claude Code) use the MCP protocol to send and receive data through stdio/JSON-RPC.
- The Local Proxy (
@automattic/mcp-wordpress-remote) runs on your computer and converts these MCP messages into HTTP requests. - The WordPress MCP Server receives those HTTP requests and handles them using the WordPress Abilities System.
Claude Code Integration
To connect Claude Code to your WooCommerce MCP server:
- Go to WooCommerce → Settings → Advanced → REST API
- Create a new API key with “Read/Write” permissions
- Configure MCP with your API key using Claude Code:
claude mcp add woocommerce_mcp \
--env WP_API_URL=https://yourstore.com/wp-json/woocommerce/mcp \
--env CUSTOM_HEADERS='{"X-MCP-API-Key": "YOUR_CONSUMER_KEY:YOUR_CONSUMER_SECRET"}' \
-- npx -y @automattic/mcp-wordpress-remote@latest
Manual MCP Client Configuration
For other MCP clients, add this configuration to your MCP settings. This configuration tells the MCP client to run the mcp-wordpress-remote proxy locally, which will handle the communication with your WordPress server:
{
"mcpServers": {
"woocommerce_mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@automattic/mcp-wordpress-remote@latest"
],
"env": {
"WP_API_URL": "https://yourstore.com/wp-json/woocommerce/mcp",
"CUSTOM_HEADERS": "{\"X-MCP-API-Key\": \"YOUR_CONSUMER_KEY:YOUR_CONSUMER_SECRET\"}"
}
}
}
}
Extending MCP Capabilities
Adding Custom Abilities
Third-party plugins can add their own custom abilities by using the WordPress Abilities API.
These abilities can work in different ways — for example:
- By connecting through REST API endpoints,
- Running direct WordPress operations,
- Using custom business logic, or
- Linking to external services or integrations.
Extending MCP Capabilities
Adding Custom Abilities
Third-party plugins can add their own custom abilities by using the WordPress Abilities API.
These abilities can work in different ways — for example:
- By connecting through REST API endpoints,
- Running direct WordPress operations,
- Using custom business logic, or
- Linking to external services or integrations.
Extending MCP Capabilities
Adding Custom Abilities
Third-party plugins can add their own custom abilities by using the WordPress Abilities API.
These abilities can work in different ways — for example:
- By connecting through REST API endpoints,
- Running direct WordPress operations,
- Using custom business logic, or
- Linking to external services or integrations.
Here’s a simple example of how a custom ability can be added:
add_action( 'abilities_api_init', function() {
wp_register_ability(
'your-plugin/custom-operation',
array(
'label' => __( 'Custom Store Operation', 'your-plugin' ),
'description' => __( 'Performs a custom store operation.', 'your-plugin' ),
'execute_callback' => 'your_custom_ability_handler',
'permission_callback' => function () {
return current_user_can( 'manage_woocommerce' );
},
'input_schema' => array(
'type' => 'object',
'properties' => array(
'store_id' => array(
'type' => 'integer',
'description' => 'Store identifier'
)
),
'required' => array( 'store_id' )
),
'output_schema' => array(
'type' => 'object',
'properties' => array(
'success' => array(
'type' => 'boolean',
'description' => 'Operation result'
)
)
)
)
);
});
Including Custom Abilities in WooCommerce MCP Server
add_filter( 'woocommerce_mcp_include_ability', function( $include, $ability_id ) {
if ( str_starts_with( $ability_id, 'your-plugin/' ) ) {
return true;
}
return $include;
}, 10, 2 );
Development Example
For a full working example, check out the WooCommerce MCP Ability Demo Plugin. This demo shows how third-party developers can:
- Register custom abilities using the WordPress Abilities API
- Define detailed input and output schemas
- Handle permissions correctly
- Integrate with the WooCommerce MCP server
The demo plugin adds a woocommerce-demo/store-info ability that retrieves store information and statistics. It demonstrates how to extend WooCommerce MCP capabilities using a direct implementation approach, instead of relying on REST endpoint bridging.
Troubleshooting
Common Issues
1. MCP Server Not Available
- Make sure the
mcp_integrationfeature flag is turned on. - Check that the MCP adapter is properly loaded.
- Look at WooCommerce logs for any initialization errors.
2. Authentication Failures
- Confirm your API key format is correct:
consumer_key:consumer_secret. - Verify that the API key permissions match the operation you’re trying to perform.
- Ensure HTTPS is being used, or allow it explicitly for development purposes.
3. Ability Not Found
- Make sure abilities are registered during
abilities_api_init. - Check that the ability is included in the correct namespace using the
woocommerce_mcp_include_abilityfilter. - Verify that ability callbacks are accessible.
- Review WooCommerce logs (WooCommerce → Status → Logs) for entries with the source
woocommerce-mcp.
This guide is inspired by the WooCommerce MCP documentation and adapted for easier understanding and practical implementation.
👉 That’s it! How you can enable MCP for Your Website.
👉 Submit your request now and let’s start building your dream eCommerce store.
📧 Have questions before you start? Visit our Contact Page
🌐 Browse our full range of services at codersgrow.com
🛍️ Check out our Store for ready-to-use solutions
📖 Explore our Blogs for insights, tips, and industry updates