Woo-mcp-server

Woo-mcp-server

3.2

If you are the rightful owner of Woo-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

WooCommerce MCP Server is a Python-based server that integrates WooCommerce stores with the Model Context Protocol, providing comprehensive tools for managing products, orders, customers, and more.

๐Ÿ›’ WooCommerce MCP Server | Python Edition

ืคืชืจื•ืŸ ืคืฉื•ื˜ ื•ื™ืขื™ืœ ืœื—ื™ื‘ื•ืจ ื—ื ื•ื™ื•ืช WooCommerce ืขื Model Context Protocol

๐Ÿ‡บ๐Ÿ‡ธ English Version | ๐Ÿ‡ฎ๐Ÿ‡ฑ ื’ืจืกื” ืขื‘ืจื™ืช

๐Ÿ“Œ ืžื” ื–ื”?

ืฉืจืช Model Context Protocol (MCP) ื”ืžืืคืฉืจ ืื™ื ื˜ื’ืจืฆื™ื” ืžืœืื” ืขื ื—ื ื•ื™ื•ืช WooCommerce ื‘ืืžืฆืขื•ืช ื”-WordPress REST API. ื”ืกืคืจื™ื™ื” ืžืกืคืงืช ื›ืœื™ื ืžืงื™ืคื™ื ืœื ื™ื”ื•ืœ ื›ืœ ื”ื™ื‘ื˜ื™ ื”ืžื•ืฆืจื™ื, ื”ื–ืžื ื•ืช, ืœืงื•ื—ื•ืช, ืžืฉืœื•ื—, ืžื™ืกื™ื, ื”ื ื—ื•ืช ื•ืงื•ื ืคื™ื’ื•ืจืฆื™ื™ืช ื”ื—ื ื•ืช.

๐Ÿš€ ื”ืชืงื ื” ืžื”ื™ืจื”

# ืฉืœื‘ 1: ืฉื›ืคืœ ืืช ื”ืจืคื•ื–ื™ื˜ื•ืจื™
git clone https://github.com/yourusername/woocommerce-mcp-server.git
cd woocommerce-mcp-server

# ืฉืœื‘ 2: ื”ืชืงืŸ ืชืœื•ื™ื•ืช
pip install -r requirements.txt

# ืฉืœื‘ 3: ื”ื’ื“ืจ ืžืฉืชื ื™ ืกื‘ื™ื‘ื” (ืจืื” ื”ืกื‘ืจ ื‘ื”ืžืฉืš)

โ˜๏ธ ืคืจื™ืกื” ื‘-Railway

ื”ืฉืจืช ืžื•ื›ืŸ ืœืคืจื™ืกื” ืžื™ื™ื“ื™ืช ื‘ืคืœื˜ืคื•ืจืžืช Railway:

# ืฉืœื‘ 1: ืฉื›ืคืœ ืืช ื”ืจืคื•ื–ื™ื˜ื•ืจื™ ืœื—ืฉื‘ื•ืŸ GitHub ืฉืœืš

# ืฉืœื‘ 2: ื”ื™ื›ื ืก ืœ-Railway ื•ื”ืชื—ื‘ืจ ืขื ื—ืฉื‘ื•ืŸ GitHub
# https://railway.app/

# ืฉืœื‘ 3: ืœื—ืฅ ืขืœ "New Project" ื•ื‘ื—ืจ "Deploy from GitHub repo"

# ืฉืœื‘ 4: ื‘ื—ืจ ืืช ื”ืจืคื•ื–ื™ื˜ื•ืจื™ ื”ืžืฉื•ื›ืคืœ

# ืฉืœื‘ 5: ื”ื’ื“ืจ ืืช ืžืฉืชื ื™ ื”ืกื‘ื™ื‘ื” ื”ื‘ืื™ื:
# - WORDPRESS_SITE_URL
# - WOOCOMMERCE_CONSUMER_KEY
# - WOOCOMMERCE_CONSUMER_SECRET
# - WORDPRESS_USERNAME (ืื•ืคืฆื™ื•ื ืœื™)
# - WORDPRESS_PASSWORD (ืื•ืคืฆื™ื•ื ืœื™)
# - MCP_HOST=0.0.0.0
# - MCP_PORT=8000

# ืฉืœื‘ 6: ื”ืžืชืŸ ืœืกื™ื•ื ื”ื‘ื ื™ื™ื” ื•ื”ืคืจื™ืกื”

ื™ืชืจื•ื ื•ืช ืคืจื™ืกื” ื‘-Railway:

  • ๐Ÿ”„ ืคืจื™ืกื” ืื•ื˜ื•ืžื˜ื™ืช ืž-GitHub
  • ๐Ÿ”’ SSL ืื•ื˜ื•ืžื˜ื™
  • ๐Ÿ“Š ื ื™ื˜ื•ืจ ื•ืœื•ื’ื™ื ืžื•ื‘ื ื™ื
  • ๐Ÿ” ื“ื•ืžื™ื™ืŸ ื—ื™ื ืžื™ ืžื•ื‘ื ื” (ืชืช-ื“ื•ืžื™ื™ืŸ ืฉืœ railway.app)
  • โšก ืกืงื™ื™ืœื™ื ื’ ืื•ื˜ื•ืžื˜ื™ ืœืคื™ ื”ืฆื•ืจืš

