
WooCommerce MCP Server
A Model Context Protocol (MCP) server for WooCommerce integration, compatible with Windows, macOS, and Linux.
Overview
This MCP server enables interaction with WooCommerce stores through the WordPress REST API. It provides comprehensive tools for managing all aspects of products, orders, customers, shipping, taxes, discounts, and store configuration using JSON-RPC 2.0 protocol.
Showcase your WooCommerce store to 800+ million ChatGPT users! Check out WooCommerce ChatGPT App - A visual shopping assistant built using MCP and ChatGPT SDK with beautiful UI displaying products, images, prices, and descriptions. Browse, search, filter, and seamlessly navigate to your store - all within ChatGPT.
Installation - WooCommerce MCP Server
- Clone the repository
- Install dependencies:
npm install
- Build the project:
npm run build
Configuration
Add the server to your MCP settings file with environment variables for credentials:
{
"mcpServers": {
"woocommerce": {
"command": "node",
"args": ["path/to/build/index.js"],
"env": {
"WORDPRESS_SITE_URL": "https://your-wordpress-site.com",
"WOOCOMMERCE_CONSUMER_KEY": "your-woocommerce-consumer-key",
"WOOCOMMERCE_CONSUMER_SECRET": "your-woocommerce-consumer-secret",
"WORDPRESS_USERNAME": "your-wordpress-username",
"WORDPRESS_PASSWORD": "your-wordpress-password"
}
}
}
}
Environment Variables
Required for WooCommerce API access:
WORDPRESS_SITE_URL: Your WordPress site URL (WooCommerce is a WordPress plugin)
WOOCOMMERCE_CONSUMER_KEY: WooCommerce REST API consumer key
WOOCOMMERCE_CONSUMER_SECRET: WooCommerce REST API consumer secret
Required only for WordPress API methods:
WORDPRESS_USERNAME: WordPress username with appropriate permissions
WORDPRESS_PASSWORD: WordPress password for authentication
You can also provide these credentials in the request parameters if you prefer not to use environment variables.
Authentication Options
WooCommerce Authentication
WooCommerce API access requires consumer keys that you can generate in your WordPress dashboard under WooCommerce → Settings → Advanced → REST API.
WordPress Authentication
For WordPress-specific methods (like managing posts), you need to provide:
- Username/password credentials for basic authentication
- The WordPress REST API must be enabled on your site
API Methods
The server supports both WordPress and WooCommerce API methods. Here's a list of available methods grouped by category:
WordPress Content Management
These methods require WordPress username/password credentials and are independent of the WooCommerce API.
WooCommerce Products
Product Categories
Product Attributes
Product Variations
Product Reviews
WooCommerce Orders
Order Notes
Order Refunds
WooCommerce Customers
Shipping
Taxes
Discounts/Coupons
Payment Gateways
Reports
Settings
System Status
Data
Method Parameters
All methods follow a similar parameter structure. Here are some examples:
Common Parameters for All Methods
siteUrl: (optional if set in env) WordPress site URL
Additional Parameters for WooCommerce Methods
consumerKey: (optional if set in env) WooCommerce consumer key
consumerSecret: (optional if set in env) WooCommerce consumer secret
Additional Parameters for WordPress Methods
username: (optional if set in env) WordPress username
password: (optional if set in env) WordPress password
Example Usage
WordPress API Example
{
"jsonrpc": "2.0",
"id": 1,
"method": "create_post",
"params": {
"siteUrl": "https://your-wordpress-site.com",
"username": "your-wordpress-username",
"password": "your-wordpress-password",
"title": "My New Blog Post",
"content": "This is the content of my new blog post.",
"status": "publish"
}
}
WooCommerce Products Example
{
"jsonrpc": "2.0",
"id": 1,
"method": "get_products",
"params": {
"perPage": 20,
"page": 1,
"filters": {
"category": 19,
"status": "publish"
}
}
}
Create Product Example
{
"jsonrpc": "2.0",
"id": 1,
"method": "create_product",
"params": {
"productData": {
"name": "Premium T-Shirt",
"type": "simple",
"regular_price": "29.99",
"description": "Comfortable cotton t-shirt, available in various sizes.",
"short_description": "Premium quality t-shirt.",
"categories": [
{
"id": 19
}
],
"images": [
{
"src": "http://example.com/wp-content/uploads/2022/06/t-shirt.jpg"
}
]
}
}
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "create_product_meta",
"params": {
"productId": 456,
"metaKey": "_custom_product_field",
"metaValue": {
"special_attribute": "value",
"another_attribute": 42
}
}
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "create_order_meta",
"params": {
"orderId": 789,
"metaKey": "_delivery_instructions",
"metaValue": "Leave package at the back door"
}
}
Security Note
For WooCommerce REST API access, you need to generate API keys. You can create them in your WordPress dashboard under WooCommerce → Settings → Advanced → REST API.
Requirements
- Node.js 20.0.0 or higher
- WordPress site with WooCommerce plugin installed
- WooCommerce REST API keys
License
MIT License - See LICENSE file for details