Skip to main content
Glama
volticscontent

Shopify Storefront MCP Server

README.md
# Demo Shopify Storefront MCP Server

This is created as a demo for a proposal regarding Public MCP Servers on the [OpenAI Community Platform](https://community.openai.com/t/technical-discussion-support-public-mcp-servers/1275810)

## Multi-Store Support

This server now supports multiple Shopify stores simultaneously. You can configure up to multiple stores and switch between them using the `storeId` parameter in all tools.

## Setup

### Single Store Setup (Legacy)
```sh
cp .env.example .env
```

### Multi-Store Setup (Recommended)
```sh
cp .env.stores.example .env
```

Then, replace the environment variables with your actual Shopify store credentials:
- **Domain**: Your Shopify store domain (e.g., `your-store.myshopify.com`)
- **Storefront Token**: [Shopify Storefront API Token](https://shopify.dev/docs/api/usage/authentication#access-tokens-for-the-storefront-api)
- **Admin Token**: Admin API access token (for advanced operations)
- **API Key/Secret**: Your app's API credentials

### Store Configuration
Each store requires:
- Unique `storeId` (used in tool calls)
- Store name (for display purposes)
- Domain and access tokens
- Enable/disable flag

## Running

```sh
# First terminal
npm build
npm start
```

## Deployment of the Public Server

You can deploy the Express Server whereever you wish and then use `https://your-domain.com/mcp` instead of `http://localhost:3000/mcp` for the following examples to test the remote server.

## Connecting via Claude Desktop

First run the MCP Server like above.
Then add this to your Claude Desktop Config

```json
{
  "mcpServers": {
    "demo-shopify-storefront-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote@latest",
        "http://localhost:3000/mcp"
      ]
    }
  }
}
```

## Available Tools

### Multi-Store Tools
- `listStores` - List all configured and enabled stores
- `findProducts` - Search products in a specific store
- `getProductById` - Get product details by ID
- `cartCreate` - Create a new cart
- `cartLinesAdd` - Add items to cart
- `cartLinesUpdate` - Update cart items
- `cartLinesRemove` - Remove items from cart
- `getCart` - Get cart details

### Usage Examples

All tools (except `listStores`) require a `storeId` parameter:

```json
{
  "storeId": "europride",
  "query": "perfume"
}
```

Available store IDs:
- `europride` - EURO PRIDE store
- `wifimoney` - WIFI MONEY store  
- `saderstore` - SADERSTORE store

## Manual Testing

```sh
# Second terminal
npx @modelcontextprotocol/inspector http://localhost:3000/mcp
```