# Shopify Integration Using MCP Server

This tutorial explains how to connect a Shopify store to a Tiledesk AI Agent using Shopify Storefront MCP.

With this setup, your AI Agent can access storefront tools to support ecommerce conversations. It can help users search products, receive product recommendations, add selected items to the cart and continue to checkout.

<figure><img src="https://1328774413-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVguk6y5OMn3pAaHZSiwU%2Fuploads%2FDONiyC6JRPLtOsI8SJNs%2FGuide%20Articles%20(54).png?alt=media&#x26;token=5f6b56f5-0ec4-4870-9d1d-36fef17fe448" alt=""><figcaption></figcaption></figure>

### What this workflow does

At the end of this guide, you will have a Tiledesk AI Agent connected to your Shopify store through MCP.

The AI Agent can help customers:

* search your Shopify catalog in natural language
* receive product suggestions based on their needs
* compare a small set of relevant products
* add a selected product to the cart
* receive a checkout link to complete the purchase

### Start faster with the Shopify AI Sales Advisor template

We also published a ready-to-use [Shopify AI Sales Advisor template](https://tiledesk.com/community/getchatbotinfo/chatbotId/69f1e3a6e1170e001425c928-Shopify-AI-Sales-Advisor) in the Tiledesk Community.

If you use the template, the **flow** and **prompt** are already prepared. You only need to get your Shopify MCP server URL in Step 1 and add your store domain to the template configuration.

### **Step‑by‑step guide to building your Shopify AI agent**

{% stepper %}
{% step %}

#### Get your Shopify MCP server URL

Shopify exposes a native MCP server for storefront actions. Your MCP server URL is your Shopify store domain plus `/api/mcp`.

#### Example with a custom domain

If your store uses a custom domain like:

```
https://brandname.com
```

Your MCP server URL is:

```
https://brandname.com/api/mcp
```

#### Example with a Shopify domain

If your store is:

```
https://yourstore.myshopify.com
```

Your MCP server URL is:

```
https://yourstore.myshopify.com/api/mcp
```

{% endstep %}

{% step %}

#### Open your Tiledesk AI Agent

Go to your Tiledesk project and open Design Studio.

You can now choose one of two options:

* **Use the** [**Shopify AI Sales Advisor template**](https://tiledesk.com/community/getchatbotinfo/chatbotId/69f1e3a6e1170e001425c928-Shopify-AI-Sales-Advisor) if you want to start from a ready flow.
* **Create a new AI Agent from scratch** if you want to build and customize the workflow manually.

If you use the template, you can skip the manual prompt setup and move directly to the MCP configuration inside the template.

If you create the AI Agent from scratch, continue with the next step.
{% endstep %}

{% step %}

#### Add the AI Prompt action

Open the block where the AI Agent should respond to open user questions and add an [ai-prompt-multi-llm](https://guide.tiledesk.com/ai-chatbots-and-automation/actions-explained/ai-prompt-multi-llm "mention")action in it.&#x20;

In many flows, this is the **defaultFallback** block.

<figure><img src="https://1328774413-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVguk6y5OMn3pAaHZSiwU%2Fuploads%2FKha7G9bcnXn1EXP1RKgS%2FGuide%20Articles%20(13).gif?alt=media&#x26;token=f1f5a42c-28c9-4b1d-8b19-3205a17c54d0" alt=""><figcaption></figcaption></figure>

1. Click on the block.
2. Wait for the right-side configuration panel to open.
3. Paste the prompt below in the prompt field.

#### Prompt example for a Shopify AI Sales Advisor

{% code overflow="wrap" %}

```
You are an ecommerce AI sales advisor. 
Your goal is to help the user find and purchase the right product from the store. 
Follow this flow: 

1. Read the catalog and product categories to provide personalized and relevant recommendations. 

2. Ask the user for useful details such as budget, reason for purchase, preferences, or specific needs based on the available products in the store. Do not ask for information the user has already shared in the conversation. 

3. Recommend 2 to 3 suitable products with: - product name - price, if available - a few key details in bullet points - product image, when available and supported by the channel - no duplicated products in the same recommendation set 

4. Do not share the product image URL as plain text. Show the image directly when the channel supports image rendering. 

5. Ask the user to choose one product to add to the cart, or offer to show more options. 

6. When the user chooses a product, add it to the cart and share the checkout payment link. 

Last user text: {{lastUserText}} 
Full conversation: {{transcript}}
```

{% endcode %}

**Prompt note:** this prompt is only a starting point. You can adapt it to your business needs, product categories, tone of voice, shipping rules, return rules, or sales policies.
{% endstep %}

{% step %}

#### Add Shopify MCP as a tool

Inside the AI Prompt configuration, connect your Shopify MCP server as a tool.

<figure><img src="https://1328774413-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVguk6y5OMn3pAaHZSiwU%2Fuploads%2Fi0H324dEwgXemzdzWJTI%2FGuide%20Articles%20(14).gif?alt=media&#x26;token=3c439487-9815-4124-a31f-715d5b28152a" alt=""><figcaption></figcaption></figure>

1. Click **Select MCP tools**.
2. Click **Add MCP server tool**.
3. Paste your Shopify MCP server URL in the URL field.
4. Give the MCP server a clear name, for example **Shopify Storefront MCP**.
5. Click **Connect**.

After the connection is created, a blue button labeled **Select tools** should appear.

<figure><img src="https://1328774413-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVguk6y5OMn3pAaHZSiwU%2Fuploads%2FZJbkkr7R1l1cgLfF4JEf%2FGuide%20Articles%20(55).png?alt=media&#x26;token=6711ec22-95b9-42a7-a12d-3a00fc0f96dc" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Select the Shopify tools

Click **Select tools** and enable the available Shopify MCP tools.

Toggle on the tools you want the AI Agent to use, then click **Close**.

<figure><img src="https://1328774413-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVguk6y5OMn3pAaHZSiwU%2Fuploads%2FWyrXmYV0YF1BMgguLSQt%2FGuide%20Articles%20(56).png?alt=media&#x26;token=acc60102-0115-411f-bdcf-47e594576fd4" alt=""><figcaption></figcaption></figure>

Please ensure that the MCP server is included in the list of available tools.

<figure><img src="https://1328774413-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVguk6y5OMn3pAaHZSiwU%2Fuploads%2FsWg5THmRgjnbJame36RZ%2FGuide%20Articles%20(57).png?alt=media&#x26;token=1180f7f9-c5b5-4f27-b2d6-1c8755404ec9" alt=""><figcaption></figcaption></figure>

Also, add a new [reply-action](https://guide.tiledesk.com/ai-chatbots-and-automation/actions-explained/reply-action "mention") with an `ai-reply` attribute in it.
{% endstep %}
{% endstepper %}

### Test the AI Agent

You can test the flow directly inside **Tiledesk Design Studio** before publishing it.

Open the preview and ask questions based on the products available in your Shopify store. For example:

* I am looking for a gift under 50 euros
* Can you recommend a product for a new parent?
* Show me your best products for summer
* Add the second product to my cart

<figure><img src="https://1328774413-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVguk6y5OMn3pAaHZSiwU%2Fuploads%2F1QXJTFWutzIBuKzJZQa5%2FShopify%20tutorial%20video.gif?alt=media&#x26;token=c4e649ae-caf6-415b-99c6-e7b08fb8a913" alt=""><figcaption></figcaption></figure>

During the test, check that the AI Agent can read the available store information, recommend relevant products and guide the user toward checkout.

If you want to change the behavior, update the prompt in the AI Prompt action and test again.

This AI Agent does not only answer questions. It can guide customers through product discovery, product selection, cart updates and checkout.

You can contact us at <support@tiledesk.com> or visit [www.tiledesk.com](https://www.tiledesk.com/) to learn more about Tiledesk AI Agents.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guide.tiledesk.com/other-integrations/shopify-integration-using-mcp-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
