StoreGuard MCP for WooCommerce
Read-only safety guardrail MCP server plugin for WooCommerce (HPOS-compatible) with scoped read tokens, PII redaction, audit logging, and a zero-install WordPress Playground demo.
Documentation
StoreGuard MCP for WooCommerce — Safety-First MCP Server for WooCommerce HPOS
Live Interactive Dry-Run Diff & Rollback Demo: https://storeguard-mcp.kittenlabs-hq.workers.dev/
StoreGuard MCP for WooCommerce turns your WooCommerce store into a read-only, auditable Model Context Protocol (MCP) endpoint (POST /wp-json/storeguard-mcp/v1/mcp) for Claude Desktop, Cursor, and any Streamable HTTP JSON-RPC 2.0 MCP client — without exposing WordPress admin passwords or risking blind AI catalog mutations.
Why StoreGuard MCP for WooCommerce?
Standard WooCommerce REST API keys are all-or-nothing. Handing a Read/Write REST key to an AI agent means a single prompt hallucination can overwrite 500 product prices to $0.01 or publish a 95% off coupon in 400ms with zero diff preview and zero undo table.
StoreGuard MCP for WooCommerce ships Read-Only by default:
- Zero raw WP passwords: The complete scoped Bearer token (
sgmcp_ro_...orsgmcp_rw_...) is hashed withwp_hash_password()and verified withwp_check_password().hash_equals()compares token IDs, prefixes, and scopes; it does not verify the password hash. The raw token is returned at creation and is not persisted. - 30-second setup: Generate a token in WooCommerce → StoreGuard MCP for WooCommerce and click Copy Claude / Cursor Config JSON.
- WooCommerce HPOS native: Declares
custom_order_tablescompatibility and queries exclusively throughwc_get_orders()andwc_get_products(). - PII-redacted order metrics:
order_summarystrips customer emails and street addresses before returning revenue, AOV, status, and payment gateway totals. - Persistent Audit Log: Records every MCP tool call in
wp_storeguard_audit_log.
Token generation, revocation, and last-used metadata updates use atomic compare-and-swap writes. Concurrent metadata updates cannot overwrite a token revocation.
JSON-RPC batches contain at most 10 requests, including notifications and invalid members. An oversized batch is rejected before any member is dispatched. Invalid request structures receive JSON-RPC errors; only structurally valid requests without an id are treated as notifications.
Included Free Read-Only Audit Tools (GPLv2)
| Tool | Description | HPOS Safe |
|---|---|---|
store_health_audit | HPOS status, WP/WC/PHP versions, catalog & order posture, active guardrails | Yes |
low_stock_report | Managed-stock SKUs at/below threshold + out-of-stock breakdown | Yes |
order_summary | Gross/net revenue, AOV, status & gateway breakdown (pii_redacted: true) | Yes |
coupon_audit | Flags >40% discounts, unlimited-use, expired, or unexpiring coupons | Yes |
broken_sku_finder | Missing/duplicate SKUs, $0 published prices, inverted sales, missing images | Yes |
product_seo_audit | Product titles, Yoast/RankMath SEO meta coverage, short descriptions, alt text | Yes |
30-Second Installation
- Download
storeguard-mcp-for-woocommerce-v1.0.0.zipfrom the Latest GitHub Release. - In WordPress Admin, go to Plugins → Add New → Upload Plugin, upload the ZIP, and activate (requires PHP 8.0+, WordPress 6.4+, WooCommerce 8.0+).
- Open WooCommerce → StoreGuard MCP for WooCommerce, click Generate Read-Only Token, and copy your MCP config:
Cursor (mcp.json)
{
"mcpServers": {
"storeguard-woocommerce": {
"url": "https://yourstore.com/wp-json/storeguard-mcp/v1/mcp",
"headers": {
"Authorization": "Bearer sgmcp_ro_..."
}
}
}
}
Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"storeguard-woocommerce": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://yourstore.com/wp-json/storeguard-mcp/v1/mcp",
"--header",
"Authorization: Bearer ${STOREGUARD_MCP_TOKEN}"
],
"env": {
"STOREGUARD_MCP_TOKEN": "sgmcp_ro_..."
}
}
}
}
Guarded Write Add-on (StoreGuard MCP for WooCommerce Pro)
The Free Core plugin includes clean WordPress extension hooks (storeguard_mcp_registered_write_tools, storeguard_mcp_write_tool_definitions, storeguard_mcp_execute_write_tool) and the wp_storeguard_snapshots rollback table.
For agencies and store operators who also want guarded writes (update_product_meta_safe, bulk_stock_adjust_safe, create_draft_coupon_safe) with mandatory dry_run: true diffs, ±25% price-crash caps, 20-SKU batch limits, and 1-Click Rollback, see StoreGuard MCP for WooCommerce Pro.
Write tools default to preview mode when dry_run is omitted. If supplied, dry_run must be a JSON boolean: only literal false can request a real mutation after the other guardrails pass. Strings such as "false", numbers, and null are rejected. Price percentage caps are checked against the unrounded delta. The product count cap per tool call is separate from the 10-request JSON-RPC batch cap.
Snapshot creation returns a UUID only after a successful database insert and throws an exception on failure. Add-ons must treat that exception as a failed operation. Rollback atomically changes a snapshot from committed to rolling_back before restoring data, preventing concurrent requests from restoring the same snapshot twice. Success requires the final rolled_back status update to succeed. Failed or interrupted restoration can be partial; snapshots left in rollback_failed or rolling_back require manual review before any further restoration.
License
Licensed under the GPLv2 or later. Not affiliated with Automattic or WooCommerce.
WordPress.org Developer Verification
Official WordPress.org account: kittenlabs (kittenlabs.xrm@gmail.com) — verification token: wordpressorg-kittenlabs-verification