โš™๏ธ ืงื•ื ืคื™ื’ื•ืจืฆื™ื”

ื™ืฉ ืœื™ืฆื•ืจ ืงื•ื‘ืฅ .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

ืžืฉืชื ื™ ืกื‘ื™ื‘ื”

ืžืฉืชื ื”ืชื™ืื•ืจื ื“ืจืฉ
WORDPRESS_SITE_URLื›ืชื•ื‘ืช ื”ืืชืจ ืฉืœืš (WooCommerce ื”ื•ื ืคืœืื’ื™ืŸ ืฉืœ WordPress)โœ…
WOOCOMMERCE_CONSUMER_KEYืžืคืชื— ืฆืจื›ืŸ WooCommerce REST APIโœ…
WOOCOMMERCE_CONSUMER_SECRETืกื•ื“ ืฆืจื›ืŸ WooCommerce REST APIโœ…
WORDPRESS_USERNAMEืฉื ืžืฉืชืžืฉ WordPress ืขื ื”ืจืฉืื•ืช ืžืชืื™ืžื•ืชโš ๏ธ *
WORDPRESS_PASSWORDืกื™ืกืžืช WordPress ืœืื™ืžื•ืชโš ๏ธ *

* ื ื“ืจืฉ ืจืง ืขื‘ื•ืจ ืฉื™ื˜ื•ืช WordPress API

๐Ÿ” ืืคืฉืจื•ื™ื•ืช ืื™ืžื•ืช

ืื™ืžื•ืช WooCommerce

ื’ื™ืฉื” ืœ-API ืฉืœ WooCommerce ื“ื•ืจืฉืช ืžืคืชื—ื•ืช ืฆืจื›ืŸ ืฉื ื™ืชืŸ ืœื™ืฆื•ืจ ื‘ืœื•ื— ื”ื‘ืงืจื” ืฉืœ WordPress ืชื—ืช WooCommerce โ†’ ื”ื’ื“ืจื•ืช โ†’ ืžืชืงื“ื โ†’ REST API.

ืื™ืžื•ืช WordPress

ืขื‘ื•ืจ ืฉื™ื˜ื•ืช ืกืคืฆื™ืคื™ื•ืช ืœ-WordPress (ื›ืžื• ื ื™ื”ื•ืœ ืคื•ืกื˜ื™ื), ื™ืฉ ืœืกืคืง:

  • ืื™ืฉื•ืจื™ ืฉื ืžืฉืชืžืฉ/ืกื™ืกืžื” ืœืื™ืžื•ืช ื‘ืกื™ืกื™
  • ื”-REST API ืฉืœ WordPress ื—ื™ื™ื‘ ืœื”ื™ื•ืช ืžื•ืคืขืœ ื‘ืืชืจ ืฉืœืš

๐Ÿ”„ ืฉื™ื˜ื•ืช API

ื”ืฉืจืช ืชื•ืžืš ื‘ืฉื™ื˜ื•ืช API ืฉืœ WordPress ื•-WooCommerce. ืœื”ืœืŸ ืจืฉื™ืžืช ื”ืฉื™ื˜ื•ืช ื”ื–ืžื™ื ื•ืช ืžืงื•ื‘ืฆื•ืช ืœืคื™ ืงื˜ื’ื•ืจื™ื”:

ื ื™ื”ื•ืœ ืชื•ื›ืŸ WordPress

ืฉื™ื˜ื•ืช ืืœื” ื“ื•ืจืฉื•ืช ืื™ืฉื•ืจื™ ืฉื ืžืฉืชืžืฉ/ืกื™ืกืžื” ืฉืœ WordPress ื•ื”ืŸ ืขืฆืžืื™ื•ืช ืžื”-API ืฉืœ WooCommerce.

ืฉื™ื˜ื”ืชื™ืื•ืจ
create_postื™ืฆื™ืจืช ืคื•ืกื˜ WordPress ื—ื“ืฉ
get_postsืงื‘ืœืช ืคื•ืกื˜ื™ื ืž-WordPress
update_postืขื“ื›ื•ืŸ ืคื•ืกื˜ WordPress ืงื™ื™ื
get_post_metaืงื‘ืœืช ืžื˜ื-ื“ืื˜ื” ืฉืœ ืคื•ืกื˜
update_post_metaืขื“ื›ื•ืŸ ืžื˜ื-ื“ืื˜ื” ืฉืœ ืคื•ืกื˜
create_post_metaื™ืฆื™ืจืช ืžื˜ื-ื“ืื˜ื” ืฉืœ ืคื•ืกื˜
delete_post_metaืžื—ื™ืงืช ืžื˜ื-ื“ืื˜ื” ืฉืœ ืคื•ืกื˜

ืžื•ืฆืจื™ WooCommerce

