MCP WooCommerce Server
Enables interaction with WooCommerce stores through the REST API. Supports product search, order management, and e-commerce operations through natural language commands.
README
MCP WooCommerce Server
A Model Context Protocol (MCP) server that provides tools to interact with WooCommerce REST API.
Features
- Search Products: Search for products by name or SKU
- List Products: Retrieve all products with pagination
- Create Orders: Create new orders with line items
- Get Orders: Retrieve specific orders by ID
- List Orders: List orders with optional filters
- 🔐 Authentication: API Key-based authentication for secure access
Setup
-
Clone this repository
-
Copy
.env.exampleto.envand fill in your WooCommerce API credentials:WOO_URL=https://yourstore.com WOO_CONSUMER_KEY=your_consumer_key WOO_CONSUMER_SECRET=your_consumer_secret MCP_API_KEY=your_secure_api_key_here -
Get your WooCommerce API credentials:
- Go to WooCommerce > Settings > Advanced > REST API
- Create a new key with read/write permissions
- Copy the Consumer Key and Consumer Secret
-
Generate a secure API key for MCP authentication:
# Generate a random API key (Linux/Mac) openssl rand -hex 32 # Or use Python python -c "import secrets; print(secrets.token_hex(32))"
Security
Authentication
The server implements API Key authentication to protect against unauthorized access. When MCP_API_KEY is configured, all requests must include the API key in the Authorization header.
Without Authentication (Development Only)
If MCP_API_KEY is not set, the server runs without authentication for development purposes.
With Authentication (Production Recommended)
When MCP_API_KEY is set, clients must include:
Authorization: Bearer YOUR_API_KEY_HERE
Security Best Practices
- Always set
MCP_API_KEYin production environments - Use strong, randomly generated API keys (32+ characters)
- Rotate API keys regularly
- Use HTTPS in production
- Limit network access to trusted sources only
- Monitor access logs for suspicious activity
Running Locally
With Docker Compose
docker-compose up --build
The server will start on http://localhost:8200/mcp with modular architecture.
With Python
pip install -r requirements.txt
python -m src.server
Architecture
The project uses a modular architecture with the following structure:
src/server.py- FastAPI application with MCP integration and authenticationsrc/tools.py- MCP tools implementation (5 tools for WooCommerce operations)src/config.py- Environment configuration and validationsrc/woo_client.py- WooCommerce API client wrappersrc/models.py- Pydantic models for structured datatest/client_authenticated.py- Full-featured authenticated MCP client (recommended)test/client_example.py- Basic MCP client using official libraries (limited auth support)test/list_tools.py- Simple tool listing script
Client Compatibility Matrix
| Component | With API Key (Production) | Without API Key (Development) | Notes |
|---|---|---|---|
test/client_authenticated.py |
✅ Fully Supported | ❌ Requires API key | Recommended client with full auth support |
Curl Scripts (test/*.sh) |
✅ Fully Supported | ❌ Requires API key | Manual testing with proper auth headers |
test/test_auth.sh |
✅ Fully Supported | ❌ Requires API key | Authentication validation script |
test/list_tools.py |
❌ Limited support¹ | ✅ Works | Uses official MCP libraries |
test/client_example.py |
❌ Limited support¹ | ✅ Works | Uses official MCP libraries |
¹ Limited support: May fail with authentication errors when API key is required
API Endpoints
The server exposes the following MCP tools:
search_products(query: str, per_page: int = 10)- Search productslist_products(per_page: int = 20, page: int = 1)- List all productscreate_order(customer_id: int, line_items: List[Dict], billing: Dict, shipping: Optional[Dict])- Create orderget_order(order_id: int)- Get specific orderlist_orders(customer_id: Optional[int], status: Optional[str], per_page: int = 10)- List orders
WooCommerce API Requirements
- WooCommerce 3.5+
- WordPress 4.4+
- Pretty permalinks enabled
- REST API enabled (default)
Testing the MCP Server
Using the Example Clients
The project includes example MCP clients to test the server:
Authenticated Client (Recommended)
python test/client_authenticated.py
This is the recommended client for testing. It provides:
- ✅ Full API key authentication support
- ✅ Proper SSE response parsing
- ✅ Complete tool testing (list_products, search_products, etc.)
- ✅ Detailed output with product information
- ✅ Error handling and session management
Simple Tool Lister
python test/list_tools.py
This script connects to the MCP server and lists all available tools with their descriptions and parameters.
Basic Example Client (Limited)
python test/client_example.py
This client uses official MCP libraries but has limitations:
- ❌ Limited authentication support (may fail with API key auth)
- ❌ May encounter connection errors with authenticated servers
- ✅ Good for understanding MCP protocol structure
Testing Scripts
The project includes curl scripts for easy testing:
# Update the AUTH_HEADER in the scripts with your API key
# Then run:
./test/curl_list_products.sh
./test/curl_search_products.sh pulseras
./test/curl_create_order.sh
These scripts demonstrate proper authentication and SSE response handling.
Authentication Testing
# Run authentication tests
./test/test_auth.sh
This script validates that authentication is working correctly by testing different scenarios.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.