ďż˝ 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:
- Calls
search_shop_catalogwith context about gift preferences - Presents curated product recommendations
- Answers follow-up questions about specifications
- Helps compare different options
đ Cart Management Flow
Customer:
"Add this laptop to my cart and check the return policy"
AI Assistant:
- Calls
update_cartto add laptop to cart - Calls
search_shop_policies_and_faqsfor return policy - Provides cart summary and policy details
- Offers to proceed to checkout
â Customer Support Flow
Customer:
"What's your shipping policy for international orders?"
AI Assistant:
- Calls
search_shop_policies_and_faqswith shipping query - Provides accurate policy information
- Offers to help with order placement
- Suggests relevant products for international shipping
đŻ Complete Purchase Flow
Customer:
"Help me buy wireless headphones under $200"
AI Assistant:
- Searches catalog with budget constraint
- Presents options with comparisons
- Adds selected item to cart
- 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