🛍️ 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 complete checkout
  • Store Information: Answer questions about policies, shipping, returns, and FAQs
  • Order Management: Track order status and process returns

🎨 App Features

  • AI-powered Chat: Embedded chat bubble for real-time shopping help
  • Built-in MCP Client: Connect to SHOPLINE's tools for search, cart, and orders
  • 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 View Documentation

🔧 Technical Specifications

🏗️ MCP Protocol

  • Model Context Protocol 1.0
  • 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