WooAgent
by dalbello
README.md
# ๐ WooAgent
**Open-source MCP server for WooCommerce. Give AI agents direct access to your store.**
[](https://opensource.org/licenses/MIT)
[](https://www.python.org/downloads/)
[](https://modelcontextprotocol.io)
WooAgent connects AI agents to WooCommerce stores via the [Model Context Protocol (MCP)](https://modelcontextprotocol.io). Manage orders, products, customers, coupons, inventory, and view reports โ all through natural language.
---
## โก Quick Start
### 1. Install
```bash
# Clone the repository
git clone https://github.com/your-org/wooagent.git
cd wooagent
# Install with uv
uv sync
```
### 2. Configure
Create a `.env` file (or set environment variables):
```bash
cp .env.example .env
```
Edit `.env` with your WooCommerce API credentials:
```env
WOOCOMMERCE_URL=https://your-store.com
WOOCOMMERCE_KEY=ck_your_consumer_key
WOOCOMMERCE_SECRET=cs_your_consumer_secret
```
> **Getting API Keys:** In your WordPress admin, go to **WooCommerce โ Settings โ Advanced โ REST API** and create a new key with Read/Write permissions.
### 3. Run
```bash
uv run wooagent
```
The server starts in STDIO mode, ready for MCP clients to connect.
---
## ๐ฅ๏ธ Usage with Claude Desktop
Add this to your Claude Desktop configuration (`claude_desktop_config.json`):
```json
{
"mcpServers": {
"wooagent": {
"command": "uv",
"args": ["--directory", "/path/to/wooagent", "run", "wooagent"],
"env": {
"WOOCOMMERCE_URL": "https://your-store.com",
"WOOCOMMERCE_KEY": "ck_your_consumer_key",
"WOOCOMMERCE_SECRET": "cs_your_consumer_secret"
}
}
}
}
```
Then ask Claude things like:
- *"Show me all processing orders from this week"*
- *"What are the top-selling products this month?"*
- *"Update order #1234 to completed"*
- *"Create a 20% off coupon code SUMMER20"*
- *"Which products are running low on stock?"*
---
## ๐ง Usage with Other MCP Clients
WooAgent uses STDIO transport, compatible with any MCP client:
```bash
# Run directly
uv run wooagent
# Or via the module
uv run python -m wooagent.server
```
### Programmatic usage
```python
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
server = StdioServerParameters(
command="uv",
args=["--directory", "/path/to/wooagent", "run", "wooagent"],
env={
"WOOCOMMERCE_URL": "https://your-store.com",
"WOOCOMMERCE_KEY": "ck_...",
"WOOCOMMERCE_SECRET": "cs_...",
},
)
async with stdio_client(server) as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
result = await session.call_tool("list_orders", {"status": "processing"})
print(result)
```
---
## ๐ Tool Reference
### Orders
| Tool | Description |
|------|-------------|
| `list_orders` | List orders with filters (status, date range, search, customer) |
| `get_order` | Get full details of an order |
| `update_order_status` | Update order status (processing, completed, cancelled, etc.) |
| `get_order_notes` | Get all notes for an order |
| `create_order_note` | Add a private or customer-facing note to an order |
### Products
| Tool | Description |
|------|-------------|
| `list_products` | List products with filters (status, category, SKU, stock, on-sale) |
| `get_product` | Get full product details |
| `update_product` | Update product fields (price, stock, status, description, etc.) |
| `list_product_categories` | List all product categories |
| `list_product_variations` | List variations for a variable product |
### Customers
| Tool | Description |
|------|-------------|
| `list_customers` | List customers with filters (search, email, role) |
| `get_customer` | Get full customer details |
### Coupons
| Tool | Description |
|------|-------------|
| `list_coupons` | List coupons with search |
| `create_coupon` | Create a new coupon (percent, fixed cart, fixed product) |
| `delete_coupon` | Delete a coupon |
### Reports & Analytics
| Tool | Description |
|------|-------------|
| `get_sales_report` | Sales summary for a date range |
| `get_top_sellers` | Top-selling products for a date range |
| `get_order_totals` | Order counts grouped by status |
### Store
| Tool | Description |
|------|-------------|
| `get_store_info` | Store info and system status (WC/WP/PHP versions, currency, etc.) |
| `get_shipping_zones` | List all shipping zones and their methods |
### Inventory
| Tool | Description |
|------|-------------|
| `low_stock_products` | Products with stock at or below a threshold (default โค5) |
---
## โ๏ธ Environment Variables
| Variable | Required | Description |
|----------|----------|-------------|
| `WOOCOMMERCE_URL` | โ
| Your store URL (e.g., `https://mystore.com`) |
| `WOOCOMMERCE_KEY` | โ
| WooCommerce REST API consumer key |
| `WOOCOMMERCE_SECRET` | โ
| WooCommerce REST API consumer secret |
### Authentication
- **HTTPS stores** โ Basic Auth (recommended)
- **HTTP stores** โ Query parameter auth (keys sent in URL)
> โ ๏ธ Always use HTTPS in production for security.
---
## ๐งช Testing
```bash
# Install dev dependencies
uv sync --group dev
# Run tests
uv run pytest
# Run with verbose output
uv run pytest -v
```
---
## ๐ค Contributing
Contributions are welcome! Here's how:
1. **Fork** the repository
2. **Create** a feature branch (`git checkout -b feature/amazing-feature`)
3. **Commit** your changes (`git commit -m 'Add amazing feature'`)
4. **Push** to the branch (`git push origin feature/amazing-feature`)
5. **Open** a Pull Request
### Ideas for Contributions
- Additional WooCommerce endpoints (refunds, webhooks, payment gateways)
- Batch operations support
- Response caching
- More comprehensive test suite
- SSE transport support
---
## ๐ License
This project is licensed under the MIT License โ see the [LICENSE](LICENSE) file for details.
---
Built with โค๏ธ for the MCP ecosystem.
This server cannot be deployed
Maintenance
ActivityInactive
ResponsivenessNo recent community issues