npm package: @saleslayer/mcp-server
Description: Sales Layer MCP Server con OAuth (remoto HTTP + stdio) para integración con Claude
Author: Sales Layer
Latest version: 1.8.2

# Sales Layer MCP Server

**Connect your Sales Layer catalog to AI assistants like Claude and ChatGPT**

[![NPM Version](https://img.shields.io/npm/v/@saleslayer/mcp-server.svg)](https://www.npmjs.com/package/@saleslayer/mcp-server)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)

---

## What is this?

The Sales Layer MCP Server allows you to connect your Sales Layer product catalog to AI assistants using the Model Context Protocol (MCP). Ask questions about your products, categories, and variants in natural language.

**Supported AI assistants:**
- Claude Web (claude.ai)
- ChatGPT (chatgpt.com)
- Claude Desktop
- Google AI Studio
- Other MCP-compatible tools

---

## Features

- ✅ **Multi-client support**: Claude Web, ChatGPT, Claude Desktop, and more
- ✅ **OAuth 2.0 with PKCE**: Secure authentication flow
- ✅ **Dynamic Client Registration**: Automatic client setup (RFC 7591)
- ✅ **Profile-based access**: OnlyRead and Full access levels
- ✅ **Intelligent caching**: Automatic cache invalidation on data changes
- ✅ **Multilingual support**: Search across multiple language fields

---

## Quick Start

### Option 1: Remote Server (Recommended for Claude Web / ChatGPT)

**URL**: `https://mcp.saleslayer.com`

1. Get your Catalog Token from Sales Layer
2. Add the Sales Layer MCP connector in your AI assistant
3. Authenticate with your token
4. Start asking questions!

### Option 2: Claude Desktop (Local)

Add this to your Claude Desktop configuration file:

```json
{
  "mcpServers": {
    "sales-layer": {
      "command": "npx",
      "args": ["--yes", "@saleslayer/mcp-server@latest"],
      "env": { "CATALOG_TOKEN": "your_token" }
    }
  }
}
```

Restart Claude Desktop after editing its configuration.

## 🔑 Getting Your Catalog Token

1. Log into your Sales Layer admin panel
2. Navigate to **API/Tokens** section
3. Copy your **catalog API token**
4. Use this token in the configuration above

## 🛠️ Available Tools

Once configured, Claude can help you with:

### Catalog Management
- **Search products**: Find products by name, category, or attributes
- **Browse categories**: Explore your product category structure
- **Get product details**: Retrieve detailed product information
- **Search variants**: Find specific product variants

### Data Queries
- **Filter products**: Use advanced filters (status, price, category)
- **Get metadata**: Understand your catalog structure
- **Custom entities**: Access custom data entities
- **Validate access**: Check token permissions

## 💬 Example Conversations

**Search for products:**
> "Show me all electronics products under $100"

**Category exploration:**
> "What categories do we have in our catalog?"

**Product details:**
> "Get details for product SKU ABC123"

**Advanced filtering:**
> "Find all visible products in the 'clothing' category with prices between $20 and $50"

**Metadata exploration:**
> "What fields are available for products in our catalog?"

**Multilingual searches:**
> "Find products with 'Abrigo' in the title"
> "Search for 'Winter Coat' in English or 'Abrigo de Invierno' in Spanish"
> "Show me all products with 'Chaqueta' in any language"

### 🌍 Multilingual Catalog Support

The MCP server provides intelligent multilingual search capabilities:

**Automatic Language Detection:**
Claude can detect the language of your search terms and automatically search in the appropriate language fields.

**Example workflows:**
- You ask: "Find products with 'Abrigo'"
- Claude detects Spanish → Searches in `prod_title_es`
- If no results → Also searches in default language

**Multiple Language Search:**
- You ask: "Find 'Coat' or 'Abrigo'"
- Claude searches: `prod_title_en` OR `prod_title_es`

**Get Help:**
> "How do I search in multiple languages?"
> "What languages are available in my catalog?"

The server will guide you through multilingual search strategies automatically.

## 🔧 Troubleshooting

### Common Issues

**"MCP server not found"**
- Ensure Node.js 18+ is installed: `node --version`
- Check internet connection (NPX downloads the package)
- Restart Claude Desktop after configuration

**"Invalid token" errors**
- Verify your catalog token is correct
- Check token permissions in Sales Layer admin
- Ensure token hasn't expired

**"No results found"**
- Check your catalog has visible products
- Verify product status filters
- Try broader search terms
- **For multilingual catalogs:** Make sure you're searching in the right language field

**Multilingual search issues**
- Use language-specific fields: `prod_title_es`, `prod_title_en`, etc.
- Ask Claude: "How do I search in multiple languages?"
- Use the help tool: "help_search_multilingual"
- Check available languages: "What languages are in my catalog?"

### Debug Mode

Enable debug logging by adding to your configuration:
```json
{
  "mcpServers": {
    "sales-layer": {
      "command": "npx",
      "args": ["--yes", "@saleslayer/mcp-server@latest"],
      "env": {
        "CATALOG_TOKEN": "your_token",
        "DEBUG": "true",
        "LOG_TO_FILE": "true"
      }
    }
  }
}
```

### Cache Configuration

Configure intelligent caching for better performance:
```json
{
  "mcpServers": {
    "sales-layer": {
      "command": "npx",
      "args": ["--yes", "@saleslayer/mcp-server@latest"],
      "env": {
        "CATALOG_TOKEN": "your_token",
        "CACHE_ENABLED": "true",
        "CACHE_TABLES_TTL": "300000",
        "CACHE_METADATA_TTL": "600000"
      }
    }
  }
}
```

**Cache Settings:**
- `CACHE_ENABLED`: Enable/disable caching (default: `true`)
- `CACHE_TABLES_TTL`: Cache duration for all tables in milliseconds (default: `300000` = 5 minutes)
- `CACHE_METADATA_TTL`: Cache duration for metadata in milliseconds (default: `600000` = 10 minutes)

**Cache Features:**
- ✅ Automatic invalidation on data changes (CREATE/UPDATE/DELETE)
- ✅ Smart relationship-based invalidation
- ✅ Configurable TTL per data type
- ✅ Performance metrics and monitoring
- ✅ Manual cache control via MCP tools

### Getting Help

1. **Check Claude Desktop logs** for error messages
2. **Verify token permissions** in Sales Layer admin
3. **Test API access** directly in Sales Layer
4. **Contact Sales Layer support** for token issues

## 📋 System Requirements

- **Node.js 18.0.0+** (LTS recommended)
- **Claude Desktop** (latest version)
- **Sales Layer account** with API access
- **Internet connection** for package downloads

## 🔒 Security & Privacy

- Your catalog token is stored locally in Claude Desktop configuration
- **No .env files needed** - tokens are passed securely via Claude Desktop
- No data is sent to third parties
- All API calls go directly to Sales Layer servers
- Token is transmitted securely via HTTPS

## 📞 Support

- **Sales Layer Support**: [support.saleslayer.com](https://support.saleslayer.com)
- **API Documentation**: [Sales Layer API Docs](https://api2.saleslayer.com/swagger/index.html)

---

**Made with ❤️ by Sales Layer**

Transform your product catalog management with AI-powered assistance.