mcp-leclerc-drive
Search products, manage cart (add, remove, update quantities), and retrieve cart details for E.Leclerc Drive.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-leclerc-driveSearch for organic milk and add 2 to cart."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-leclerc-drive
The first open-source MCP server for E.Leclerc Drive β let Claude search products, manage a cart, and prepare grocery orders natively, instead of clicking through the website.
π’ v0.3 β working & DataDome-proof. All eight tools are validated end-to-end against the live site. Requests run inside a real Chrome driven over CDP, so they pass DataDome's bot protection (which blocks headless clients and cookie-replay). You log into Leclerc Drive once in the window that opens; the session persists. See
docs/api-capture.mdfor the reverse-engineered API.
Why
E.Leclerc Drive has no public API. Today the only way to automate it is browser automation β slow (~3β5 s per item) and fragile (blind clicks). This project exposes the underlying operations as proper MCP tools so any MCP client (Claude Desktop, Claude Code) can drive it directly.
Related MCP server: mcp-carrefour
Tools
Tool | Description |
| Find drives near a postal code or city β name, id, service type, distance, host. |
| Select & remember the active store (resolves the right host automatically). |
| Show the currently selected store. |
| Search the catalogue β products with price, price/kg, Nutri-Score, availability, and an |
| Add a product to the cart. |
| Remove a line from the cart. |
| Set a line's quantity (0 removes it). |
| Read the full cart with total. |
Status
Reverse-engineer Leclerc Drive endpoints (search / cart / store locator β see
docs/api-capture.md)All 8 tools validated end-to-end against the live store
Runtime store selection with persistence (
find_stores/set_store)v0.3: DataDome-proof via real-Chrome CDP driving (beats active bot-challenge that killed cookie-replay) β
Published to npm + MCP registry
Checkout / delivery-slot booking
Requirements
Node.js β₯ 22 (uses the built-in
WebSocket)Google Chrome installed (the server drives it via CDP)
Install (development)
git clone https://github.com/skunkobi/mcp-leclerc-drive.git
cd mcp-leclerc-drive
npm install
npm run buildHow auth works (real Chrome via CDP)
Leclerc Drive is protected by DataDome, which blocks non-browser traffic (headless clients, cookie-replay) with HTTP 403 once it escalates to active challenge mode. The only thing that reliably passes is a real browser that executes the challenge. So that's what the server uses:
On first request it launches your installed Google Chrome with a dedicated, persistent profile (
~/.mcp-leclerc-drive/chrome) and a debug port β no automation flags, sonavigator.webdriverstaysfalse.A Chrome window opens. Log into Leclerc Drive once in it. The persistent profile keeps you logged in across restarts.
Every request runs inside that page via CDP, so it carries the browser's cookies, TLS fingerprint, and solved DataDome challenge β and passes.
No cookies are read or stored; there's no Keychain prompt. The server must run on the same machine as Chrome, and a window does open (headless is detectable by DataDome β don't enable it unless you know the risk).
Env var | Default | Description |
|
| Default store id (overridden at runtime by |
|
| Default backend host (the |
| auto | Path to the Chrome binary, if not in the default location. |
|
| Persistent Chrome profile dir. |
|
| CDP remote-debugging port. |
|
| Run Chrome headless (β οΈ DataDome-detectable β not recommended). |
|
| Minimum delay between two requests (hygiene). |
|
| Extra random jitter added between requests. |
|
| Retries on a transient 403/429 before giving up. |
|
| Base retry backoff (doubles each attempt). |
The server still serializes and spaces out requests (single queue, ~1 s + jitter, retry with backoff) to stay polite β good hygiene even though the browser now handles DataDome.
Choosing your store (no env needed)
The easiest way: just ask, in the conversation. No env vars required.
> "trouve mon drive vers 44000" β find_stores lists nearby drives
> "prends RezΓ© Atout Sud" β set_store remembers it (correct host resolved)
> "cherche du lait" β runs on that storeset_store persists your choice to ~/.mcp-leclerc-drive/config.json, so it
sticks across sessions, and it resolves the correct backend host for you (the
fdN prefix genuinely varies per store β fd8, fd9, fd14β¦).
β οΈ One drive at a time. Leclerc binds your session to a single drive. The store you
set_storeto must be the one your Chrome session is logged into β which is the normal case (your own drive). Switching to an arbitrary other drive your browser isn't on will return a "session expired" error.
You can still hard-set the store via LECLERC_STORE_ID / LECLERC_HOST env vars
if you prefer (e.g. for headless deploys). To find them manually: your Drive URL
looks like https://fd9-courses.leclercdrive.fr/magasin-053701-053701-Your-Town/
β the 6-digit number is the store id, the fdN-courses.leclercdrive.fr part is
the host.
Claude Desktop / Claude Code (mcp config)
Install straight from npm β no clone needed:
# Claude Code
claude mcp add leclerc-drive -- npx -y mcp-leclerc-driveOr in a Claude Desktop config:
{
"mcpServers": {
"leclerc-drive": {
"command": "npx",
"args": ["-y", "mcp-leclerc-drive"]
}
}
}No env needed β pick your store in-conversation with find_stores / set_store.
On first use a Chrome window opens: log into Leclerc Drive once and you're set.
Development
npm run dev # tsc --watch
npm run typecheck # type-check without emitting
npm run inspect # run under the MCP InspectorArchitecture
src/
index.ts # MCP server: registers the 8 tools over stdio
config.ts # env-based config (store, host, Chrome/CDP, throttle)
types.ts # Product / CartItem / Cart
store.ts # active store selection + persistence (~/.mcp-leclerc-drive)
browser.ts # ChromeSession: drives real Chrome via CDP β beats DataDome
leclerc/
client.ts # Leclerc Drive backend client (search + cart)
locator.ts # store finder: postal code / city β nearby drives
throttle.ts # request serialization + spacing + retry (hygiene)
docs/
api-capture.md # the reverse-engineered Leclerc Drive APIContributing
This is a community tool β contributions are very welcome, whether it's a bug fix, support for your store, or a whole new capability (checkout, delivery slots, saved listsβ¦).
See CONTRIBUTING.md for dev setup, how to smoke-test
against your own account (npm run smoke), and β most useful for this project β
a short guide on how to reverse-engineer a new Leclerc Drive endpoint and
wire it in. Good first issues are listed in the status checklist above.
Feedback & contact
Feedback, bug reports, and ideas are very welcome.
Issues / PRs: open an issue on the repo.
Email: alexandreyagoubi@gmail.com
Disclaimer
Unofficial. Not affiliated with or endorsed by E.Leclerc. Use with your own account, at your own risk, in line with the site's terms of service. Intended for personal automation of your own grocery shopping.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/skunkobi/mcp-leclerc-drive'
If you have feedback or need assistance with the MCP directory API, please join our Discord server