ืฉื™ื˜ื”ืชื™ืื•ืจ
get_productsืงื‘ืœืช ืจืฉื™ืžืช ืžื•ืฆืจื™ื
get_productืงื‘ืœืช ืžื•ืฆืจ ื‘ื•ื“ื“ ืœืคื™ ืžื–ื”ื”
create_productื™ืฆื™ืจืช ืžื•ืฆืจ ื—ื“ืฉ
update_productืขื“ื›ื•ืŸ ืžื•ืฆืจ ืงื™ื™ื
delete_productืžื—ื™ืงืช ืžื•ืฆืจ
get_product_metaืงื‘ืœืช ืžื˜ื-ื“ืื˜ื” ืฉืœ ืžื•ืฆืจ
create_product_metaื™ืฆื™ืจื”/ืขื“ื›ื•ืŸ ืžื˜ื-ื“ืื˜ื” ืฉืœ ืžื•ืฆืจ
update_product_metaืขื“ื›ื•ืŸ ืžื˜ื-ื“ืื˜ื” ืฉืœ ืžื•ืฆืจ (ื›ื™ื ื•ื™ ืœื™ืฆื™ืจื”)
delete_product_metaืžื—ื™ืงืช ืžื˜ื-ื“ืื˜ื” ืฉืœ ืžื•ืฆืจ

ืงื˜ื’ื•ืจื™ื•ืช ืžื•ืฆืจื™ื

ืฉื™ื˜ื”ืชื™ืื•ืจ
get_product_categoriesืงื‘ืœืช ืงื˜ื’ื•ืจื™ื•ืช ืžื•ืฆืจื™ื
get_product_categoryืงื‘ืœืช ืงื˜ื’ื•ืจื™ื™ืช ืžื•ืฆืจ ื‘ื•ื“ื“ืช
create_product_categoryื™ืฆื™ืจืช ืงื˜ื’ื•ืจื™ื™ืช ืžื•ืฆืจ ื—ื“ืฉื”
update_product_categoryืขื“ื›ื•ืŸ ืงื˜ื’ื•ืจื™ื™ืช ืžื•ืฆืจ
delete_product_categoryืžื—ื™ืงืช ืงื˜ื’ื•ืจื™ื™ืช ืžื•ืฆืจ

ืชื’ื™ื•ืช ืžื•ืฆืจื™ื

ืฉื™ื˜ื”ืชื™ืื•ืจ
get_product_tagsืงื‘ืœืช ืชื’ื™ื•ืช ืžื•ืฆืจื™ื
get_product_tagืงื‘ืœืช ืชื’ื™ืช ืžื•ืฆืจ ื‘ื•ื“ื“ืช
create_product_tagื™ืฆื™ืจืช ืชื’ื™ืช ืžื•ืฆืจ ื—ื“ืฉื”
update_product_tagืขื“ื›ื•ืŸ ืชื’ื™ืช ืžื•ืฆืจ
delete_product_tagืžื—ื™ืงืช ืชื’ื™ืช ืžื•ืฆืจ

ืžืืคื™ื™ื ื™ ืžื•ืฆืจื™ื

ืฉื™ื˜ื”ืชื™ืื•ืจ
get_product_attributesืงื‘ืœืช ืžืืคื™ื™ื ื™ ืžื•ืฆืจื™ื
get_product_attributeืงื‘ืœืช ืžืืคื™ื™ืŸ ืžื•ืฆืจ ื‘ื•ื“ื“
create_product_attributeื™ืฆื™ืจืช ืžืืคื™ื™ืŸ ืžื•ืฆืจ ื—ื“ืฉ
update_product_attributeืขื“ื›ื•ืŸ ืžืืคื™ื™ืŸ ืžื•ืฆืจ
delete_product_attributeืžื—ื™ืงืช ืžืืคื™ื™ืŸ ืžื•ืฆืจ
get_attribute_termsืงื‘ืœืช ืžื•ื ื—ื™ ืžืืคื™ื™ืŸ
get_attribute_termืงื‘ืœืช ืžื•ื ื— ืžืืคื™ื™ืŸ ื‘ื•ื“ื“
create_attribute_termื™ืฆื™ืจืช ืžื•ื ื— ืžืืคื™ื™ืŸ ื—ื“ืฉ
update_attribute_termืขื“ื›ื•ืŸ ืžื•ื ื— ืžืืคื™ื™ืŸ
delete_attribute_termืžื—ื™ืงืช ืžื•ื ื— ืžืืคื™ื™ืŸ

ื•ืจื™ืืฆื™ื•ืช ืžื•ืฆืจื™ื

ืฉื™ื˜ื”ืชื™ืื•ืจ
get_product_variationsืงื‘ืœืช ื•ืจื™ืืฆื™ื•ืช ืžื•ืฆืจื™ื
get_product_variationืงื‘ืœืช ื•ืจื™ืืฆื™ื™ืช ืžื•ืฆืจ ื‘ื•ื“ื“ืช
create_product_variationื™ืฆื™ืจืช ื•ืจื™ืืฆื™ื™ืช ืžื•ืฆืจ ื—ื“ืฉื”
update_product_variationืขื“ื›ื•ืŸ ื•ืจื™ืืฆื™ื™ืช ืžื•ืฆืจ
delete_product_variationืžื—ื™ืงืช ื•ืจื™ืืฆื™ื™ืช ืžื•ืฆืจ
batch_update_product_variationsืขื“ื›ื•ืŸ ืืฆื•ื•ื” ืฉืœ ื•ืจื™ืืฆื™ื•ืช ืžื•ืฆืจื™ื

