Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/woocommerce/wc-mcp-ability/archive/refs/heads/trunk.zipWooCommerce MCP Ability Demo Plugin
⚠️ DEMO TOOL - NOT PRODUCTION READY ⚠️
This is a demonstration plugin showing how third-party developers can integrate with the WordPress MCP (Model Context Protocol) server by registering custom WooCommerce abilities using the WordPress Abilities API. This plugin is for educational and testing purposes only and should not be used in production environments.
Overview
This plugin demonstrates the integration between:
- WordPress Abilities API - A standardized way to register capabilities in WordPress
- WordPress MCP Adapter - Exposes abilities through a shared MCP server when installed as a separate plugin
Important Notice: The MCP integration in WooCommerce is a developer preview. Implementation details, APIs, and integration patterns may change in future releases. This demo is designed to showcase current capabilities and may require updates as the feature matures.
The demo creates a custom ability that retrieves WooCommerce store information and statistics, showcasing how external plugins can extend the MCP server's capabilities.
Requirements
- WordPress 7.0 or higher (includes the Abilities API)
- PHP 8.0 or higher
- WooCommerce 11.3 or higher
- MCP Adapter plugin for MCP access (not bundled with WooCommerce)
Installation
-
Clone or download this repository to your WordPress plugins directory:
cd wp-content/plugins/ git clone https://github.com/woocommerce/wc-mcp-ability.git wc-mcp-ability -
Activate the plugin through the WordPress admin dashboard or WP-CLI:
wp plugin activate wc-mcp-ability -
Install and activate the MCP Adapter to expose the ability to MCP clients:
wp plugin install mcp-adapter --activate
What This Demo Does
The plugin registers a custom ability called woocommerce-demo/store-info that:
Functionality
- Retrieves basic store information (name, URL, admin email, versions)
- Optionally includes store statistics (product count, order counts by status, customer count)
- Demonstrates proper schema definition for inputs and outputs
- Shows permission handling for MCP abilities
Technical Implementation
- Ability Registration: Uses
wp_register_ability()from the WordPress Abilities API - MCP Integration: Registers a category and uses
meta.mcp.publicto expose the ability through the shared WordPress MCP Adapter - Permission Control: Requires
manage_woocommercecapability for access - Schema Definition: Provides complete JSON schema for both input parameters and output structure
Usage Example
Once installed, connect an MCP client to the adapter's default server. Discover woocommerce-demo/store-info, then call mcp-adapter-execute-ability with these arguments:
{
"ability_name": "woocommerce-demo/store-info",
"parameters": {
"include_stats": true
}
}
Sample Response
{
"store_name": "My WooCommerce Store",
"store_url": "https://example.com",
"admin_email": "admin@example.com",
"woocommerce_version": "11.3.0",
"wordpress_version": "7.0",
"currency": "USD",
"country": "US",
"plugin_source": "WooCommerce Abilities Demo Plugin v1.1.0",
"stats": {
"product_count": 150,
"order_count": 1250,
"order_breakdown": {
"completed": 1100,
"processing": 50,
"pending": 25,
"on-hold": 15,
"cancelled": 35,
"refunded": 20,
"failed": 5
},
"customer_count": 500
}
}
Key Integration Points
1. Ability Registration
add_action( 'wp_abilities_api_categories_init', array( __CLASS__, 'register_ability_category' ) );
add_action( 'wp_abilities_api_init', array( __CLASS__, 'register_store_info_ability' ) );
The ability uses the registered woocommerce-demo category.
2. WordPress MCP Adapter Exposure
'meta' => array(
'mcp' => array(
'public' => true,
'type' => 'tool',
),
),
Note: The woocommerce_mcp_include_ability filter and WooCommerce-specific MCP endpoint were removed in WooCommerce 11.3. The shared adapter's default server uses meta.mcp.public to discover this ability; its permission callback still controls execution.
3. Schema Definition
The plugin demonstrates proper schema definition for both input and output, enabling automatic validation and documentation generation.
Development Guidelines
When creating your own abilities:
- Use Proper Namespacing: Choose a unique namespace for your abilities (e.g.,
your-plugin/ability-name) - Define Complete Schemas: Provide thorough input and output schemas for better integration
- Implement Permission Checks: Always include appropriate permission callbacks
- Handle MCP Exposure: Set
meta.mcp.publictotruefor abilities that should be available through the shared WordPress MCP Adapter - Follow WordPress Coding Standards: Maintain consistency with WordPress development practices
Architecture
WordPress Abilities API
↓ (registers abilities)
WordPress MCP Adapter
↓ (exposes via MCP protocol)
MCP Server
↓ (serves to clients)
MCP Clients (AI assistants, tools, etc.)
Related Resources
- WordPress Abilities API Documentation
- WordPress MCP Adapter Repository
- Model Context Protocol Specification
- WooCommerce MCP Documentation
License
This demo plugin follows the same licensing as WooCommerce core.
Important Disclaimers
- This is a demo tool: Not intended for production use
- Developer Preview: The WooCommerce MCP integration is in developer preview status
- API Changes: Implementation details and APIs may change in future releases
- MCP Server Specific: The
meta.mcp.publicsetting opts this ability into the shared WordPress MCP Adapter's default server
Contributing
This is a demonstration plugin. For contributions to the underlying systems:
- WordPress Abilities API: See the Abilities API documentation
- WordPress MCP Adapter: See the mcp-adapter repository