<!-- Generated by vite-plugin-geo; source: storefront-mcp/index.html -->

[Skip to content](#main-content)

[![](/sline-logo.png)Sline](/)

Sline

[Sline overview](/)[Theme Sections](/section/)[AST Explorer](/sline-ast-explorer/)

Guides

[Sline language guide](/sline-template/)[Syntax comparison](/sline-vs-handlebars-vs-liquid/)[Migration cookbook](/liquid-handlebars-sline/)[Dawn vs Bottle](/Shopify-Dawn-vs-Shopline-Bottle/)[OS 3.0 migration](/shopline-transformation/)[Theme CLI](/sline-theme-cli/)

MCP

[SHOPLINE Dev MCP](/mcp/)[Storefront MCP](/storefront-mcp/)[Shopline MCP](/shopline-mcp/)

Tools

[SkuSync](/skusync/)[SHOPLINE to Shopify](/convert-shopline-csv-to-shopify-format/)[Shopify to SHOPLINE](/convert-shopify-csv-to-shopline-xlsx/)[AI Readiness Checker](/ai-checker/)[SkuSync Docs](/docs/)[Shopline Checker](/shopline-checker/)[Shopline Helper](/shopline-helper/)[ImgSEO](/imgseo/)[ImgSEO Guide](/imgseo-doc/)

Menu

## Sline

[Sline overview](/)[Theme Sections](/section/)[AST Explorer](/sline-ast-explorer/)

## Guides

[Sline language guide](/sline-template/)[Syntax comparison](/sline-vs-handlebars-vs-liquid/)[Migration cookbook](/liquid-handlebars-sline/)[Dawn vs Bottle](/Shopify-Dawn-vs-Shopline-Bottle/)[OS 3.0 migration](/shopline-transformation/)[Theme CLI](/sline-theme-cli/)

## MCP

[SHOPLINE Dev MCP](/mcp/)[Storefront MCP](/storefront-mcp/)[Shopline MCP](/shopline-mcp/)

## Tools

[SkuSync](/skusync/)[SHOPLINE to Shopify](/convert-shopline-csv-to-shopify-format/)[Shopify to SHOPLINE](/convert-shopify-csv-to-shopline-xlsx/)[AI Readiness Checker](/ai-checker/)[SkuSync Docs](/docs/)[Shopline Checker](/shopline-checker/)[Shopline Helper](/shopline-helper/)[ImgSEO](/imgseo/)[ImgSEO Guide](/imgseo-doc/)

# 🛍️ SHOPLINE Storefront MCP

Build AI Shopping Assistants with Model Context Protocol

Connect AI to Real-time Commerce Data · Natural Language Shopping · Cart Management · Customer Support

## 🛒 What is SHOPLINE Storefront MCP?

SHOPLINE Storefront MCP connects any AI assistant to real-time commerce data from SHOPLINE stores. Using the **Model Context Protocol**, developers can build AI shopping experiences that help customers search, ask, and buy in natural language.

### 🔍 Product Discovery

Natural language search with intelligent product recommendations and contextual results.

### 🛒 Cart Management

Create carts, add or remove items, update quantities, and guide customers to checkout.

### ℹ️ Store Information

Answer questions about policies, shipping, returns, and FAQs to build customer trust.

## 🏗️ How It Works

The SHOPLINE Storefront MCP server lets your AI agent handle complete shopping tasks for any SHOPLINE store:

### 1️⃣ Customer Query

A shopper asks about products while browsing a SHOPLINE store in natural language.

### 2️⃣ AI Processing

Your AI agent searches the store's catalog, manages carts, and answers policy questions.

### 3️⃣ Purchase Complete

The shopper adds items to cart and completes checkout with AI assistance.

### 🔄 MCP Architecture

- **MCP Client:** Your SHOPLINE app that connects with AI models and passes requests to MCP servers
- **MCP Servers:** API endpoints that provide structured access to SHOPLINE's commerce data
- **Chat UI:** A theme extension that shows a customer-facing chat window
- **AI Model:** Any compatible AI system that processes natural language and calls MCP tools

## 🔌 Connect to the Server

Each SHOPLINE store has its own MCP server endpoint that exposes storefront features:

### 📡 Server Endpoint

**Endpoint Pattern:** `https://your-store.shoplineapp.com/api/mcp`

**Protocol:** Model Context Protocol (MCP) over JSON-RPC 2.0

**Authentication:** No authentication required for storefront operations

**Content-Type:** `application/json`

### 📝 API Request Example

#### Basic Setup

// Basic setup for SHOPLINE Storefront MCP server requests
const storeDomain = 'your-store.shoplineapp.com';
const mcpEndpoint = \`https://${storeDomain}/api/mcp\`;

// Example request using the endpoint
fetch(mcpEndpoint, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    jsonrpc: '2.0',
    method: 'tools/call',
    id: 1,
    params: {
      name: 'search\_shop\_catalog',
      arguments: {
        query: 'wireless headphones',
        context: "Customer looking for premium audio equipment"
      }
    }
  })
});

### ⚠️ Important Notes

- **Store-specific:** Each store has its own unique endpoint
- **No authentication:** Storefront operations don't require API keys
- **Real-time data:** Access to live product catalog and inventory
- **CORS enabled:** Can be called from browser applications

## 🛠️ Available MCP Tools

The SHOPLINE Storefront MCP server provides comprehensive tools to help customers browse and buy from any SHOPLINE store:

#### 🔍 search\_shop\_catalog

Searches the store's product catalog to find items that match customer needs

##### Parameters:

- `query` - Search query to find related products (required)
- `context` - Additional information to help tailor results (required)

##### Returns:

- Product name, price, and currency
- Variant ID and product URL
- Product images and descriptions

#### ❓ search\_shop\_policies\_and\_faqs

Answers questions about store policies, products, and services to build customer trust

##### Parameters:

- `query` - Question about policies or FAQs (required)
- `context` - Additional context like current product (optional)

##### Returns:

- Accurate policy information
- FAQ answers and explanations
- Store-specific guidelines

#### 🛒 get\_cart

Retrieves the current contents of a cart, including item details and checkout URL

##### Parameters:

- `cart_id` - ID of an existing cart (required)

##### Returns:

- Cart items with quantities and prices
- Total amount and currency
- Checkout URL for completion

#### ✏️ update\_cart

Updates quantities of items in an existing cart or adds new items. Creates a new cart if no cart ID is provided

##### Parameters:

- `cart_id` - ID of cart to update (optional, creates new if not provided)
- `lines` - Array of items to update or add (required)

##### Returns:

- Updated cart with new contents
- Cart ID for future operations
- Total price and item count

### 💡 Tool Usage Tips

- **Product Search:** Include customer preferences in the context for better results
- **Policy Queries:** Use only the provided answers - don't add external information
- **Cart Operations:** Set quantity to 0 to remove items from cart
- **Links:** Create markdown links for product titles using the URL property

## 💬 AI Shopping Experience Examples

See how AI assistants use MCP tools to create natural shopping experiences:

### 🔍 Product Discovery Flow

#### Customer:

"I'm looking for a gift for my tech-savvy friend"

#### AI Assistant:

1. Calls `search_shop_catalog` with context about gift preferences
2. Presents curated product recommendations
3. Answers follow-up questions about specifications
4. Helps compare different options

### 🛒 Cart Management Flow

#### Customer:

"Add this laptop to my cart and check the return policy"

#### AI Assistant:

1. Calls `update_cart` to add laptop to cart
2. Calls `search_shop_policies_and_faqs` for return policy
3. Provides cart summary and policy details
4. Offers to proceed to checkout

### ❓ Customer Support Flow

#### Customer:

"What's your shipping policy for international orders?"

#### AI Assistant:

1. Calls `search_shop_policies_and_faqs` with shipping query
2. Provides accurate policy information
3. Offers to help with order placement
4. Suggests relevant products for international shipping

### 🎯 Complete Purchase Flow

#### Customer:

"Help me buy wireless headphones under $200"

#### AI Assistant:

1. Searches catalog with budget constraint
2. Presents options with comparisons
3. Adds selected item to cart
4. Provides checkout link and purchase guidance

## 🔧 MCP Tool Usage Examples

Real MCP tool calls and responses for common shopping scenarios:

### 🔍 Product Search with Context

**Customer:** "I need wireless headphones for working out"

MCP Tool Call:
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "id": 1,
  "params": {
    "name": "search\_shop\_catalog",
    "arguments": {
      "query": "wireless headphones",
      "context": "Customer needs workout/sports headphones, likely sweat-resistant"
    }
  }
}

Response:
{
  "content": \[
    {
      "type": "text",
      "text": "Found these workout-suitable wireless headphones:\\n\\n1. \[SportBuds Pro Wireless\](https://store.com/sportbuds) - $89.99\\n   • Sweat-resistant IPX7 rating\\n   • 8-hour battery life\\n   • Secure ear hooks\\n\\n2. \[FitSound Active\](https://store.com/fitsound) - $129.99\\n   • Noise cancellation\\n   • 12-hour battery\\n   • Waterproof design"
    }
  \]
}

### 🛒 Cart Management

**Customer:** "Add the SportBuds to my cart"

MCP Tool Call:
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "id": 2,
  "params": {
    "name": "update\_cart",
    "arguments": {
      "lines": \[
        {
          "merchandise\_id": "gid://shopline/ProductVariant/sportbuds-pro",
          "quantity": 1
        }
      \]
    }
  }
}

Response:
{
  "content": \[
    {
      "type": "text",
      "text": "✅ Added SportBuds Pro Wireless to your cart!\\n\\nCart Summary:\\n• SportBuds Pro Wireless - $89.99\\n• Subtotal: $89.99\\n• Tax: $7.20\\n• Total: $97.19\\n\\n\[Proceed to Checkout\](https://store.com/cart/checkout?cart\_id=abc123)"
    }
  \]
}

### ❓ Policy Inquiry

**Customer:** "What's your return policy for electronics?"

MCP Tool Call:
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "id": 3,
  "params": {
    "name": "search\_shop\_policies\_and\_faqs",
    "arguments": {
      "query": "return policy electronics",
      "context": "Customer asking about returning wireless headphones"
    }
  }
}

Response:
{
  "content": \[
    {
      "type": "text",
      "text": "📋 Electronics Return Policy:\\n\\n• 30-day return window from purchase date\\n• Items must be in original packaging\\n• Electronics must be in working condition\\n• Original receipt required\\n• Return shipping: FREE for defective items, $9.99 for other returns\\n• Refund processed within 3-5 business days\\n\\nFor wireless headphones specifically: Please test within 7 days for compatibility."
    }
  \]
}

## 🎯 Benefits of SHOPLINE MCP

Build AI shopping experiences that convert browsers into buyers:

### 🎯 MCP Capabilities

- **Product Discovery:** Natural-language search with intelligent recommendations
- **Cart Management:** Create carts, add/remove items, and retrieve a checkout link
- **Store Information:** Answer questions about policies, shipping, returns, and FAQs
- **Checkout handoff:** Send shoppers to the store checkout URL to complete their purchase

### 🎨 App Features

- **AI-powered Chat:** Embedded chat bubble for real-time shopping help
- **Built-in MCP Client:** Connect to SHOPLINE's tools for catalog search, cart updates, and policy questions
- **Persistent Context:** Keep conversations coherent by remembering past messages
- **Custom Chat UI:** Style your theme extension to match store brand
- **Streaming Responses:** Natural chat experience with message streaming

## 🚀 Ready to Build AI Shopping Experiences?

Start building AI assistants that help customers search, ask, and buy in natural language with SHOPLINE's Model Context Protocol servers.

[Start Building Now](https://sline.dev/)[View Documentation](https://github.com/slinedev/shopline-storefront-mcp)

## 🔧 Technical Specifications

### 🏗️ MCP Protocol

- Model Context Protocol (MCP)
- JSON-RPC 2.0 communication
- Standard tool and resource interfaces
- Error handling and state management
- Client compatibility verification

### 🛍️ Commerce Operations

- Product catalog search and filtering
- Shopping cart create, read, update
- Checkout URL generation
- Policy and FAQ queries
- Real-time inventory status

### 👨‍💻 Developer Experience

- TypeScript/JavaScript support
- Comprehensive error information
- Debug-friendly response format
- Example code and documentation
- Open source MIT license

### 🤖 Supported AI Clients

- Claude Desktop and Claude API
- OpenAI GPT with MCP integration
- Custom MCP-compatible applications
- Development and testing frameworks
- Any JSON-RPC 2.0 client

### 🎯 Use Cases

- AI shopping assistant applications
- Customer service chatbots
- Product recommendation engines
- Voice commerce interfaces
- Conversational commerce platforms

## Related resources

This storefront integration serves shoppers with catalog search, policy answers, and cart updates. For documentation search and API schemas, use [SHOPLINE Dev MCP](/mcp/); for authenticated merchant data and backend operations, use [Shopline MCP Server](/shopline-mcp/).

[Learn MCP](https://modelcontextprotocol.io)[SHOPLINE Platform](https://shoplineapp.com)[Sline Developer MCP](/mcp/)[Shopify Storefront MCP](https://shopify.dev/docs/apps/build/storefront-mcp)

[![](/sline-logo.png)Sline](/)

Developer resources and browser tools for SHOPLINE themes, storefronts, and product data.

## Sline

- [Sline overview](/)
- [Theme Sections](/section/)
- [AST Explorer](/sline-ast-explorer/)

## Guides

- [Sline language guide](/sline-template/)
- [Syntax comparison](/sline-vs-handlebars-vs-liquid/)
- [Migration cookbook](/liquid-handlebars-sline/)
- [Dawn vs Bottle](/Shopify-Dawn-vs-Shopline-Bottle/)
- [OS 3.0 migration](/shopline-transformation/)
- [Theme CLI](/sline-theme-cli/)

## MCP

- [SHOPLINE Dev MCP](/mcp/)
- [Storefront MCP](/storefront-mcp/)
- [Shopline MCP](/shopline-mcp/)

## Tools

- [SkuSync](/skusync/)
- [SHOPLINE to Shopify](/convert-shopline-csv-to-shopify-format/)
- [Shopify to SHOPLINE](/convert-shopify-csv-to-shopline-xlsx/)
- [AI Readiness Checker](/ai-checker/)
- [SkuSync Docs](/docs/)
- [Shopline Checker](/shopline-checker/)
- [Shopline Helper](/shopline-helper/)
- [ImgSEO](/imgseo/)
- [ImgSEO Guide](/imgseo-doc/)

## Community & Support

- [SHOPLINE documentation](https://developer.shopline.com/docs/sline/)
- [GitHub](https://github.com/shoplineos/)
- [Report an issue](https://github.com/shoplineos/Bottle/issues)
- [Contact](mailto:hi@sline.dev)
- [SKU.md](https://sku.md)
- [Disclaimer](/disclaimer/)

## Languages

[English](/)[简体中文](/zh-cn/)[繁體中文](/zh-tw/)[日本語](/ja/)

© 2026 Sline.dev. All rights reserved.
