Skip to main content

IDE Configuration

Complete setup guides for using the WooCommerce MCP Server with Visual Studio Code and PhpStorm.

Environment Variables Reference

Both IDEs require the same set of environment variables. Configure these in your MCP server definition:

VariableRequiredDescription
WORDPRESS_SITE_URLYesFull URL of your WordPress site (e.g., https://your-site.com)
WOOCOMMERCE_CONSUMER_KEYYesWooCommerce REST API consumer key (ck_xxx)
WOOCOMMERCE_CONSUMER_SECRETYesWooCommerce REST API consumer secret (cs_xxx)
WORDPRESS_USERNAMENoWordPress username for post/meta tools
WORDPRESS_PASSWORDNoWordPress Application Password for post/meta tools
ALLOW_SELF_SIGNED_CERTSNoSet to true for local dev with self-signed SSL

Visual Studio Code

VS Code supports MCP servers natively through its GitHub Copilot integration. The server runs in stdio mode — VS Code spawns it as a child process and communicates via stdin/stdout.

Configuration Methods

There are two ways to configure the MCP server in VS Code:

Method 1: User-Level Configuration (Global)

This makes the WooCommerce MCP server available across all your projects.

Create or edit the file at ~/.vscode/mcp.json (or use Settings → Features → Chat → MCP):

{
"servers": {
"woocommerce": {
"command": "node",
"args": ["C:/path/to/woocommerce-mcp-server/build/index.js"],
"env": {
"WORDPRESS_SITE_URL": "https://your-site.com",
"WOOCOMMERCE_CONSUMER_KEY": "ck_your_consumer_key",
"WOOCOMMERCE_CONSUMER_SECRET": "cs_your_consumer_secret",
"WORDPRESS_USERNAME": "developer",
"WORDPRESS_PASSWORD": "your-app-password",
"ALLOW_SELF_SIGNED_CERTS": "true"
}
}
}
}

Method 2: Workspace-Level Configuration (Per-Project)

This scopes the MCP server to a specific workspace. Create .vscode/mcp.json in your project root:

{
"servers": {
"woocommerce": {
"command": "node",
"args": ["C:/path/to/woocommerce-mcp-server/build/index.js"],
"env": {
"WORDPRESS_SITE_URL": "https://your-site.com",
"WOOCOMMERCE_CONSUMER_KEY": "ck_your_consumer_key",
"WOOCOMMERCE_CONSUMER_SECRET": "cs_your_consumer_secret",
"WORDPRESS_USERNAME": "developer",
"WORDPRESS_PASSWORD": "your-app-password",
"ALLOW_SELF_SIGNED_CERTS": "true"
}
}
}
}

VS Code Configuration via Settings UI

  1. Open Settings (Ctrl+Comma)
  2. Search for "MCP"
  3. Navigate to Features → Chat → MCP
  4. Click "Edit in settings.json" or "Add Server"
  5. Enter the server configuration as shown above

Verifying the Connection

  1. Open the GitHub Copilot Chat panel (Ctrl+Shift+I)
  2. Switch to Agent mode (click the mode selector at the top of the chat panel)
  3. You should see "woocommerce" listed as an available MCP server in the tools dropdown
  4. Test by asking: "List the 5 most recent WooCommerce orders"

Multiple Store Configuration

To connect to multiple WooCommerce stores, add separate server entries with unique names:

{
"servers": {
"woocommerce-production": {
"command": "node",
"args": ["C:/path/to/woocommerce-mcp-server/build/index.js"],
"env": {
"WORDPRESS_SITE_URL": "https://production-store.com",
"WOOCOMMERCE_CONSUMER_KEY": "ck_production_key",
"WOOCOMMERCE_CONSUMER_SECRET": "cs_production_secret"
}
},
"woocommerce-staging": {
"command": "node",
"args": ["C:/path/to/woocommerce-mcp-server/build/index.js"],
"env": {
"WORDPRESS_SITE_URL": "https://staging-store.com",
"WOOCOMMERCE_CONSUMER_KEY": "ck_staging_key",
"WOOCOMMERCE_CONSUMER_SECRET": "cs_staging_secret",
"ALLOW_SELF_SIGNED_CERTS": "true"
}
}
}
}

PhpStorm (JetBrains IDEs)

PhpStorm and other JetBrains IDEs (WebStorm, IntelliJ IDEA) support MCP servers through their AI Assistant integration. The server runs in stdio mode, identical to VS Code.

Configuration Methods

  1. Open Settings (Ctrl+Alt+S)
  2. Navigate to Languages & Frameworks → AI Assistant → MCP Servers
  3. Click the + button to add a new server
  4. Fill in the configuration:
    • Name: woocommerce
    • Command: node
    • Arguments: C:/path/to/woocommerce-mcp-server/build/index.js
  5. Add environment variables by clicking Environment Variables and entering each key-value pair:
    • WORDPRESS_SITE_URL = https://your-site.com
    • WOOCOMMERCE_CONSUMER_KEY = ck_your_consumer_key
    • WOOCOMMERCE_CONSUMER_SECRET = cs_your_consumer_secret
    • WORDPRESS_USERNAME = developer
    • WORDPRESS_PASSWORD = your-app-password
    • ALLOW_SELF_SIGNED_CERTS = true
  6. Click OK to save

Method 2: Project-Level Configuration File

Create .github/copilot/mcp.json in your project root:

{
"servers": {
"woocommerce": {
"command": "node",
"args": ["C:/path/to/woocommerce-mcp-server/build/index.js"],
"env": {
"WORDPRESS_SITE_URL": "https://your-site.com",
"WOOCOMMERCE_CONSUMER_KEY": "ck_your_consumer_key",
"WOOCOMMERCE_CONSUMER_SECRET": "cs_your_consumer_secret",
"WORDPRESS_USERNAME": "developer",
"WORDPRESS_PASSWORD": "your-app-password",
"ALLOW_SELF_SIGNED_CERTS": "true"
}
}
}
}

PhpStorm automatically detects this file and registers the MCP server.

Verifying the Connection

  1. Open the AI Assistant panel (Alt+Enter or via the sidebar)
  2. The WooCommerce MCP server should appear in the available tools list
  3. Test by asking: "Get the system status of the WooCommerce store"
  4. Check Settings → AI Assistant → MCP Servers — the server status should show as "Connected"

Multiple Store Configuration

Same as VS Code — add multiple entries with unique names in the servers object:

{
"servers": {
"woocommerce-production": {
"command": "node",
"args": ["C:/path/to/woocommerce-mcp-server/build/index.js"],
"env": {
"WORDPRESS_SITE_URL": "https://production-store.com",
"WOOCOMMERCE_CONSUMER_KEY": "ck_production_key",
"WOOCOMMERCE_CONSUMER_SECRET": "cs_production_secret"
}
},
"woocommerce-staging": {
"command": "node",
"args": ["C:/path/to/woocommerce-mcp-server/build/index.js"],
"env": {
"WORDPRESS_SITE_URL": "https://staging-store.com",
"WOOCOMMERCE_CONSUMER_KEY": "ck_staging_key",
"WOOCOMMERCE_CONSUMER_SECRET": "cs_staging_secret",
"ALLOW_SELF_SIGNED_CERTS": "true"
}
}
}
}

Common Configuration Tips

Path Format

Use forward slashes or escaped backslashes in file paths:

// Windows — either format works
"args": ["C:/Repos/woocommerce-mcp-server/build/index.js"]
"args": ["C:\\Repos\\woocommerce-mcp-server\\build\\index.js"]

// macOS / Linux
"args": ["/home/user/woocommerce-mcp-server/build/index.js"]

Security Best Practices

  • Never commit credentials to version control — add mcp.json to .gitignore if it contains secrets
  • Use workspace-level configuration for project-specific stores
  • Use user-level configuration for personal development stores
  • Rotate API keys periodically and revoke unused keys in WooCommerce settings
  • For shared team configurations, use environment variable references instead of hardcoded values

Updating the Server

When the MCP server code is updated:

cd /path/to/woocommerce-mcp-server
git pull
npm install
npm run build

Then restart your IDE or reload the MCP server connection. In VS Code, use the Command Palette (Ctrl+Shift+P) and search for "MCP: Restart Server".

Troubleshooting

Server Not Appearing in IDE

  • Verify the path in args points to the correct build/index.js file
  • Ensure the project has been built (npm run build)
  • Check that Node.js 20+ is available in your system PATH
  • Restart the IDE after adding the configuration

Connection Timeouts

  • Verify WORDPRESS_SITE_URL is accessible from your machine
  • For local sites, ensure the development server is running
  • Check for firewall rules blocking outbound HTTPS connections

"Unauthorized" Errors

  • Regenerate WooCommerce API keys and update the configuration
  • Verify keys have Read/Write permissions
  • For WordPress operations, ensure the Application Password is valid and the user has appropriate roles

Self-Signed Certificate Errors

  • Set ALLOW_SELF_SIGNED_CERTS to true in your environment variables
  • This is required for Laravel Herd, Valet, Local by Flywheel, and similar local development tools

Next Steps

  • Architecture — Understand the server internals and security model
  • Tools Reference — Browse all 159+ available MCP tools by category