Ecommerce

Talk to your store like it’s your AI assistant

Talk to your store like it’s your AI assistant

Discover the world of WooCommerce MCP in this three-part series. Learn about what MCP is, how it functions, and how to utilize the built-in Abilities. Part two delves into creating Custom Abilities, while part three explores advanced demos and production considerations.

Exploring the realm of WooCommerce, we uncover the Model Context Protocol integration (MCP). Initially introduced as a beta in version 10.3, MCP has evolved with each release. Now, with the stable combination of WooCommerce 10.7 and WordPress 6.9+, we can leverage MCP to create valuable solutions. Let’s dive in and see what we can achieve.

Imagine interacting with an AI assistant, requesting actions like “Show me my low-stock products” or “Create a product named Winter Hoodie for $39.99.” Witness your WooCommerce store responding promptly, executing tasks seamlessly, all without the need to navigate the WordPress Dashboard or make manual REST API calls. Natural language conversations seamlessly translate into tangible store operations, thanks to MCP.

MCP functions as a universal translator bridging AI tools and our WooCommerce store. In the past, integrating AI with our store required custom REST API integrations, manual authentication handling, and complex response parsing. However, MCP simplifies this process by serving as an open-source standard that enables AI assistants like Claude, Cursor, or VS Code to communicate directly with systems like WooCommerce using natural language.

With MCP, AI can explore the capabilities of our store, execute actions securely, and operate within existing permissions. For instance, when we ask Claude Code to “List all products under $20 USD,” MCP translates this request into a format understandable by WooCommerce, securely processes it, and presents the results.

Three key components collaborate to make this seamless interaction possible, all while building upon the robust security framework of WooCommerce.

The building blocks

WordPress Abilities API

The WordPress Abilities API serves as a platform for WordPress plugins to register “Abilities,” defining their functionalities. This serves as a menu of sorts, where WooCommerce communicates its capabilities to WordPress, allowing AI assistants to access and utilize these functionalities. Each ability is identified by a unique name, such as:

  • woocommerce/products-list: to list all products
  • woocommerce/orders-create: to create a new order

Introduced in WordPress 6.9, the Abilities API acts as a standardized registry accessible to any plugin, eliminating the need for WooCommerce to include it separately. Custom Abilities are registered via the wp_abilities_api_init hook, as detailed in part two of this series.

WordPress MCP Adapter

The MCP Adapter functions as the intermediary, translating MCP messages from AI assistants into a format understandable by WordPress. Essentially, it acts as a bridge between the “AI protocol” and “WordPress” languages.

WooCommerce REST API

The current MCP Abilities are linked to existing REST API endpoints in WooCommerce. This ensures that existing REST API permissions govern all operations, maintaining the same level of security. While future iterations may extend beyond REST capabilities, the current setup provides a secure foundation for operations.

The flow of communication

Consider the process when typing a command like “list all products” in Claude Code:

AI Client (Claude, etc.)

↓ (MCP protocol over stdio/JSON-RPC)

Local MCP Proxy (mcp-wordpress-remote)

↓ (HTTP/HTTPS requests with authentication)

Remote WordPress MCP Server (mcp-adapter)

↓ (WordPress Abilities API)

WooCommerce Abilities

↓ (REST API calls or direct operations)

WooCommerce Core

In essence, Claude Code transmits a message to a local proxy tool on our system, which then translates it into a secure web request and forwards it to the MCP endpoint on our WordPress site. The MCP Adapter identifies the relevant ability to execute, which queries orders, products, etc., with the results flowing back through the same channels.

The local proxy (@automattic/mcp-wordpress-remote) is a lightweight Node.js tool installed once during setup, acting as the communication intermediary between AI clients and WordPress.

Initially introduced as a beta in WooCommerce 10.3, MCP featured product and order Abilities. Subsequent updates included the migration to MCP Adapter v0.3.0 in version 10.4, enhancing the transport layer. Since then, the MCP functionality has remained stable through versions 10.5, 10.6, 10.6.1, and the current 10.7 release, forming the foundation for our operations.