ื”ืขืจื•ืช ื”ื–ืžื ื”

ืฉื™ื˜ื”ืชื™ืื•ืจ
get_order_notesืงื‘ืœืช ื”ืขืจื•ืช ื”ื–ืžื ื”
get_order_noteืงื‘ืœืช ื”ืขืจืช ื”ื–ืžื ื” ื‘ื•ื“ื“ืช
create_order_noteื™ืฆื™ืจืช ื”ืขืจืช ื”ื–ืžื ื” ื—ื“ืฉื”
delete_order_noteืžื—ื™ืงืช ื”ืขืจืช ื”ื–ืžื ื”

ื”ื—ื–ืจื™ ื”ื–ืžื ื•ืช

ืฉื™ื˜ื”ืชื™ืื•ืจ
get_order_refundsืงื‘ืœืช ื”ื—ื–ืจื™ ื”ื–ืžื ื•ืช
get_order_refundืงื‘ืœืช ื”ื—ื–ืจ ื”ื–ืžื ื” ื‘ื•ื“ื“
create_order_refundื™ืฆื™ืจืช ื”ื—ื–ืจ ื”ื–ืžื ื” ื—ื“ืฉ
update_order_refundืขื“ื›ื•ืŸ ื”ื—ื–ืจ ื”ื–ืžื ื”
delete_order_refundืžื—ื™ืงืช ื”ื—ื–ืจ ื”ื–ืžื ื”

ืœืงื•ื—ื•ืช WooCommerce

ืฉื™ื˜ื”ืชื™ืื•ืจ
get_customersืงื‘ืœืช ืจืฉื™ืžืช ืœืงื•ื—ื•ืช
get_customerืงื‘ืœืช ืœืงื•ื— ื‘ื•ื“ื“ ืœืคื™ ืžื–ื”ื”
create_customerื™ืฆื™ืจืช ืœืงื•ื— ื—ื“ืฉ
update_customerืขื“ื›ื•ืŸ ืœืงื•ื— ืงื™ื™ื
delete_customerืžื—ื™ืงืช ืœืงื•ื—
get_customer_metaืงื‘ืœืช ืžื˜ื-ื“ืื˜ื” ืฉืœ ืœืงื•ื—
create_customer_metaื™ืฆื™ืจื”/ืขื“ื›ื•ืŸ ืžื˜ื-ื“ืื˜ื” ืฉืœ ืœืงื•ื—
update_customer_metaืขื“ื›ื•ืŸ ืžื˜ื-ื“ืื˜ื” ืฉืœ ืœืงื•ื— (ื›ื™ื ื•ื™ ืœื™ืฆื™ืจื”)
delete_customer_metaืžื—ื™ืงืช ืžื˜ื-ื“ืื˜ื” ืฉืœ ืœืงื•ื—

ืžืฉืœื•ื—

ืฉื™ื˜ื”ืชื™ืื•ืจ
get_shipping_zonesืงื‘ืœืช ืื–ื•ืจื™ ืžืฉืœื•ื—
get_shipping_zoneืงื‘ืœืช ืื–ื•ืจ ืžืฉืœื•ื— ื‘ื•ื“ื“
create_shipping_zoneื™ืฆื™ืจืช ืื–ื•ืจ ืžืฉืœื•ื— ื—ื“ืฉ
update_shipping_zoneืขื“ื›ื•ืŸ ืื–ื•ืจ ืžืฉืœื•ื—
delete_shipping_zoneืžื—ื™ืงืช ืื–ื•ืจ ืžืฉืœื•ื—
get_shipping_methodsืงื‘ืœืช ืฉื™ื˜ื•ืช ืžืฉืœื•ื—
get_zone_shipping_methodsืงื‘ืœืช ืฉื™ื˜ื•ืช ืžืฉืœื•ื— ืœืื–ื•ืจ
get_zone_shipping_methodืงื‘ืœืช ืฉื™ื˜ืช ืžืฉืœื•ื— ืกืคืฆื™ืคื™ืช ืœืื–ื•ืจ
create_zone_shipping_methodื™ืฆื™ืจืช ืฉื™ื˜ืช ืžืฉืœื•ื— ื—ื“ืฉื” ืœืื–ื•ืจ
update_zone_shipping_methodืขื“ื›ื•ืŸ ืฉื™ื˜ืช ืžืฉืœื•ื— ืœืื–ื•ืจ
delete_zone_shipping_methodืžื—ื™ืงืช ืฉื™ื˜ืช ืžืฉืœื•ื— ืžืื–ื•ืจ
get_shipping_zone_locationsืงื‘ืœืช ืžื™ืงื•ืžื™ื ืœืื–ื•ืจ ืžืฉืœื•ื—
update_shipping_zone_locationsืขื“ื›ื•ืŸ ืžื™ืงื•ืžื™ื ืœืื–ื•ืจ ืžืฉืœื•ื—

ืžื™ืกื™ื

