A Model Context Protocol (MCP) server for WooCommerce integration, providing AI agents and Claude with tools to manage WooCommerce stores.
This server has been completely rewritten to properly implement the MCP standard:
- ❌ Custom JSON-RPC implementation instead of MCP SDK
- ❌ No proper MCP protocol support (initialization, capabilities, etc.)
- ❌ Custom readline-based transport
- ❌ Massive switch statement with 100+ cases
- ❌ No input validation or proper error handling
- ❌ Not compatible with MCP clients like Claude Desktop
- ✅ Uses official MCP TypeScript SDK (
@modelcontextprotocol/sdk) - ✅ Proper MCP protocol implementation with capabilities
- ✅ Standard stdio transport for MCP clients
- ✅ Clean tool-based architecture with proper schemas
- ✅ Zod validation for all inputs
- ✅ Proper error handling and user-friendly responses
- ✅ Compatible with Claude Desktop and other MCP clients
get_products- Retrieve products with filtering optionsget_product- Get specific product by IDcreate_product- Create new productsupdate_product- Update existing productsdelete_product- Delete products
get_orders- Retrieve orders with filteringget_order- Get specific order by IDcreate_order- Create new ordersupdate_order- Update existing ordersdelete_order- Delete orders
get_customers- Retrieve customersget_customer- Get specific customer by IDcreate_customer- Create new customersupdate_customer- Update existing customersdelete_customer- Delete customers
get_product_categories- Retrieve product categoriesget_product_category- Get specific category by IDcreate_product_category- Create new categoriesupdate_product_category- Update existing categoriesdelete_product_category- Delete categoriesget_product_tags- Retrieve product tagsget_product_tag- Get specific tag by IDcreate_product_tag- Create new tagsupdate_product_tag- Update existing tagsdelete_product_tag- Delete tags
get_coupons- Retrieve coupons with filteringget_coupon- Get specific coupon by IDcreate_coupon- Create new couponsupdate_coupon- Update existing couponsdelete_coupon- Delete coupons
get_product_attributes- Retrieve product attributesget_product_attribute- Get specific attribute by IDcreate_product_attribute- Create new attributesupdate_product_attribute- Update existing attributesdelete_product_attribute- Delete attributes
get_product_variations- Retrieve variations for variable productsget_product_variation- Get specific variation by IDcreate_product_variation- Create new product variationsupdate_product_variation- Update existing variationsdelete_product_variation- Delete variations
get_order_notes- Retrieve notes for ordersget_order_note- Get specific order notecreate_order_note- Add notes to ordersdelete_order_note- Delete order notes
get_order_refunds- Retrieve refunds for ordersget_order_refund- Get specific refund detailscreate_order_refund- Process order refundsdelete_order_refund- Delete refunds
get_sales_report- Get sales data and analyticsget_products_report- Get products performance reportget_orders_report- Get orders analytics reportget_customers_report- Get customers analytics reportget_categories_report- Get categories performance reportget_stock_report- Get stock levels reportget_coupons_report- Get coupons usage reportget_taxes_report- Get taxes report
get_payment_gateways- Retrieve all payment gatewaysget_payment_gateway- Get specific payment gatewayupdate_payment_gateway- Update payment gateway settings
get_product_meta- Retrieve product meta dataset_product_meta- Set (create/update) product meta datadelete_product_meta- Delete product meta dataget_order_meta- Retrieve order meta dataset_order_meta- Set (create/update) order meta datadelete_order_meta- Delete order meta dataget_customer_meta- Retrieve customer meta dataset_customer_meta- Set (create/update) customer meta datadelete_customer_meta- Delete customer meta data
get_product_reviews- Retrieve product reviewsget_product_review- Get specific review by IDcreate_product_review- Create new product reviewupdate_product_review- Update existing reviewdelete_product_review- Delete review
get_settings- Retrieve WooCommerce settings groupsget_setting_options- Get options for specific settings groupupdate_setting_option- Update specific setting options
get_data- Retrieve general WooCommerce dataget_continents- Get continents and their countriesget_countries- Get a list of countriesget_currencies- Get available currenciesget_current_currency- Get current currency information
create_post- Create new WordPress postsget_posts- Retrieve WordPress postsupdate_post- Update existing postsget_post_meta- Get WordPress post meta data
get_system_status- Get WooCommerce system status and diagnosticsget_system_status_tools- Get available system status toolsrun_system_status_tool- Execute system status tools
- Clone the repository:
git clone https://github.com/lord-dubious/woocommerce-mcp-server.git
cd woocommerce-mcp-server- Install dependencies:
npm install- Build the project:
npm run buildSet up your environment variables in a .env file:
# Required for WooCommerce API
WORDPRESS_SITE_URL=https://your-site.com
WOOCOMMERCE_CONSUMER_KEY=ck_your_consumer_key
WOOCOMMERCE_CONSUMER_SECRET=cs_your_consumer_secret
# Optional for WordPress API (if needed)
WORDPRESS_USERNAME=your_username
WORDPRESS_PASSWORD=your_password- Go to your WordPress admin dashboard
- Navigate to WooCommerce > Settings > Advanced > REST API
- Click Add Key
- Set permissions to Read/Write
- Copy the Consumer Key and Consumer Secret
Add to your Claude Desktop MCP configuration:
{
"mcpServers": {
"woocommerce": {
"command": "node",
"args": ["/path/to/woocommerce-mcp-server/build/index.js"],
"env": {
"WORDPRESS_SITE_URL": "https://your-site.com",
"WOOCOMMERCE_CONSUMER_KEY": "ck_your_key",
"WOOCOMMERCE_CONSUMER_SECRET": "cs_your_secret"
}
}
}
}You can test the server directly:
npm startThen send MCP messages via stdin (for debugging).
Once configured, you can ask Claude to:
- "Show me the latest 10 products from my WooCommerce store"
- "Create a new product called 'Test Product' with price $29.99"
- "Get the details of order #123"
- "Show me this month's sales report"
- "List all customers who signed up this week"
- "Create a 20% off coupon for electronics"
- "Add a note to order #456"
- "Process a refund for order #789"
- "Get all variations for product #123"
You can override environment variables per request:
{
credentials: {
siteUrl: "https://different-site.com",
consumerKey: "different_key",
consumerSecret: "different_secret"
}
}- get_products:
perPage,page,search,category,tag,featured,on_sale,min_price,max_price,stock_status - get_product:
productId - create_product:
productData(name, type, regular_price, description, etc.) - update_product:
productId,productData - delete_product:
productId,force
- get_orders:
perPage,page,search,after,before,status,customer,product - get_order:
orderId - create_order:
orderData(billing, shipping, line_items, etc.) - update_order:
orderId,orderData - delete_order:
orderId,force
- get_customers:
perPage,page,search,email,role - get_customer:
customerId - create_customer:
customerData(email, first_name, last_name, billing, shipping) - update_customer:
customerId,customerData - delete_customer:
customerId,force,reassign
- get_product_categories:
perPage,page,search,parent,hide_empty - get_product_category:
categoryId - create_product_category:
categoryData(name, slug, parent, description, etc.) - update_product_category:
categoryId,categoryData - delete_product_category:
categoryId,force
- get_product_tags:
perPage,page,search,hide_empty - get_product_tag:
tagId - create_product_tag:
tagData(name, slug, description) - update_product_tag:
tagId,tagData - delete_product_tag:
tagId,force
- get_coupons:
perPage,page,search,after,before,code - get_coupon:
couponId - create_coupon:
couponData(code, amount, discount_type, etc.) - update_coupon:
couponId,couponData - delete_coupon:
couponId,force
- get_product_attributes:
perPage,page - get_product_attribute:
attributeId - create_product_attribute:
attributeData(name, slug, type, etc.) - update_product_attribute:
attributeId,attributeData - delete_product_attribute:
attributeId,force
- get_sales_report:
period,date_min,date_max - get_products_report:
period,date_min,date_max,perPage,page - get_orders_report:
period,date_min,date_max,perPage,page - get_customers_report:
perPage,page
- get_payment_gateways: No parameters
- get_payment_gateway:
gatewayId - update_payment_gateway:
gatewayId,gatewayData(enabled, title, description, settings)
The server provides detailed error messages for:
- Missing credentials
- Invalid API responses
- Network errors
- Validation errors
All errors are returned in a user-friendly format with context.
- Define input schema with Zod
- Register tool with
server.registerTool() - Implement async handler function
- Add proper error handling
- Update documentation
The server includes a comprehensive testing system to validate all tools and functionality.
npm testThis runs basic schema validation tests without requiring WooCommerce credentials.
# Set up test credentials
export TEST_WORDPRESS_SITE_URL='https://your-test-site.com'
export TEST_WOOCOMMERCE_CONSUMER_KEY='ck_your_test_key'
export TEST_WOOCOMMERCE_CONSUMER_SECRET='cs_your_test_secret'
# Run full API tests
npm run testnpm run test:full # Run comprehensive MCP server tests
npm run validate # Validate build and schemas onlyCopy tests/test-config.example.env to .env and configure your test credentials:
TEST_WORDPRESS_SITE_URL=https://your-test-site.com
TEST_WOOCOMMERCE_CONSUMER_KEY=ck_your_test_key
TEST_WOOCOMMERCE_CONSUMER_SECRET=cs_your_test_secret- ✅ All 91 WooCommerce tools
- ✅ Schema validation for all data types
- ✅ Error handling and edge cases
- ✅ API connectivity and authentication
- ✅ Response format validation
- ✅ Performance metrics
MIT License - see LICENSE file for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
For issues and questions:
- Open an issue on GitHub
- Check WooCommerce REST API documentation
- Review MCP specification