While MCP is currently in developer preview, the built-in Abilities focus on product and order CRUD operations (create, read, update, delete). Custom Abilities expand these functionalities, leveraging the robust foundation established by MCP.

WooCommerce comes equipped with nine default MCP Abilities:

Products:

  • woocommerce/products-list
  • products-get
  • products-create
  • products-update
  • products-delete

Orders:

  • woocommerce/orders-list
  • orders-get
  • orders-create
  • orders-update

These default Abilities empower users to streamline various workflows. However, the true potential lies in Custom Abilities, which we’ll delve into further in part two of this series.

Prerequisites

  • A staging site (WooCommerce MCP is in developer preview)
  • WooCommerce 10.7 (or 10.3+)
  • WordPress 6.9+ (for the core Abilities API)
  • Node.js 22+ (required by the latest mcp-wordpress-remote)
  • REST API key with read_write permissions
  • An MCP client (such as Claude Code). Note: Claude Code necessitates a Claude Pro or Max plan ($20/mo+) or Anthropic API credits, and is not available on the free tier.

Enabling MCP

Option 1: Navigate to WP Admin > WooCommerce > Settings > Advanced > Features and activate WooCommerce MCP.

Option 2: Enable via WP-CLI

wp option update woocommerce_feature_mcp_integration_enabled yes

Setting up the connection

Create an API key

  • In your store’s WP Admin dashboard, navigate to WooCommerce > Settings > Advanced > REST API.
  • Click Add Key.
  • Set permissions to Read/Write.
  • Save the consumer key and secret.

Configure Claude Code

Open the Terminal and execute:

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

Important:

  • Replace yourstore.com with your actual staging site URL.
  • Substitute YOUR_CONSUMER_KEY:YOUR_CONSUMER_SECRET with your API credentials.
  • Restart Claude Code to apply the new configuration.

For local development with HTTP: To test locally without HTTPS, add the following filter:

add_filter( 'woocommerce_mcp_allow_insecure_transport', '__return_true' );

Explore the default Abilities provided by WooCommerce, ready for immediate use without any custom coding.

List all products

Ask AI client:List all products in the store.”

Behind the scenes:

  • MCP triggers the ability: woocommerce/products-list
  • Product data, including names, prices, and stock status, is returned.

Create a product

Try this:Create a product named ‘Demo Hoodie’ priced at $29.99.”

MCP initiates:

  • Ability: woocommerce/products-create
  • A new product materializes in the store!

Update a product

Say:Update the Demo Hoodie price to $39.99.”

MCP triggers:

  • Ability: woocommerce/products-update
  • The price adjustment reflects instantly!

Create an order

Test:Create an order for product ID 56 with quantity 2.”

MCP invokes:

  • Ability: woocommerce/orders-create
  • A new order is successfully generated!

Witness the seamless operation of these built-in Abilities, transforming AI-assisted store management into a natural and efficient process. And this is only the tip of the iceberg!

In part two, we’ll explore Custom Abilities in-depth, crafting solutions from scratch such as a Today’s Sales Analytics dashboard, a Low Stock Alert system, and a Customer Lookup tool. Stay tuned for more!

Kamlesh is a Happiness Engineer at WooCommerce. He enjoys assisting customers in maximizing their WordPress and WooCommerce experience, finding inspiration in their achievements. Beyond Woo, he indulges in exploring new technologies, traveling spontaneously, or engaging in spirited cricket matches.

author-avatar

About #JulietsDigitalHub

I'm the creator behind this hub of digital possibilities. My love for JulietsDigitalHub is fueled by a passion for entrepreneurship and the incredible potential of passive income. I've dedicated myself to creating not just a website but a community where individuals like you can explore, learn, and achieve financial freedom through the magic of passive income. Join me in reshaping success by embracing the concept of earning while you sleep. Together, let's make JulietsDigitalHub the go-to destination for turning dreams into reality, one passive income stream at a time. Welcome to a community where innovation meets prosperity, and your journey to financial independence begins!"

Related Posts