leclerc-drive — Claude Code MCP server: E.Leclerc grocery ordering
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.
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-driveWhat leclerc-drive 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.
What it helps with
- 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 for the agent
- 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
How to install leclerc-drive
Platform CLI
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-driveReplace <…> with your own values
Platform CLI
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-driveReplace <…> with your own values
Config file
{
"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
Config file
{
"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
Platform CLI
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-driveReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about leclerc-drive
How do I install leclerc-drive in Claude Code?
Run claude mcp add leclerc-drive -e LECLERC_COOKIE=<LECLERC_COOKIE> -- npx -y mcp-leclerc-drive. The store can be chosen later in conversation with find_stores and set_store.
What does leclerc-drive do?
It exposes eight tools for E.Leclerc Drive: drive lookup, drive selection, product search and cart management. Calls go through an open Chrome window, which is how they get past DataDome.
Why does it need a real Chrome instead of a headless browser?
DataDome blocks headless clients and replayed cookies, so a headless server risks HTTP 403. The server therefore drives a normal Chrome with a persistent profile you sign into once.