# PrestaShop MCP

> PrestaShop MCP Server gives your AI agent direct access to your live e-commerce database. It lets you run complex queries—like checking inventory levels, pulling specific order line items, or finding a customer's full address history—all through natural conversation. No need to log into the back office or parse XML files manually.

## Overview
- **Category:** ecommerce
- **Price:** Free
- **Tags:** online-store, product-catalog, order-fulfillment, inventory-tracking, web-services, retail-operations

## Description

Your AI agent connects straight to your PrestaShop e-commerce database. You don't gotta log into the back office or parse XML files manually; your agent just talks to the system and gets you the data you need.

**Tracking Orders:** When you use `list_orders`, your agent pulls a list of recent sales, giving you references, total amounts, and the current fulfillment status for every order. If you need deep details on one specific sale, calling `get_order` lets your agent grab that single record by ID. You'll get everything: all the line items purchased, who paid, and what the billing details were.

**Managing Stock:** To check inventory, you use `list_stock`, which reports available quantities across multiple complicated products based on how they're structured in your catalog. For a single resource ID, calling `get_stock` gives you the exact current count of units ready to ship. This tells you precisely what's sitting on the shelf right now.

**Product Metadata:** You can pull full data on any product using `get_product`. That tool returns all the pricing info, descriptions, and every category link associated with a single product ID. If you need a complete list of everything sold, running `list_products` gives your agent access to the entire catalog's details.

**Customer Records:** When you query basic customer info using `list_customers`, your agent grabs names and email addresses for quick account lookups. For shipping purposes or resolving disputes, calling `list_addresses` pulls all physical locations tied to customers or specific orders, letting you map out where things gotta go.

**Catalog Mapping:** Your AI client can see the whole structure of your store by running `list_categories`, which gives a complete rundown of every main and child product category. If you need to know what payment methods are accepted, `list_currencies` provides a list of all active currencies configured in your checkout system.

**The Mechanics:** The agent doesn't just read data; it runs complex queries that handle the API calls for you. A support rep can ask why an order is stuck, and the agent instantly pulls the payment status from `get_order`, checks the inventory count via `get_stock`, and confirms the customer's shipping address using `list_addresses`. You get real-time access to every piece of structured data—from product descriptions (`get_product`) to listing all available products (`list_products`). It's direct, fast, and keeps you out of the administrative mess.

## Tools

### get_order
Gets a single order by ID, returning its line items, billing details, and payment status.

### get_product
Retrieves all pricing, descriptions, and category links for one specific product ID.

### get_stock
Checks the exact available stock count for a given resource ID.

### list_addresses
Lists physical customer or order addresses to map delivery destinations.

### list_categories
Provides a list of all main and child product categories used on the store site.

### list_currencies
Lists every active currency accepted by the store checkout system.

### list_customers
Gets basic customer info like names and email addresses for account lookup.

### list_orders
Lists recent orders, showing references, current fulfillment status, and total amounts.

### list_products
Provides a list of all products in the catalog, including full details for every item.

### list_stock
Lists available stock quantities across multiple complex items based on product structure.

## Prompt Examples

**Prompt:** 
```
List the last 5 orders placed on the store. Are there any pending ones?
```

**Response:** 
```
Querying `list_orders` with limit `0,5`. I found 5 recent purchases. Orders 101 through 104 are marked 'Shipped'. However, Order 105 (Total 145 USD) is currently held under 'Awaiting Bank Wire Payment'.
```

**Prompt:** 
```
Get the product details linked to ID 42. Tell me its exact category bindings.
```

**Response:** 
```
I extracted `get_product` for ID 42 ('Wireless Headphones v2'). Inside its nested `associations>categories` array, it is bound to Category ID 3 ('Electronics') as well as the default Home category (ID 2). Its base price is set at 99.99.
```

**Prompt:** 
```
Check our current stock level constraints available at Stock ID '15'.
```

**Response:** 
```
Via `get_stock` targeting ID 15, the structural array dictates that there are exactly `7` physical units physically authorized for checkout operations, tied implicitly to Product ID `42`.
```

## Capabilities

### Track Live Orders
Fetch specific order records by ID or list recent orders to see their fulfillment status and total value.

### Manage Stock Levels
Determine the exact, constrained number of units available for sale using a specific product or resource ID.

### Detail Product Metadata
Retrieve full data on any single product, including its base pricing and all associated categories.

