woocommerce-mcp
Provides tools for browsing and managing WooCommerce stores via the WooCommerce REST API, including products, orders, refunds, customers, stock, coupons, bulk price and stock updates, and sales analytics, with previewed writes and audit logging.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
woocommerce-mcp
A Model Context Protocol server for running one or more WooCommerce stores through the WooCommerce REST API. MCP clients can browse the catalog, work through and fulfill orders, issue refunds, adjust prices and stock in bulk, run promotions, segment customers, react to webhooks, and read sales analytics. Every change is previewed before it is applied and can be written to an audit log.
It runs locally over stdio, or as a remote service over streamable HTTP with bearer-token or OAuth 2.0 authentication, and ships as a Docker image on the GitHub Container Registry.
Documentation: https://sadrmanesh.github.io/woocommerce-mcp/ · Tool explorer: Hugging Face Space
Read more: Safe write tools for agents: preview, confirm, audit, and stale previews in a WooCommerce MCP server on Dev.to · Preview, confirm, audit on LinkedIn
Listed on the official MCP Registry as io.github.sadrmanesh/woocommerce-mcp, on Glama, and on mcpservers.org.
Contents
Related MCP server: WooCommerce MCP Server
Highlights
Multi-store. Configure any number of stores and pick one per call with
store. Each store has its own credentials and its own read-only switch.Safe by default. Stores are read-only until you allow writes. Write tools then return a preview of the exact REST request and apply it only when called again with
confirm: true. A confirm is refused if the arguments or the store data the change was computed from changed since the preview.dryRun: truealways previews.Signed approvals (optional). Set
WOOCOMMERCE_APPROVAL_SECRETand a confirm also needs a short-lived, single-use token signed for that exact preview by someone outside the agent's reach, for example withwoocommerce-mcp approve <previewId>. The agent cannot approve its own writes.Audit log. One JSON line per write attempt: applied, previewed, refused, or failed, with the tool, store, arguments, caller, and a preview id that links each confirmed write to its preview.
Refunds and bulk operations. Partial or line-item refunds, batch updates of up to 100 products, and percentage or fixed price adjustments.
Analytics. Sales by day, week, or month with refunds, average order value, top products, and payment methods, plus a low-stock report that covers variations.
Promotions and customers. Coupon performance, scheduled sales, and customer segments such as VIP, repeat, and at risk.
Fulfillment. Order notes, shipment tracking, and one-step fulfillment that emails the customer.
Webhooks. Manage store webhooks and receive signed deliveries, readable as MCP resources.
Shipping and taxes. Read shipping zones, methods, tax rates, and tax classes.
Privacy and control. Optional PII redaction, and tool allow and deny lists per deployment or per store.
Gentle on the store. Per-store rate limiting, retries with backoff and jitter, and an optional read cache.
Remote ready. Streamable HTTP with static bearer tokens (full or read-only) or RFC 7662 token introspection, RFC 9728 protected resource metadata, Host and Origin checks, and a health endpoint.
MCP resources and prompts. Read products and orders by URI, and start common workflows such as a sales briefing or a restock plan.
Observability. Optional OpenTelemetry traces for every tool call and WooCommerce request.
Well tested. Strict TypeScript, Zod validation on every input, and tests against a mocked WooCommerce API.
Quick start
Node.js 20 or newer is required.
npm install -g @sadrmanesh/woocommerce-mcpOr run the Docker image from the GitHub Container Registry (linux/amd64 and linux/arm64, tags X.Y.Z, X.Y, and latest). The same image is on Docker Hub as sadrmanesh/woocommerce-mcp:
docker run --rm -i -e MCP_TRANSPORT=stdio \
-e WOOCOMMERCE_URL -e WOOCOMMERCE_CONSUMER_KEY -e WOOCOMMERCE_CONSUMER_SECRET \
ghcr.io/sadrmanesh/woocommerce-mcp:0.6.0The npm package is also on GitHub Packages; see Install options for the .npmrc setup. npmjs.com remains the main registry.
Or from a checkout:
git clone https://github.com/sadrmanesh/woocommerce-mcp.git
cd woocommerce-mcp
npm install
npm run build
cp .env.example .envCreate a REST API key under WooCommerce > Settings > Advanced > REST API. Use a Read key while the store is read-only, and a Read/Write key only when you enable writes. WordPress permalinks must not be set to "Plain", or /wp-json/ will not resolve.
WOOCOMMERCE_URL=https://store.example.com \
WOOCOMMERCE_CONSUMER_KEY=ck_... \
WOOCOMMERCE_CONSUMER_SECRET=cs_... \
woocommerce-mcpThe process then serves MCP on stdin and stdout. Logs go to stderr. npm start in a checkout loads .env from the working directory without overriding variables that are already set.
Connect an MCP client
Most hosts accept an mcpServers map like the ones below. Keep secrets in env, never in args. Docker, Smithery, and MCP Registry installs are in docs/install.md.
stdio
{
"mcpServers": {
"woocommerce": {
"command": "npx",
"args": ["-y", "@sadrmanesh/woocommerce-mcp"],
"env": {
"WOOCOMMERCE_URL": "https://store.example.com",
"WOOCOMMERCE_CONSUMER_KEY": "ck_your_consumer_key",
"WOOCOMMERCE_CONSUMER_SECRET": "cs_your_consumer_secret"
}
}
}
}From a checkout, use "command": "node" and "args": ["/absolute/path/to/woocommerce-mcp/dist/index.js"].
Streamable HTTP
MCP_TRANSPORT=http MCP_HTTP_AUTH_TOKENS="$(openssl rand -base64 32)" woocommerce-mcp{
"mcpServers": {
"woocommerce": {
"type": "http",
"url": "https://mcp.example.com/mcp",
"headers": { "Authorization": "Bearer <token>" }
}
}
}Without authentication the HTTP endpoint only binds to loopback. See docs/security.md for tokens, scopes, and OAuth introspection.
Tools, resources, and prompts
Every tool except woocommerce_list_stores accepts an optional store id. Without it, the default store is used.
To browse every tool with its full input schema and build tools/call requests in the browser, open the tool explorer on Hugging Face.
Area | Read tools | Write tools |
Stores |
| |
Products |
|
|
Orders |
|
|
Fulfillment |
|
|
Refunds |
|
|
Customers |
|
|
Stock |
|
|
Coupons and sales |
|
|
Webhooks |
|
|
Shipping and taxes |
| |
Analytics |
|
Every name starts with woocommerce_, for example woocommerce_customer_segments. That makes 47 tools: 28 reads and 19 writes.
Resources
URI | Content |
| Configured stores |
| One product |
| One order |
| Recent webhook deliveries |
| One webhook delivery with its payload |
Prompts: sales_briefing, restock_plan, order_triage, and price_change_review.
Full argument and response details are in docs/tools.md.
Safe writes
Read-only stores. A store accepts writes only when
WOOCOMMERCE_READ_ONLY=false(single store) or"readOnly": false(store list). Otherwise write tools fail withread_onlybefore contacting the store.Confirmation. With
WOOCOMMERCE_REQUIRE_CONFIRMATION=true(the default), the first call returns the planned request and changes nothing:{ "status": "confirmation_required", "store": "default", "previewId": "pv_4f1c9a2e7b3d0856", "message": "The change was NOT applied. ...", "request": { "method": "PUT", "path": "orders/1015", "query": {}, "body": { "status": "completed" } } }Calling the tool again with the same arguments and
confirm: trueapplies it.dryRun: truealways previews, even with confirmation turned off. Every preview carries apreviewId; send it back withconfirm: trueand the server refuses the call withpreview_mismatchif the arguments changed since the preview.Tools that compute a write from store data, such as a 10% price increase, resolve it at preview time: the preview lists each record it read under
preconditions, with the current values (before) and the absolute values the write will set (after), and thepreviewIdgains a second part that fingerprints that data. On confirm the server reads the same data again, and if it changed, for example because the price was edited in between, the call is refused withstale_previewand nothing is sent. See Stale previews for what is and is not covered.Scopes. Over authenticated HTTP, write tools also need the
woocommerce:writescope. Read-only tokens can never change a store.Audit. Set
WOOCOMMERCE_AUDIT_LOGto a file path orstderr:{"time":"2026-10-30T14:02:11.120Z","tool":"woocommerce_update_order_status","store":"default","outcome":"applied","arguments":{"id":1015,"status":"completed"},"client":"static:3f9a1c2b7d10","previewId":"pv_4f1c9a2e7b3d0856","previewMatch":true}Signed approvals (optional). A preview id binds what is confirmed, not who confirmed it: by default an agent can request a preview and confirm it in the same turn. Set
WOOCOMMERCE_APPROVAL_SECRETto require anapprovaltoken on every confirm. The token is an HMAC-SHA256 signature over the exactpreviewId(state part included), tool, store, and an expiry, so it cannot be reused for other arguments or a changed store. Tokens are single-use and expire after 10 minutes by default. A person signs one after reviewing the preview:woocommerce-mcp approve pv_e2a742fe51c807fc_a3510d17b8a51b93 --by "Naser"The command shows the previewed change from the audit log, asks for a yes, and prints the token, which the agent passes back as
approvalwithconfirm: true. Missing, invalid, expired, mismatched, and reused tokens are refused withapproval_required,approval_invalid,approval_expired,approval_mismatch, andapproval_replayed. The token format is documented, so an approval page or webhook can sign too.What this is not: whoever holds the secret can approve, so keep it out of MCP client configs, prompts, and any host the agent has a shell on. Spent tokens are tracked in memory per process. Without the secret, behavior is exactly as in 0.5.0. See Signed approvals.
Refunds created by woocommerce_create_refund are recorded as manual refunds unless apiRefund: true asks the payment gateway to return the money.
Configuration
The most common settings are below. Every variable, including the multi-store file format, is in docs/configuration.md and .env.example.
Variable | Default | Description |
| Store origin, without | |
| REST API credentials | |
|
| Allow writes for the single store |
| Several stores, as a JSON file or inline JSON | |
| first store | Store used when a call omits |
|
| Preview writes until |
| off | File path or |
| off | Require a signed approval token on every confirmed write. Keep it away from the agent |
|
| Longest approval token lifetime the server accepts |
|
|
|
|
| HTTP listener |
| Full-access bearer tokens | |
| Read-only bearer tokens | |
|
| Mask names, emails, phones, and addresses in results |
| Tool names or | |
| Enables the webhook receiver for the store | |
|
| Requests per second per store, and burst |
|
| Cache read responses |
|
| Export OpenTelemetry traces |
Multi-store example (stores.json):
{
"defaultStore": "eu",
"stores": [
{ "id": "eu", "label": "EU shop", "url": "https://eu.example.com", "consumerKeyEnv": "EU_KEY", "consumerSecretEnv": "EU_SECRET" },
{ "id": "us", "url": "https://us.example.com", "consumerKeyEnv": "US_KEY", "consumerSecretEnv": "US_SECRET", "readOnly": false }
]
}Deployment
cp .env.example .env # add store credentials and MCP_HTTP_AUTH_TOKENS
docker compose up -d --build
curl http://127.0.0.1:3000/healthzThe image runs as a non-root user, listens on port 3000, and has a health check. Put it behind a TLS-terminating reverse proxy for remote use. See docs/deployment.md.
Development
npm install
npm run check # lint, typecheck, tests, buildTests run against a mocked WooCommerce API and never call a live store. See CONTRIBUTING.md.
Documentation
The full documentation site is at https://sadrmanesh.github.io/woocommerce-mcp/. The same guides are in this repository:
Technical report
Technical Report: WooCommerce Model Context Protocol Server - A Multi-Store, Previewed Safe-Write Architecture for Autonomous AI Agents in E-Commerce. M. N. Sadrmanesh, Zenodo, 2026. https://doi.org/10.5281/zenodo.23897615 Also on ResearchGate and Academia.edu.
@techreport{sadrmanesh2026woocommercemcp,
author = {Sadrmanesh, Mohammad Naser},
title = {Technical Report: WooCommerce Model Context Protocol Server - A Multi-Store, Previewed Safe-Write Architecture for Autonomous AI Agents in E-Commerce},
institution = {Zenodo},
year = {2026},
version = {1.0},
doi = {10.5281/zenodo.23897615},
url = {https://doi.org/10.5281/zenodo.23897615}
}License
MIT. Copyright (c) 2026 Naser Sadrmanesh. See LICENSE.
Author
Naser Sadrmanesh: https://github.com/sadrmanesh · https://sadrmanesh.github.io · info.sadrmanesh@gmail.com
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted WooCommerce MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
MerchantFlow is a hosted, read-only ecommerce analytics MCP server for Shopify and WooCommerce. It gives AI assistants tenant-scoped access to revenue, profit and loss, product and SKU profitability, COGS coverage, fulfillment costs, advertising spend, ROAS, marketing performance, cohorts, LTV, and business valuation across connected commerce and marketing platforms. Connect with OAuth over Streamable HTTP. No local server installation is required.
Federated commerce search across independent WooCommerce merchants. Keyless, read-only MCP server.
Unified MCP server for 70+ eCommerce platforms: products, orders, customers, and more.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceWooCommerce 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.104MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with WooCommerce stores through the WordPress REST API, supporting comprehensive management of products, orders, customers, shipping, taxes, discounts, and store configuration.MIT
- FlicenseNot gradedqualityBmaintenanceEnables secure, read-only access to WooCommerce store data through MCP-compatible assistants, letting users query products, orders, sales summaries, and inventory alerts without exposing store credentials.-
- FlicenseNot gradedqualityBmaintenanceEnables managing WooCommerce stores through a web dashboard and MCP, including viewing products and orders, updating stock quantities, and deleting products via the WooCommerce REST API.-