ืฉื™ื˜ื”ืชื™ืื•ืจ
get_tax_classesืงื‘ืœืช ืงื˜ื’ื•ืจื™ื•ืช ืžืก
create_tax_classื™ืฆื™ืจืช ืงื˜ื’ื•ืจื™ื™ืช ืžืก ื—ื“ืฉื”
delete_tax_classืžื—ื™ืงืช ืงื˜ื’ื•ืจื™ื™ืช ืžืก
get_tax_ratesืงื‘ืœืช ืฉื™ืขื•ืจื™ ืžืก
get_tax_rateืงื‘ืœืช ืฉื™ืขื•ืจ ืžืก ื‘ื•ื“ื“
create_tax_rateื™ืฆื™ืจืช ืฉื™ืขื•ืจ ืžืก ื—ื“ืฉ
update_tax_rateืขื“ื›ื•ืŸ ืฉื™ืขื•ืจ ืžืก
delete_tax_rateืžื—ื™ืงืช ืฉื™ืขื•ืจ ืžืก
batch_update_tax_ratesืขื“ื›ื•ืŸ ืืฆื•ื•ื” ืฉืœ ืฉื™ืขื•ืจื™ ืžืก

ื”ื ื—ื•ืช/ืงื•ืคื•ื ื™ื

ืฉื™ื˜ื”ืชื™ืื•ืจ
get_couponsืงื‘ืœืช ืงื•ืคื•ื ื™ื
get_couponืงื‘ืœืช ืงื•ืคื•ืŸ ื‘ื•ื“ื“
create_couponื™ืฆื™ืจืช ืงื•ืคื•ืŸ ื—ื“ืฉ
update_couponืขื“ื›ื•ืŸ ืงื•ืคื•ืŸ
delete_couponืžื—ื™ืงืช ืงื•ืคื•ืŸ
batch_update_couponsืขื“ื›ื•ืŸ ืืฆื•ื•ื” ืฉืœ ืงื•ืคื•ื ื™ื

ืฉืขืจื™ ืชืฉืœื•ื

ืฉื™ื˜ื”ืชื™ืื•ืจ
get_payment_gatewaysืงื‘ืœืช ืฉืขืจื™ ืชืฉืœื•ื
get_payment_gatewayืงื‘ืœืช ืฉืขืจ ืชืฉืœื•ื ื‘ื•ื“ื“
update_payment_gatewayืขื“ื›ื•ืŸ ืฉืขืจ ืชืฉืœื•ื

ื“ื•ื—ื•ืช

ืฉื™ื˜ื”ืชื™ืื•ืจ
get_sales_reportืงื‘ืœืช ื“ื•ื—ื•ืช ืžื›ื™ืจื•ืช
get_products_reportืงื‘ืœืช ื“ื•ื—ื•ืช ืžื•ืฆืจื™ื
get_customers_reportืงื‘ืœืช ื“ื•ื—ื•ืช ืœืงื•ื—ื•ืช
get_stock_reportืงื‘ืœืช ื“ื•ื—ื•ืช ืžืœืื™

ื”ื’ื“ืจื•ืช

ืฉื™ื˜ื”ืชื™ืื•ืจ
get_settingsืงื‘ืœืช ื›ืœ ื”ื”ื’ื“ืจื•ืช
get_setting_optionืงื‘ืœืช ืืคืฉืจื•ืช ื”ื’ื“ืจื” ืกืคืฆื™ืคื™ืช
update_setting_optionืขื“ื›ื•ืŸ ืืคืฉืจื•ืช ื”ื’ื“ืจื”
batch_update_settingsืขื“ื›ื•ืŸ ืืฆื•ื•ื” ืฉืœ ื”ื’ื“ืจื•ืช

ืžืฆื‘ ืžืขืจื›ืช

ืฉื™ื˜ื”ืชื™ืื•ืจ
get_system_statusืงื‘ืœืช ืžืฆื‘ ืžืขืจื›ืช
get_system_status_toolsืงื‘ืœืช ื›ืœื™ ืžืฆื‘ ืžืขืจื›ืช
execute_system_status_toolื”ืคืขืœืช ื›ืœื™ ืžืฆื‘ ืžืขืจื›ืช

ื ืชื•ื ื™ื

ืฉื™ื˜ื”ืชื™ืื•ืจ
get_countriesืงื‘ืœืช ื ืชื•ื ื™ ืžื“ื™ื ื•ืช
get_country_statesืงื‘ืœืช ืžื—ื•ื–ื•ืช/ืžื“ื™ื ื•ืช ืขื‘ื•ืจ ืžื“ื™ื ื”
get_currenciesืงื‘ืœืช ื ืชื•ื ื™ ืžื˜ื‘ืขื•ืช
get_currencyืงื‘ืœืช ืคืจื˜ื™ื ืขื‘ื•ืจ ืžื˜ื‘ืข ืกืคืฆื™ืคื™
get_current_currencyืงื‘ืœืช ื”ืžื˜ื‘ืข ื”ื ื•ื›ื—ื™

๐Ÿ’ป ื“ื•ื’ืžืื•ืช ืฉื™ืžื•ืฉ

