
E.Leclerc Drive 的 MCP 服务器
概览
第一个开源——让Claude原生搜索产品、管理购物车和准备杂货订单,而无需点击网站。 🟢 所有八个工具都经过端到端的实时站点验证。请求运行在 ,因此通过了 DataDome 的机器人防护(阻止无头客户端和 cookie 重放)。你在打开的窗口中登录 Leclerc Drive;会话会持续存在。请参见 docs/api-capture.md 获取逆向工程的 API。 E.Leclerc Drive 没有公开 API。目前唯一能实现自动化的方法是浏览器自动化——速度慢(每项约 3–5 秒)且脆弱(盲点击)。该项目将底层操作作为合适的 MCP 工具展示,使任何 MCP 客户端(Claude Desktop、Claude Code)都能直接驱动。 - [x] 逆向工程Leclerc Drive端点(搜索/购物车/存储定位器——见文档/API捕获)。
概述(AI 翻译)
首个开源的 E.Leclerc Drive MCP 服务器——让 Claude 原生搜索产品、管理购物车和准备杂货订单,而无需点击网站。
🟢 v0.3 — 可用且防 DataDome。 所有八个工具都经过端到端验证,针对在线站点进行验证。请求运行在基于 CDP 的真实 Chrome 内部,因此通过了 DataDome 的机器人保护(该机器人阻止无头客户端和 Cookie 重放)。你只需在打开的窗口中登录 Leclerc Drive;会话会持续存在。参见
docs/api-capture.md以了解逆向工程的 API。
为什么
E.Leclerc Drive 没有公开 API。目前唯一能实现自动化的方法是浏览器自动化——速度慢(每项约 3–5 秒)且脆弱(盲点击)。该项目将底层操作作为合适的 MCP 工具展示,使任何 MCP 客户端(Claude Desktop、Claude Code)都能直接驱动。
工具
| 工具 | 描述 |
|---|---|
find_stores(query) |
查找邮政编码或城市附近的驱动器,→姓名、ID、服务类型、距离、主机。 |
set_store(store_id) |
选择并记住活跃存储(自动解析正确的主机)。 |
get_store() |
显示当前选择的商店。 |
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
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.
Tools
| Tool | Description |
|---|---|
find_stores(query) |
Find drives near a postal code or city → name, id, service type, distance, host. |
set_store(store_id) |
Select & remember the active store (resolves the right host automatically). |
get_store() |
Show the currently selected store. |
search_product(query) |
Search the catalogue → products with price, price/kg, Nutri-Score, availability, and an id. |
add_to_cart(product_id, quantity?) |
Add a product to the cart. |
remove_from_cart(product_id) |
Remove a line from the cart. |
update_quantity(product_id, quantity) |
Set a line’s quantity (0 removes it). |
get_cart() |
Read the full cart with total. |
Status
- [x] Reverse-engineer Leclerc Drive endpoints (search / cart / store locator — see
docs/api-capture.md) - [x] All 8 tools validated end-to-end against the live store
- [x] Runtime store selection with persistence (
find_stores/set_store) - [x] v0.3: DataDome-proof via real-Chrome CDP driving (beats active bot-challenge that killed cookie-replay) ✅
- [x] 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 build
How 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.
安装
npx -y mcp-leclerc-drive配置
{
"mcpServers": {
"leclerc-drive": {
"command": "npx",
"args": ["-y", "mcp-leclerc-drive"]
}
}
}