npm package: @plugix/mcp-pimcore
Description: MCP Server for Pimcore PIM - AI-powered product catalog management
Author: Plugix
Latest version: 0.1.0

# Pimcore MCP Server

MCP server for Pimcore PIM (Product Information Management) integration.

## Features

- **get_products** - Query products with filters (category, search, limit)
- **get_categories** - List all product categories
- **get_stats** - Catalog statistics (total products, languages, gaps)
- **save_descriptions** - Save AI-generated descriptions (with confirmation)
- **save_translations** - Save translations (with confirmation)
- **save_seo** - Save SEO metadata (with confirmation)

## Installation

```bash
npm install
cp .env.example .env
```

## Configuration

Edit `.env`:

```env
# AI Integration API
API_URL=wss://api.ai-integration.com
API_TOKEN=sk_live_your_token_here

# Pimcore credentials
PIMCORE_URL=https://your-pimcore.com
PIMCORE_API_KEY=your_pimcore_api_key

# Optional
PIMCORE_DEFAULT_LANGUAGE=en
```

## Usage

### Development

```bash
npm run dev
```

### Production

```bash
npm run build
npm start
```

### Docker

```bash
docker build -t mcp-pimcore .
docker run --env-file .env mcp-pimcore
```

## Tools Reference

### get_products

Query products from the Pimcore catalog.

**Parameters:**
| Name | Type | Description |
|------|------|-------------|
| category | string | Filter by category name |
| search | string | Search in name/SKU |
| limit | number | Max results (default: 10) |
| offset | number | Pagination offset |
| missingDescription | boolean | Only products without description |

**Example:**
```json
{
  "name": "get_products",
  "arguments": {
    "category": "Footwear",
    "limit": 5
  }
}
```

### get_categories

List all product categories.

**Parameters:** None

### get_stats

Get catalog statistics.

**Returns:**
- Total products
- Products without descriptions
- Available languages
- Category breakdown

### save_descriptions

Save AI-generated descriptions. Requires confirmation.

**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| items | array | Yes | `[{productId, description}]` |
| language | string | No | Target language (default: en) |
| confirmed | boolean | Yes | Must be `true` to save |

**Example:**
```json
{
  "name": "save_descriptions",
  "arguments": {
    "items": [
      {"productId": "123", "description": "Premium leather boots..."},
      {"productId": "456", "description": "Elegant handbag..."}
    ],
    "language": "en",
    "confirmed": true
  }
}
```

### save_translations

Save product translations. Requires confirmation.

**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| items | array | Yes | `[{productId, translations: {lang: text}}]` |
| confirmed | boolean | Yes | Must be `true` to save |

### save_seo

Save SEO metadata. Requires confirmation.

**Parameters:**
| Name | Type | Required | Description |
|------|------|----------|-------------|
| items | array | Yes | `[{productId, title, description, keywords}]` |
| confirmed | boolean | Yes | Must be `true` to save |

## Pimcore API Requirements

Your Pimcore instance needs:

1. **REST API enabled** with API key authentication
2. **Data Object classes** for Products with fields:
   - `name` (localized)
   - `description` (localized)
   - `sku`
   - `categories` (relation)
3. **Permissions** for read/write on Product objects

## Testing

```bash
npm test
```

## Troubleshooting

### Connection refused
- Check `API_URL` is correct
- Verify `API_TOKEN` is valid
- Ensure firewall allows outbound WebSocket

### Pimcore API errors
- Verify `PIMCORE_URL` and `PIMCORE_API_KEY`
- Check API permissions in Pimcore admin
- Ensure REST API is enabled

### Tool not found
- Restart server after tool changes
- Check tool is exported in `src/tools/index.ts`

## License

MIT