ืืชื—ื•ืœ ืฉืจืช MCP

import os
from dotenv import load_dotenv
from woocommerce_mcp import initialize

# ื˜ืขื™ื ืช ืžืฉืชื ื™ ืกื‘ื™ื‘ื” ืžืงื•ื‘ืฅ .env
load_dotenv()

# ืืชื—ื•ืœ ืฉืจืช MCP
mcp = initialize()

# ื”ืคืขืœืช ื”ืฉืจืช
async def main():
    mcp.run()

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())

ื“ื•ื’ืžื” ืœืงื‘ืœืช ืžื•ืฆืจื™ื

import asyncio
from woocommerce_mcp.products import get_products

async def list_products():
    # ืงื‘ืœืช ื”ืžื•ืฆืจื™ื ื”ืื—ืจื•ื ื™ื
    products = await get_products({
        "per_page": 20, 
        "page": 1,
        "status": "publish"
    })
    
    for product in products:
        print(f"ืžื•ืฆืจ: {product['name']}, ืžื—ื™ืจ: {product['price']}")

# ื”ืคืขืœืช ื”ืคื•ื ืงืฆื™ื”
asyncio.run(list_products())

ื“ื•ื’ืžื” ืœื™ืฆื™ืจืช ืžื•ืฆืจ

import asyncio
from woocommerce_mcp.products import create_product

async def add_new_product():
    product_data = {
        "name": "ื—ื•ืœืฆืช ืคืจื™ืžื™ื•ื",
        "type": "simple",
        "regular_price": "99.99",
        "description": "ื—ื•ืœืฆืช ื›ื•ืชื ื” ื ื•ื—ื”, ื–ืžื™ื ื” ื‘ืžื’ื•ื•ืŸ ืžื™ื“ื•ืช ื•ืฆื‘ืขื™ื.",
        "short_description": "ื—ื•ืœืฆืช ืคืจื™ืžื™ื•ื ื‘ืื™ื›ื•ืช ื’ื‘ื•ื”ื”.",
        "categories": [
            {
                "id": 19
            }
        ],
        "images": [
            {
                "src": "http://example.com/wp-content/uploads/2022/06/t-shirt.jpg"
            }
        ]
    }
    
    result = await create_product(product_data)
    print(f"ื ื•ืฆืจ ืžื•ืฆืจ ื—ื“ืฉ ืขื ืžื–ื”ื”: {result['id']}")

# ื”ืคืขืœืช ื”ืคื•ื ืงืฆื™ื”
asyncio.run(add_new_product())

๐Ÿ“‹ ืคืจืžื˜ืจื™ื ืœืคื•ื ืงืฆื™ื•ืช

ื›ืœ ื”ืคื•ื ืงืฆื™ื•ืช ืžืงื‘ืœื•ืช ืืช ื”ืคืจืžื˜ืจื™ื ื”ืกืคืฆื™ืคื™ื™ื ืฉืœื”ืŸ ืœืคืขื•ืœืช ื”-API, ื‘ื ื•ืกืฃ ืœืคืจืžื˜ืจื™ื ื”ืื•ืคืฆื™ื•ื ืœื™ื™ื ื”ื‘ืื™ื:

  • site_url: (ืื•ืคืฆื™ื•ื ืœื™ ืื ืžื•ื’ื“ืจ ื‘ืžืฉืชื ื™ ืกื‘ื™ื‘ื”) ื›ืชื•ื‘ืช ืืชืจ WordPress
  • consumer_key: (ืื•ืคืฆื™ื•ื ืœื™ ืื ืžื•ื’ื“ืจ ื‘ืžืฉืชื ื™ ืกื‘ื™ื‘ื”) ืžืคืชื— ืฆืจื›ืŸ WooCommerce
  • consumer_secret: (ืื•ืคืฆื™ื•ื ืœื™ ืื ืžื•ื’ื“ืจ ื‘ืžืฉืชื ื™ ืกื‘ื™ื‘ื”) ืกื•ื“ ืฆืจื›ืŸ WooCommerce
  • ืขื‘ื•ืจ ืฉื™ื˜ื•ืช WordPress: username ื•-password (ืื•ืคืฆื™ื•ื ืœื™ ืื ืžื•ื’ื“ืจ ื‘ืžืฉืชื ื™ ืกื‘ื™ื‘ื”)

๐Ÿ”’ ื”ืขืจืช ืื‘ื˜ื—ื”

ืœื’ื™ืฉื” ืœ-REST API ืฉืœ WooCommerce, ืขืœื™ืš ืœื™ืฆื•ืจ ืžืคืชื—ื•ืช API. ื ื™ืชืŸ ืœื™ืฆื•ืจ ืื•ืชื ื‘ืœื•ื— ื”ื‘ืงืจื” ืฉืœ WordPress ืชื—ืช WooCommerce โ†’ ื”ื’ื“ืจื•ืช โ†’ ืžืชืงื“ื โ†’ REST API.