### List Customer Profiles
Query basic customer information (name, email) and their recorded physical addresses for shipping purposes.

### Map Store Catalog Structure
Retrieve lists of all active product categories or available currencies configured in the store.

## Use Cases

### Handling an Out-of-Stock Inquiry
A customer asks about 'Widget X.' Instead of telling the customer to call back, your agent runs `get_product` first. Then it uses `get_stock` on that product ID and replies with a precise count: 'We only have 7 units left in stock right now.' The problem is solved in seconds.

### Processing a Complex Dispute
A customer disputes an order. Your agent runs `get_order` to get the full item list, then uses `list_customers` and `list_addresses` to verify who placed it and where they live. This gives support staff all necessary data without manual cross-referencing.

### Building a New Product Page
A developer needs to build a headless front end for 50 products. Instead of pulling 50 individual APIs, they use `list_products` and get all the necessary data—pricing, description, and category bindings—in one structured response.

### Checking Fulfillment Status
The manager needs to know which orders are ready to ship. They run `list_orders` and immediately filter by 'Pending Shipment' status, seeing the order reference and total right away.

## Benefits

- You don't have to manually export CSVs. When you call `list_orders`, the agent pulls structured sales history directly into your chat window.
- Inventory checks are instant. Instead of guessing, use `get_stock` or `list_stock` to verify exact unit counts before confirming a sale.
- No more clicking through tabs. With `get_product`, you get all pricing and category associations for an item in one API call.
- Support agents stop wasting time on the admin panel. Using `list_addresses` lets them validate shipping data instantly during a conversation.
- You can map out your entire catalog structure just by running `list_categories`, giving you a full view of product groupings at once.

## How It Works

The bottom line is you get structured e-commerce data streams without ever seeing a raw XML response.

1. First, subscribe to this MCP server and provide your PrestaShop URL along with your Webservice Key.
2. Next, map the tool calls (like `list_orders` or `get_stock`) into your preferred client (Claude, Cursor, etc.).
3. The agent then executes the sequence of API calls and returns clean data arrays directly to your conversation.

## Frequently Asked Questions

**How do I check if an order is fulfilled using the list_orders tool?**
The `list_orders` tool provides a current fulfillment status field. You can query recent orders and filter for statuses like 'Shipped' or 'Awaiting Payment' to track where they are in the process.

**What is the difference between list_products and get_product?**
`list_products` gives you an array of many products, showing a catalog overview. `get_product` lets you focus on one specific ID, giving all its unique details like pricing and category bindings.

**Can I use list_stock to check multiple SKUs?**
Yes, the `list_stock` tool is designed for this. It accepts complex item structures, allowing you to map available units across several products simultaneously.

**How does get_order handle address data?**
`get_order` pulls the core transaction data. If you need a deeper look at the customer's stored address history, use `list_addresses` separately for better results.

**What credentials do I need to connect my agent using tools like `list_customers`?**
You must provide your PrestaShop URL and a Webservice Key. These are the two required connection parameters for the MCP server. The key authenticates your requests, so keep it secure.

**How does `get_product` handle complex data fields like nested category associations?**
The tool parses raw Webservice XML nodes into consumable arrays automatically. It surfaces nested data—like multiple category IDs—into a structured format your agent can read directly.

**Are there rate limits when running bulk checks using `list_orders`?**
The server handles request throttling to protect the store's API. If you hit sustained high volume, your AI client will receive a standard rate limit error code.

**Does `list_currencies` provide details on specific sales tax rates or promotions?**
No, this tool only lists the active currencies configured in the store. For tax rates or promotional pricing logic, you'll need to inspect order line items via `get_order`.

**Can the AI handle PrestaShop's complex XML responses?**
Yes. While PrestaShop's Core API sends XML trees, the AI parses nodes extracting items, IDs, and pricing fluidly, eliminating the need for you to read tag-heavy formats manually.

**Is there a way to limit the amount of products or orders I query?**
Absolutely. Functions like `list_products` and `list_orders` accept a `limit` parameter string in bounds format (like `0,20`). Just ask the AI to 'show me the first 5 orders'.

**Can it inspect how many physical items are in stock?**
Yes. Under the hood, PrestaShop splits stock models. Using `list_stock` and `get_stock`, the AI retrieves the exact array nodes managing physical stock overriding quantities.