Installation
Prerequisites, building from source, and running the WooCommerce MCP Server in stdio or HTTP mode.
Prerequisites
Before installing the WooCommerce MCP Server, ensure you have the following:
| Requirement | Details |
|---|---|
| Node.js | Version 20.0 or higher (download) |
| npm | Included with Node.js |
| WordPress Site | Running WordPress 5.0+ with WooCommerce 7.0+ |
| WooCommerce REST API Keys | Consumer Key and Consumer Secret with Read/Write permissions |
| Git | For cloning the repository |
Generating WooCommerce API Keys
The WOOCOMMERCE_CONSUMER_KEY and WOOCOMMERCE_CONSUMER_SECRET are generated from within the WooCommerce admin panel. These credentials authenticate the MCP server against the WooCommerce REST API.
- Log into your WordPress admin dashboard
- Navigate to WooCommerce → Settings → Advanced → REST API
- Click Add key
- Set the User to developer (our standard service account for API integrations)
- Set the Description (e.g., "MCP Server — VS Code" or "MCP Server — PhpStorm")
- Set Permissions to Read/Write
- Click Generate API key
- Immediately copy both values — they are only displayed once:
- Consumer Key — starts with
ck_(this is yourWOOCOMMERCE_CONSUMER_KEY) - Consumer Secret — starts with
cs_(this is yourWOOCOMMERCE_CONSUMER_SECRET)
- Consumer Key — starts with
The Consumer Secret is only shown once at generation time. If you lose it, you must revoke the key and generate a new one.
Important notes:
- Always generate keys under the developer user account — never use a personal admin account
- Each developer or integration should have its own key pair for auditability
- Keys can be revoked at any time from the same REST API settings page without affecting other integrations
Generating a WordPress Application Password (Optional)
Required only if you plan to use WordPress content tools (create_post, get_posts, update_post, post metadata operations):
- Navigate to Users → Edit the developer user account
- Scroll to the Application Passwords section
- Enter a name (e.g., "MCP Server") and click Add New Application Password
- Copy the generated password immediately — it is shown only once
- The
WORDPRESS_USERNAMEis alwaysdeveloper
Installation Steps
1. Clone the Repository
git clone https://github.com/Rhino-Group/woocommerce-mcp-server.git
cd woocommerce-mcp-server
2. Install Dependencies
npm install
3. Build the TypeScript Source
npm run build
This compiles TypeScript from src/ into JavaScript in the build/ directory.
4. Verify the Build
node build/index.js --help
If no errors appear, the build is successful. The server will wait for MCP protocol messages on stdin.
Environment Variables
The server is configured entirely through environment variables. These can be set in your shell, in your IDE's MCP configuration, or in a .env file for HTTP mode.
| Variable | Required | Description |
|---|---|---|
WORDPRESS_SITE_URL | Yes | Full URL of your WordPress site (e.g., https://your-site.com) |
WOOCOMMERCE_CONSUMER_KEY | Yes | WooCommerce REST API consumer key (ck_xxx) |
WOOCOMMERCE_CONSUMER_SECRET | Yes | WooCommerce REST API consumer secret (cs_xxx) |
WORDPRESS_USERNAME | No | WordPress username for post/meta operations |
WORDPRESS_PASSWORD | No | WordPress Application Password for post/meta operations |
MCP_API_KEY | No | API key for authenticating HTTP admin endpoint requests |
ALLOW_SELF_SIGNED_CERTS | No | Set to true for local development with self-signed SSL certificates |
PORT | No | HTTP server port (default: 3000) |
Running the Server
Stdio Mode (Recommended for IDE Use)
In stdio mode, the MCP client (VS Code or PhpStorm) spawns the server as a child process and communicates via stdin/stdout. You do not run this manually — your IDE handles it automatically based on your MCP configuration.
To test manually:
WORDPRESS_SITE_URL="https://your-site.com" \
WOOCOMMERCE_CONSUMER_KEY="ck_xxx" \
WOOCOMMERCE_CONSUMER_SECRET="cs_xxx" \
node build/index.js
The server will start and wait for JSON-RPC messages on stdin.
HTTP Mode (Remote Access)
For remote access or Docker deployments, the HTTP transport exposes REST endpoints:
WORDPRESS_SITE_URL="https://your-site.com" \
WOOCOMMERCE_CONSUMER_KEY="ck_xxx" \
WOOCOMMERCE_CONSUMER_SECRET="cs_xxx" \
MCP_API_KEY="your-secret-key" \
node build/http.js
The server starts on port 3000 (or the port specified by PORT) with three endpoints:
| Endpoint | Method | Auth | Description |
|---|---|---|---|
/health | GET | None | Health check ({"status": "ok", "timestamp": "..."}) |
/mcp | POST | None | Public endpoint — 4 sanitized read-only product tools |
/mcp/admin | POST | Bearer token | Admin endpoint — all 159+ tools with full data access |
Testing the HTTP Server
# Health check
curl http://localhost:3000/health
# List available public tools
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
# List admin tools (requires API key)
curl -X POST http://localhost:3000/mcp/admin \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-secret-key" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
Self-Signed Certificate Support
For local development environments using tools like Laravel Herd, Valet, Local by Flywheel, or MAMP that generate self-signed SSL certificates:
ALLOW_SELF_SIGNED_CERTS=true
This disables Node.js TLS certificate verification for outbound requests to your WordPress site. Never enable this in production.
Troubleshooting
Build Fails
- Ensure Node.js 20+ is installed:
node --version - Delete
node_modulesand reinstall:rm -rf node_modules && npm install - Clear the build directory:
rm -rf build && npm run build
Connection Refused
- Verify
WORDPRESS_SITE_URLis correct and accessible from your machine - Check that WooCommerce REST API is enabled (WooCommerce → Settings → Advanced → REST API)
- For HTTPS sites with self-signed certs, set
ALLOW_SELF_SIGNED_CERTS=true
Authentication Errors
- Verify your Consumer Key and Secret are correct (regenerate if needed)
- Ensure API keys have Read/Write permissions
- For WordPress post operations, verify the Application Password is active
Next Steps
- IDE Configuration — Configure VS Code or PhpStorm to use the MCP server
- Architecture — Understand the server's code structure and security model
- Tools Reference — Browse all 159+ available tools