๐Ÿ“ฆ ื“ืจื™ืฉื•ืช ืžืขืจื›ืช

  • Python 3.9 ื•ืžืขืœื”
  • ืืชืจ WordPress ืขื ืคืœืื’ื™ืŸ WooCommerce ืžื•ืชืงืŸ
  • ืžืคืชื—ื•ืช REST API ืฉืœ WooCommerce
  • ื—ื‘ื™ืœื•ืช Python: mcp-server, httpx, python-dotenv

๐Ÿ“„ ืจื™ืฉื™ื•ืŸ

MIT License - ืจืื” ืงื•ื‘ืฅ LICENSE ืœืคืจื˜ื™ื ื ื•ืกืคื™ื


๐Ÿ›’ WooCommerce MCP Server | Python Edition

A simple and efficient solution for connecting WooCommerce stores with Model Context Protocol

๐Ÿ‡ฎ๐Ÿ‡ฑ Hebrew Version | ๐Ÿ‡บ๐Ÿ‡ธ English Version

๐Ÿ“Œ What is it?

A Model Context Protocol (MCP) server for WooCommerce integration, compatible with WordPress REST API. The library provides comprehensive tools for managing all aspects of products, orders, customers, shipping, taxes, discounts, and store configuration.

๐Ÿš€ Quick Installation

# Step 1: Clone the repository
git clone https://github.com/yourusername/woocommerce-mcp-server.git
cd woocommerce-mcp-server

# Step 2: Install dependencies
pip install -r requirements.txt

# Step 3: Configure environment variables (see below)

โ˜๏ธ Deployment on Railway

The server is ready for immediate deployment on the Railway platform:

# Step 1: Clone the repository to your GitHub account

# Step 2: Log in to Railway and connect with your GitHub account
# https://railway.app/

# Step 3: Click on "New Project" and select "Deploy from GitHub repo"

# Step 4: Select the cloned repository

# Step 5: Configure the following environment variables:
# - WORDPRESS_SITE_URL
# - WOOCOMMERCE_CONSUMER_KEY
# - WOOCOMMERCE_CONSUMER_SECRET
# - WORDPRESS_USERNAME (optional)
# - WORDPRESS_PASSWORD (optional)
# - MCP_HOST=0.0.0.0
# - MCP_PORT=8000

# Step 6: Wait for the build and deployment to complete

Benefits of Deployment on Railway:

  • ๐Ÿ”„ Automatic deployment from GitHub
  • ๐Ÿ”’ Automatic SSL
  • ๐Ÿ“Š Built-in monitoring and logging
  • ๐Ÿ” Free subdomain on railway.app
  • โšก Automatic scaling based on demand

โš™๏ธ Configuration

Create a .env file in the project root with your credentials:

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

VariableDescriptionRequired
WORDPRESS_SITE_URLYour WordPress site URL (WooCommerce is a WordPress plugin)โœ…
WOOCOMMERCE_CONSUMER_KEYWooCommerce REST API consumer keyโœ…
WOOCOMMERCE_CONSUMER_SECRETWooCommerce REST API consumer secretโœ…
WORDPRESS_USERNAMEWordPress username with appropriate permissionsโš ๏ธ *
WORDPRESS_PASSWORDWordPress password for authenticationโš ๏ธ *

* Required only for WordPress API methods

๐Ÿ” 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.

MethodDescription
create_postCreate a new WordPress post
get_postsRetrieve WordPress posts
update_postUpdate an existing WordPress post
get_post_metaGet post metadata
update_post_metaUpdate post metadata
create_post_metaCreate post metadata
delete_post_metaDelete post metadata

WooCommerce Products

MethodDescription
get_productsRetrieve a list of products
get_productGet a single product by ID
create_productCreate a new product
update_productUpdate an existing product
delete_productDelete a product
get_product_metaGet product metadata
create_product_metaCreate/update product metadata
update_product_metaUpdate product metadata (alias for create)
delete_product_metaDelete product metadata

Product Categories

MethodDescription
get_product_categoriesRetrieve product categories
get_product_categoryGet a single product category
create_product_categoryCreate a new product category
update_product_categoryUpdate a product category
delete_product_categoryDelete a product category

Product Tags

MethodDescription
get_product_tagsRetrieve product tags
get_product_tagGet a single product tag
create_product_tagCreate a new product tag
update_product_tagUpdate a product tag
delete_product_tagDelete a product tag

Product Attributes

MethodDescription
get_product_attributesRetrieve product attributes
get_product_attributeGet a single product attribute
create_product_attributeCreate a new product attribute
update_product_attributeUpdate a product attribute
delete_product_attributeDelete a product attribute
get_attribute_termsRetrieve attribute terms
get_attribute_termGet a single attribute term
create_attribute_termCreate a new attribute term
update_attribute_termUpdate an attribute term
delete_attribute_termDelete an attribute term

Product Variations

MethodDescription
get_product_variationsRetrieve product variations
get_product_variationGet a single product variation
create_product_variationCreate a new product variation
update_product_variationUpdate a product variation
delete_product_variationDelete a product variation
batch_update_product_variationsBatch update product variations

Product Reviews

MethodDescription
get_product_reviewsRetrieve product reviews
get_product_reviewGet a single product review
create_product_reviewCreate a new product review
update_product_reviewUpdate a product review
delete_product_reviewDelete a product review

WooCommerce Orders

