Skip to main content
Glama
maximeallanic

mcp-carrefour-drive

README.md
# mcp-carrefour-drive

MCP server for [Carrefour Drive](https://www.carrefour.fr) — Search products, manage your cart, check delivery slots, and order groceries via AI assistants.

Built with [Playwright](https://playwright.dev/) (headless Chrome) since Carrefour doesn't provide a public API.

## Features

- **Login/Logout** — Authenticate with your Carrefour account, session persisted via cookies
- **Store selection** — Find and select your Carrefour Drive by postal code
- **Product search** — Search products with prices, promotions, and availability
- **Product details** — Get nutrition facts, ingredients, allergens
- **Cart management** — Add, remove, update quantities
- **Delivery slots** — View available pickup slots and reserve one

> **Note:** This MCP does NOT handle payment. You validate and pay manually on the Carrefour website.

## Installation

```bash
npm install mcp-carrefour-drive
```

Or clone and build:

```bash
git clone https://github.com/maximeallanic/mcp-carrefour-drive.git
cd mcp-carrefour-drive
npm install
npx playwright install chromium
npm run build
```

## Configuration

### Environment variables

| Variable | Description | Required |
|---|---|---|
| `CARREFOUR_EMAIL` | Your Carrefour account email | Yes (for login) |
| `CARREFOUR_PASSWORD` | Your Carrefour account password | Yes (for login) |
| `CARREFOUR_DATA_DIR` | Directory for cookies/session data | No (default: `~/.carrefour-mcp`) |

### Claude Code / Claude Desktop

Add to your `.mcp.json` or `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "carrefour-drive": {
      "command": "npx",
      "args": ["-y", "mcp-carrefour-drive"],
      "env": {
        "CARREFOUR_EMAIL": "your-email@example.com",
        "CARREFOUR_PASSWORD": "your-password"
      }
    }
  }
}
```

### Docker

Since this uses headless Chrome, you need to install Chromium in your Docker container:

```dockerfile
RUN npx playwright install --with-deps chromium
```

## Available Tools

| Tool | Description |
|---|---|
| `login` | Login to Carrefour with email/password |
| `check_login` | Check if currently logged in |
| `logout` | Logout from Carrefour |
| `select_store` | Select a Carrefour Drive by postal code |
| `search_products` | Search for products |
| `get_product_details` | Get detailed product info (nutrition, ingredients) |
| `add_to_cart` | Add a product to your cart |
| `remove_from_cart` | Remove a product from your cart |
| `update_cart_quantity` | Update product quantity in cart |
| `get_cart` | View current cart contents and total |
| `get_available_slots` | List available pickup time slots |
| `select_slot` | Reserve a pickup slot |

## Example usage

```
> Search for "lait demi-écrémé"
> Add the first result to my cart, quantity 2
> What's in my cart?
> Show me available pickup slots for tomorrow
```

## Limitations

- Carrefour's website may change at any time, breaking selectors
- Rate limiting may apply — the server adds reasonable delays between actions
- No payment automation (by design)
- Requires a headless Chrome environment (not compatible with minimal Docker images)

## License

MIT

TDQS

C2.1/5.0

Scored across 14 tools

Disambiguation5/5

Each tool targets a clearly distinct action or resource: authentication (login/check_login/logout), product search and details, cart operations (add/remove/update/get), slot selection, checkout, and store selection. No two tools appear to do the same thing, and boundaries are easy to infer from names.

Naming Consistency5/5

All names use snake_case consistently, with a predictable verb_noun pattern (search_products, add_to_cart, get_available_slots, confirm_and_pay). The bare verbs login and logout are natural exceptions that do not break consistency.

Tool Count5/5

14 tools are well-scoped for an end-to-end grocery drive ordering workflow. Each tool has a clear role in the flow, and the count is neither thin nor bloated.

Completeness4/5

The surface covers authentication, product discovery, cart lifecycle, slot selection, checkout, and store selection—the core of a drive order. Missing order history/status or payment method management are minor gaps that agents can likely work around.

Maintenance

ActivityInactive
ResponsivenessNo issues