# Clind MCP Server
Customer-facing AI agent for Shopify store operations using the Model Context Protocol (MCP).
## Features
- **Order Tracking**: Track orders by order number + email
- **Product Search**: Search products, get recommendations, best sellers
- **Cart & Checkout**: Add to cart, create checkout links
- **Shipping**: Check shipping by zipcode, get delivery estimates
## Setup
1. Install dependencies:
```bash
npm install
```
2. Configure environment variables:
```bash
cp .env.example .env
```
Edit `.env`:
```
SHOPIFY_STORE_URL=your-store.myshopify.com
SHOPIFY_ACCESS_TOKEN=shpca_xxxxx
PORT=3000
```
3. Start the server:
```bash
npm start
```
## Available Tools (11 total)
### Order Tracking
| Tool | Description |
|------|-------------|
| `track_order` | Track order by order number + email |
| `get_order_status` | Get simple status message with tracking |
### Product Discovery
| Tool | Description |
|------|-------------|
| `search_products` | Search by name, type, or tags |
| `get_product_details` | Get detailed product info |
| `get_recommendations` | Get product recommendations |
| `get_best_sellers` | Get top selling products |
| `get_collections` | Get product collections |
### Cart & Checkout
| Tool | Description |
|------|-------------|
| `add_to_cart` | Generate add-to-cart link |
| `create_checkout_link` | Create direct checkout link |
### Shipping
| Tool | Description |
|------|-------------|
| `check_shipping` | Check shipping by zipcode |
| `get_shipping_zones` | Get available shipping zones |
## API Usage
### MCP Protocol (JSON-RPC 2.0)
```bash
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "search_products",
"arguments": { "query": "mug" }
}
}'
```
### REST API
```bash
curl -X POST http://localhost:3000/call \
-H "Content-Type: application/json" \
-d '{
"tool": "search_products",
"arguments": { "query": "mug" }
}'
```
## Example Responses
### Search Products
```json
{
"products": [
{
"id": "123",
"title": "Paint-a-Mug Kit",
"price": "49.00",
"url": "https://store.com/products/paint-a-mug"
}
],
"count": 1
}
```
### Track Order
```json
{
"success": true,
"order": {
"order_number": "1001",
"fulfillment_status": "fulfilled",
"tracking": [
{
"tracking_number": "1Z999...",
"tracking_url": "https://..."
}
]
}
}
```
### Check Shipping
```json
{
"zipcode": "90210",
"shipping_zone": "West Coast",
"estimated_delivery": "3-5 business days",
"shipping_options": [
{ "name": "Standard", "estimate": "3-5 days" },
{ "name": "Express", "estimate": "1-2 days" }
]
}
```
## Deployment
Deploy to Railway:
```bash
railway up
```
Set environment variables in Railway dashboard.