MethodDescription
get_ordersRetrieve a list of orders
get_orderGet a single order by ID
create_orderCreate a new order
update_orderUpdate an existing order
delete_orderDelete an order
get_order_metaGet order metadata
create_order_metaCreate/update order metadata
update_order_metaUpdate order metadata (alias for create)
delete_order_metaDelete order metadata

Order Notes

MethodDescription
get_order_notesRetrieve order notes
get_order_noteGet a single order note
create_order_noteCreate a new order note
delete_order_noteDelete an order note

Order Refunds

MethodDescription
get_order_refundsRetrieve order refunds
get_order_refundGet a single order refund
create_order_refundCreate a new order refund
update_order_refundUpdate an order refund
delete_order_refundDelete an order refund

WooCommerce Customers

MethodDescription
get_customersRetrieve a list of customers
get_customerGet a single customer by ID
create_customerCreate a new customer
update_customerUpdate an existing customer
delete_customerDelete a customer
get_customer_metaGet customer metadata
create_customer_metaCreate/update customer metadata
update_customer_metaUpdate customer metadata (alias for create)
delete_customer_metaDelete customer metadata

Shipping

MethodDescription
get_shipping_zonesRetrieve shipping zones
get_shipping_zoneGet a single shipping zone
create_shipping_zoneCreate a new shipping zone
update_shipping_zoneUpdate a shipping zone
delete_shipping_zoneDelete a shipping zone
get_shipping_methodsRetrieve shipping methods
get_zone_shipping_methodsGet shipping methods for a zone
get_zone_shipping_methodGet a specific shipping method for a zone
create_zone_shipping_methodCreate a new shipping method for a zone
update_zone_shipping_methodUpdate a shipping method for a zone
delete_zone_shipping_methodDelete a shipping method from a zone
get_shipping_zone_locationsGet locations for a shipping zone
update_shipping_zone_locationsUpdate locations for a shipping zone

Taxes

MethodDescription
get_tax_classesRetrieve tax classes
create_tax_classCreate a new tax class
delete_tax_classDelete a tax class
get_tax_ratesRetrieve tax rates
get_tax_rateGet a single tax rate
create_tax_rateCreate a new tax rate
update_tax_rateUpdate a tax rate
delete_tax_rateDelete a tax rate
batch_update_tax_ratesBatch update tax rates

Discounts/Coupons

MethodDescription
get_couponsRetrieve coupons
get_couponGet a single coupon
create_couponCreate a new coupon
update_couponUpdate a coupon
delete_couponDelete a coupon
batch_update_couponsBatch update coupons

Payment Gateways

MethodDescription
get_payment_gatewaysRetrieve payment gateways
get_payment_gatewayGet a single payment gateway
update_payment_gatewayUpdate a payment gateway

Reports

MethodDescription
get_sales_reportRetrieve sales reports
get_products_reportRetrieve products reports
get_customers_reportRetrieve customers reports
get_stock_reportRetrieve stock reports

Settings

MethodDescription
get_settingsRetrieve all settings
get_setting_optionRetrieve a specific setting option
update_setting_optionUpdate a setting option
batch_update_settingsBatch update settings

System Status

MethodDescription
get_system_statusRetrieve system status
get_system_status_toolsRetrieve system status tools
execute_system_status_toolRun a system status tool

Data

MethodDescription
get_countriesRetrieve countries data
get_country_statesRetrieve states/provinces for a country
get_currenciesRetrieve currencies data
get_currencyGet details for a specific currency
get_current_currencyGet the current currency

๐Ÿ’ป Usage Examples

Initialize MCP Server

import os
from dotenv import load_dotenv
from woocommerce_mcp import initialize

# Load environment variables from .env
load_dotenv()

# Initialize the MCP server
mcp = initialize()

# Run the server
async def main():
    mcp.run()

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())

Example for Getting Products

import asyncio
from woocommerce_mcp.products import get_products

async def list_products():
    # Get latest products
    products = await get_products({
        "per_page": 20, 
        "page": 1,
        "status": "publish"
    })
    
    for product in products:
        print(f"Product: {product['name']}, Price: {product['price']}")

# Run the function
asyncio.run(list_products())

Example for Creating a Product

import asyncio
from woocommerce_mcp.products import create_product

async def add_new_product():
    product_data = {
        "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"
            }
        ]
    }
    
    result = await create_product(product_data)
    print(f"Created new product with ID: {result['id']}")

# Run the function
asyncio.run(add_new_product())

๐Ÿ“‹ Function Parameters

All functions accept their specific parameters for the API action, plus the following optional parameters:

  • site_url: (optional if set in env) WordPress site URL
  • consumer_key: (optional if set in env) WooCommerce consumer key
  • consumer_secret: (optional if set in env) WooCommerce consumer secret
  • For WordPress methods: username and password (optional if set in env)

๐Ÿ”’ 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.

๐Ÿ“ฆ System Requirements

  • Python 3.9 or higher
  • WordPress site with WooCommerce plugin installed
  • WooCommerce REST API keys
  • Python packages: mcp-server, httpx, python-dotenv

๐Ÿ“„ License

MIT License - See LICENSE file for details