# leclerc-drive

An MCP server that lets your coding agent search the E.Leclerc Drive catalogue, build a cart and pick a store. Useful when grocery runs are easier to hand to an assistant than to click through on the site.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 25
- Author: skunkobi
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/skunkobi/mcp-leclerc-drive
- Updated: 2026-07-11
- HTML: https://affpapa.org/en/nevibecode/mcp/leclerc-drive

## What it does

Leclerc Drive has no public API, so the server talks to the site through a real Chrome instance over CDP. The first request opens a window with its own persistent profile; you sign in to your Drive there once, and later calls run inside that page with its cookies and a solved DataDome challenge. Headless is discouraged, since the bot protection detects it.

Eight tools are registered. `find_stores` looks up drives by postcode or town, and `set_store` remembers your pick in `~/.mcp-leclerc-drive/config.json` while resolving the right backend host. `search_product` returns items with price, price per kilo, Nutri-Score, stock status and an `id`; `add_to_cart`, `remove_from_cart`, `update_quantity` and `get_cart` handle the basket.

You need Node.js 22 or newer plus Google Chrome on the same machine. The session sticks to one drive: switching to a store the browser isn't signed into brings back a session-expired error. Checkout and delivery-slot booking aren't in place yet.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `LECLERC_STORE_ID`, `LECLERC_HOST`, `LECLERC_COOKIE`, `LECLERC_CHROME_PROFILE` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env LECLERC_STORE_ID=<LECLERC_STORE_ID> --env LECLERC_HOST=<LECLERC_HOST> --env LECLERC_COOKIE=<LECLERC_COOKIE> --env LECLERC_CHROME_PROFILE=<LECLERC_CHROME_PROFILE> --transport stdio leclerc-drive -- npx -y mcp-leclerc-drive
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add leclerc-drive --env LECLERC_STORE_ID=<LECLERC_STORE_ID> --env LECLERC_HOST=<LECLERC_HOST> --env LECLERC_COOKIE=<LECLERC_COOKIE> --env LECLERC_CHROME_PROFILE=<LECLERC_CHROME_PROFILE> -- npx -y mcp-leclerc-drive
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "leclerc-drive": {
            "command": "npx",
            "args": [
                "-y",
                "mcp-leclerc-drive"
            ],
            "env": {
                "LECLERC_STORE_ID": "<LECLERC_STORE_ID>",
                "LECLERC_HOST": "<LECLERC_HOST>",
                "LECLERC_COOKIE": "<LECLERC_COOKIE>",
                "LECLERC_CHROME_PROFILE": "<LECLERC_CHROME_PROFILE>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "leclerc-drive": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "mcp-leclerc-drive"
            ],
            "env": {
                "LECLERC_STORE_ID": "<LECLERC_STORE_ID>",
                "LECLERC_HOST": "<LECLERC_HOST>",
                "LECLERC_COOKIE": "<LECLERC_COOKIE>",
                "LECLERC_CHROME_PROFILE": "<LECLERC_CHROME_PROFILE>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e LECLERC_STORE_ID=<LECLERC_STORE_ID> -e LECLERC_HOST=<LECLERC_HOST> -e LECLERC_COOKIE=<LECLERC_COOKIE> -e LECLERC_CHROME_PROFILE=<LECLERC_CHROME_PROFILE> leclerc-drive npx -y mcp-leclerc-drive
```
Replace <…> with your own values

## When to use it
- find the nearest drive by postcode or town
- check product prices and Nutri-Score inside the chat
- fill a weekly basket without browsing the site
- adjust or drop a cart line by quantity
- keep the chosen store between agent sessions

## Example prompts
- Find my drive near 44000 and select it
- Search the catalogue for milk and show me the prices
- Add two litres of milk to the cart and read back the total

## Similar
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [AIHawk](https://affpapa.org/en/nevibecode/mcp/aihawk.md) — MCP server · ★ 32221
- [Skyvern](https://affpapa.org/en/nevibecode/mcp/skyvern.md) — MCP server · ★ 23263
- [SeleniumBase MCP](https://affpapa.org/en/nevibecode/mcp/seleniumbase-mcp.md) — MCP server · ★ 13169
- [apify-mcp-server](https://affpapa.org/en/nevibecode/mcp/apify-mcp-server.md) — MCP server · ★ 12927

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
