# Commerce Layer MCP for AI Agents MCP

> Commerce Layer lets your AI agent manage everything related to e-commerce operations. Use it to find specific customer details, check product stock by SKU, retrieve complete order histories, and track shipments across multiple markets.

## Overview
- **Category:** ecommerce
- **Price:** Free
- **Tags:** headless-commerce, api-first, inventory-management, multi-market, order-processing, sku-management

## Description

This MCP connects your AI client directly to the Commerce Layer API, giving your agent immediate access to all your commerce data. Instead of logging into a dashboard or running complex queries, you just ask your agent what you need—and it does it. You can quickly list recent orders and filter them by status, grab full details on any specific line item, or look up inventory levels for a product using its SKU code. Need to find a customer? Your agent can search records by email and even compile their total order history. Because Vinkius hosts this entire catalog, you connect your AI once from Claude, Cursor, or Windsurf and get all these capabilities instantly available.

## Tools

### get_order
Retrieve details of a specific order

### get_order_stats
Calculate basic stats for a set of orders

### get_sku
Retrieve details of a specific SKU

### list_customers
Retrieve a list of customers

### list_orders
Retrieve a list of orders from Commerce Layer

### list_prices
Retrieve a list of product prices

### list_skus
Retrieve a list of SKUs (products)

### list_shipments
Retrieve a list of shipments

### search_orders_by_email
Find orders belonging to a specific customer email

## Prompt Examples

**Prompt:** 
```
What were the total sales and how many orders we processed last month?
```

**Response:** 
```
**Order Metrics for Last Month:**

*   **Total Orders Count:** 1,245
*   **Gross Revenue:** $389,500.00
*   **Average Order Value (AOV):** $313.70

(These stats were calculated using data from your recent orders.)
```

**Prompt:** 
```
Check the inventory for SKU TSHIRT-BLUE-L and see if we have enough to fulfill 50 units.
```

**Response:** 
```
**SKU Details: TSHIRT-BLUE-L**

*   Name: Blue T-Shirt (Large)
*   Price: $29.99
*   Stock Available: 142 units
*   Weight: 200g

Yes, you have enough stock to fulfill 50 units right now.
```

**Prompt:** 
```
Find all orders for the email john.smith@example.com and tell me their total value.
```

**Response:** 
```
I found 3 recent orders for John Smith:

1.  #ORD-4521: $89.99 (Fulfilled)
2.  #ORD-4520: $142.50 (Pending)
3.  #ORD-4519: $35.00 (Cancelled)

The total value of these three orders is **$267.49**.
```

## Capabilities

### Get specific order details
Retrieve complete financial and line-item information for a single order.

### Search orders by customer email
Locate and view all historical orders associated with a specific customer's email address.

### Check product inventory status
Get current pricing, stock counts, and metadata for any given SKU code.

### View customer records and history
Access a list of customers or find specific individuals to see their total order count and associated addresses.

### Track shipments and analyze metrics
Retrieve lists of recent shipments, or calculate basic performance statistics across a group of orders.

## Use Cases

### A customer calls asking about their missing package.
The support rep asks the agent to use search_orders_by_email with the caller's email. The agent instantly finds all related orders and pulls shipment details, allowing the rep to give a precise update without transferring calls.

### An e-commerce manager needs to know if they can sell an old product.
The manager asks the agent for the SKU status. The agent runs get_sku using the product code and reports back on current pricing, stock availability, and metadata in seconds.

### A developer needs to debug why a specific order failed payment.
The developer asks the agent to run get_order on the problematic ID. The agent returns the full order details, including line items and payment info, allowing for rapid debugging in chat.

### A marketing team wants a quarterly sales summary report.
Instead of exporting data and running Pivot Tables, they ask the agent to get_order_stats across all orders from Q3. The resulting stats are delivered directly for immediate review.

## Benefits

- Resolve customer inquiries faster by letting your agent run the search_orders_by_email tool. Instead of asking a user for an order ID, they just give their email address.
- Check product availability instantly. Use get_sku to pull pricing and inventory levels on demand, eliminating manual navigation through product dashboards.
- Gain immediate oversight into sales metrics by running get_order_stats across multiple recent orders. You get the summary without having to calculate it yourself.
- Keep track of physical goods with list_shipments. Your agent pulls all tracking information and shipment details in one go, perfect for support teams.
- Streamline customer research using list_customers or list_orders. These tools let your agent build a profile on any user right from the chat window.

## How It Works

The bottom line is, you get real-time access to complex backend e-commerce data without ever leaving your messaging interface.

1. Connect the Commerce Layer MCP to your AI client by providing your organization's subdomain, Client ID, and Client Secret.
2. Your agent uses natural language to determine what data you need—whether it's a list of all SKUs or a specific order number.
3. The MCP executes the required API call and returns structured commerce data directly into your chat window for immediate action.

## Frequently Asked Questions

**How does the Commerce Layer MCP help me with customer lookups?**
It allows your agent to find customers by email or retrieve their entire order history, so you don't have to manually search multiple records. This speeds up support calls and gives a full view of their purchasing life cycle.

**Can I use the Commerce Layer MCP to check product stock levels?**
Yes, it lets you query any specific SKU code to get real-time details on pricing, current inventory counts, and overall product metadata. It’s great for quickly confirming availability before promising a date.

**Does the Commerce Layer MCP help me manage my shipments?**
Absolutely. You can ask your agent to pull all recent shipment records. This means you get tracking numbers and delivery status updates in one place, without needing the shipping portal.

**How does this MCP handle bulk order analysis?**
Instead of downloading massive CSV files for reporting, your agent can calculate basic statistics across a set of orders. You just ask for 'total sales' or 'average item count,' and the result appears instantly.

**What kind of data does the Commerce Layer MCP give me access to?**
It provides full e-commerce data: order details, customer contact info, product SKUs, pricing lists, and shipment records. Everything needed to run an operation from chat.