Skip to main content
Glama
maximeallanic

Carrefour Drive MCP

Carrefour Drive MCP — AIエージェントのための食料品ショッピング

Carrefour Drive(carrefour.fr)用MCPサーバー。 Claude、Cursor、その他あらゆる Model Context Protocolクライアントで、フランスの食料品カタログを検索し、カートを構築し、 Driveの受け取り時間枠や配送枠を選び、ポイント残高や過去のレシートを確認できます — すべてお客様自身のCarrefourアカウントで。

48のツール。 43個の実在するcarrefour.fr APIエンドポイントをJSONとして記述し、 汎用エグゼキュータで実行します。さらに5つのセッション管理ツールを追加。エンドポイントの追加は JSONファイルを1つ置くだけ — コードは不要です。

"What did I buy last month?"            → get_loyalty_order_receipts
"Refill my usual weekly groceries."     → get_frequent_purchases + add_item_to_cart
"Cheapest organic pasta under 2 €?"     → search_products
"Book the Saturday morning Drive slot." → get_delivery_timeslots + select_cart_delivery_slot
  • スタンドアロンspectralバイナリも、外部ゲートウェイも、APIキーも不要。クローンして、ビルドして、実行するだけ。

  • Cloudflare対策済み — すべての呼び出しは実際のChromiumページから発行されるため、 200以外の応答はありません。

  • ログイン状態を維持 — ブラウザウィンドウで一度ログインするだけ。サーバーが OAuth2 SSOループを通じてセッションを自動更新します。


目次


Related MCP server: mcp-leclerc-drive

インストール

クローンするものは何もありません。Node.js 20+ が唯一の前提条件です(ネイティブの fetchFormDatanode:testを使用)。

npx -y github:maximeallanic/CarrefourDriveMCP

その1つのコマンドで、stdio上で動作するサーバーをフェッチしてビルドし、起動します — 初回実行時には HTTPトランスポートとして使用するChromiumもダウンロードされます。ほとんどの場合、 コマンドを自分で入力する必要はありません。MCPクライアントの設定に記載しておけば (次のセクション)、クライアントが代わりに実行してくれます。

一度グローバルにインストールしたい場合は?

npm install -g github:maximeallanic/CarrefourDriveMCP
carrefour-drive-mcp

セッション、ブラウザプロファイル、ログは~/.carrefour-drive-mcpに保存されます (CARREFOUR_DATA_DIRを設定すれば変更可能)。そのため、アップグレードしても ログアウトされることはありません。

git clone https://github.com/maximeallanic/CarrefourDriveMCP.git
cd CarrefourDriveMCP
npm install     # builds, and downloads the Chromium transport
node dist/index.js

ソースからチェックアウトした場合、データはリポジトリ内のdata/ディレクトリに保存されます。

エージェントに接続する

Claude Code

claude mcp add carrefour-drive -- npx -y github:maximeallanic/CarrefourDriveMCP

その後、任意のセッションで:

> Log me in to Carrefour        (runs carrefour_browser_login)
> Add 2 L of semi-skimmed milk to my Drive cart

Claude Desktop

claude_desktop_config.jsonを編集します:

  • macOS~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows%APPDATA%\Claude\claude_desktop_config.json

  • Linux~/.config/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "carrefour-drive": {
      "command": "npx",
      "args": ["-y", "github:maximeallanic/CarrefourDriveMCP"]
    }
  }
}

Claude Desktopを再起動すると、Carrefourツールがツールメニューに表示されます。

Windowsでは、"command": "cmd"を使用し、 "args": ["/c", "npx", "-y", "github:maximeallanic/CarrefourDriveMCP"]とします。

Cursor、Windsurf、Zed、VS Code、その他のMCPクライアント

stdioでMCPを話せるクライアントなら、同じ2つのフィールドで動作します:

{
  "command": "npx",
  "args": ["-y", "github:maximeallanic/CarrefourDriveMCP"]
}
  • Cursor~/.cursor/mcp.json(またはプロジェクト内の.cursor/mcp.json

  • Windsurf~/.codeium/windsurf/mcp_config.json

  • VS Code / Copilot.vscode/mcp.json"servers"配下

  • Zedsettings.json"context_servers"配下

グローバルにインストールした場合やソースからクローンした場合は、代わりに以下を使用します: {"command": "carrefour-drive-mcp"}または {"command": "node", "args": ["/absolute/path/to/dist/index.js"]}

すでにクッキーをお持ちの場合は、ログインの代わりに"env"ブロックで渡せます: {"CARREFOUR_COOKIES": "…cookie header…"}

ログイン

carrefour.frは、Cloudflare Turnstileキャプチャと OTPの背後でクッキーによるサインインを行います。そのためログインは対話式で、一度だけ行います:

  1. エージェントに carrefour_browser_login の実行を依頼します。

  2. Carrefourのログインページでブラウザウィンドウが開きます。メールアドレス、パスワード、 OTPコードはご自身で入力してください。

  3. ウィンドウを閉じないでください — サーバーがOAuthループの完了を検出し、 メモリからセッションクッキーを取得して、ウィンドウを閉じます。

以降、セッションは自動的に更新されます。サーバーは認証が必要な呼び出しの前にSSOの authorize → callbackリダイレクトを再生し、さらに30分ごとにキープアライブを実行します。 SSOクッキー自体が期限切れになった場合(最大24時間、またはアイドル60分)にのみ、 再度ログインが必要です — ツールがその旨を明示的に通知します。

セッション状態はいつでもcarrefour_session_statusで確認できます(verify: trueで 実際の呼び出しを行います)。

セッションツール

機能

carrefour_browser_login

サインイン用ウィンドウを開く(キャプチャ + OTP)

carrefour_session_status

保存済みクッキー、ブラウザプロファイル、SSO残り時間を表示

carrefour_refresh_session

更新を強制する(通常は不要 — 自動更新されます)

carrefour_set_cookies

クッキーを手動でインポート(ヘッダー、JSONマップ、JSON配列のいずれか)

carrefour_clear_session

ローカルセッションを消去

carrefour_set_cookiesでは、JSON配列形式のみがクッキーの domainを保持できます — c4iamsecuretkを提供できるのはこの形式だけであり、 これがないと自動更新は不可能です。

クッキージャーは<data dir>/sessions/cookies.json0600)に保存され、 起動のたびにブラウザプロファイルへ再注入されます。

ツールリファレンス

検索とカタログ (アカウント不要)

ツール

エンドポイント

必須パラメータ

search_products

GET /s

q

autocomplete_search

GET /autocomplete

q

get_products_by_gtins

POST /products

gtins

get_products_by_query

GET /products/query/{query_id}

query_id

get_product_reviews

GET /product/{ean}/reviews

ean

get_navigation_tree

GET /navigation

get_marketing_placements

POST /api/marketing/{placement}

placementsearchTermcategoriesproductFilters

get_donation_products

GET /donation

get_chat_preprompts

POST ocb.carrefour.fr/preprompts

modescountnavigationCurrentPageTitlenavigationCurrentPageType

get_eligible_drive_stores

GET /api/eligibility/drive

latitudelongitudepostalCodecity

カートとチェックアウト

ツール

エンドポイント

必須パラメータ

get_cart

GET /api/cart

add_item_to_cart

PATCH /api/cart

eancounterbasketServiceIdsubBasketType

add_item_to_cart_by_ean

PATCH /api/cart/items

eanbasketServiceIdsubBasketType

apply_promo_code_to_cart

POST /api/cart/promo_code

codefacilityServiceIdsubBasketType

simulate_cart_for_store

GET /api/cart/simulate

storeRef

get_delivery_timeslots

GET /api/timeslots

facilityServiceId

select_cart_delivery_slot

PUT /api/cart/slot

slotRefstoreRef

validate_checkout_slot

POST /api/checkout/{basket_service_type}/validate/slot

basket_service_typedeviceFingerPrintId

validate_checkout_summary

POST /api/checkout/{basket_service_type}/validate/summary

basket_service_typedeviceFingerPrintId

get_checkout_recommendations

GET /api/checkout/recommendations/{facility_id}/{basket_service}

facility_idbasket_service

submit_checkout_payment ⚠️

POST /api/checkout/payment

checkout_typedevice_fingerprint_idpayments

⚠️ submit_checkout_payment実際の支払いを実行します。4つのパラメータが 説明ではHTTPヘッダーを示唆しているにもかかわらず、クエリ文字列として取得されました — 本番環境で使用する前に、実際のトレースと照合して確認してください。

アカウント、注文、ポイント

ツール

エンドポイント

必須パラメータ

get_orders

GET /api/user/orders

get_last_orders

GET /api/user/orders/last

get_frequent_purchases

GET /mon-compte/achats-frequents

get_loyalty_balance

GET /api/user/secured/loyalty/balance

get_loyalty_cards

GET /api/user/secured/loyalty/my-cards

get_loyalty_coupons_dashboard

GET /api/user/loyalty/coupons-dashboard

get_loyalty_coupon_collection

GET /api/user/loyalty/coupon-collection

get_loyalty_order_receipts

GET /api/user/secured/loyalty/orders/receipts

loyaltyCardNumber, loyaltyCardType

get_loyalty_order_receipt_details

GET /api/user/secured/loyalty/orders/receipt/{gln}/{date_key}/{receipt_number}

gln, date_key, receipt_number

get_advantage_codes

GET /api/advantage-code

get_vignettes_products

GET /api/user/products/vignettes-products

get_olympic_games_prime

GET /api/user/loyalty/olympic-games/prime

get_account_kpis

GET /api/user/my-account/kpis

codes

get_user_consents

GET /api/user/my-account/consents

get_favorite_store

GET /api/favoritestore

get_store_information_inserts

POST /api/information-insert/stores/{store_id}

store_id, insert_ids

get_homepage_returning_banner

GET /api/homepage/returningBanner

get_personalized_recommendations

GET /api/user/recommendation/cdp

get_product_recommendations

GET /api/recommendations

context

買い物リスト

ツール

エンドポイント

必須パラメータ

get_shopping_lists

GET /api/shopping-lists

get_shopping_list

GET /api/shopping-lists-id/{list_id}

list_id

create_shopping_list

POST /api/shopping-lists/memo-list

title

なぜ実際のブラウザが必要なのか

carrefour.fr は Cloudflare の マネージドチャレンジ の背後にあり、クライアントをフィンガープリントします。同じ日に1つのIPから測定した結果:

クライアント

GET /api/cart

fetch (undici)

403 cf-mitigated: challenge最初のリクエストで

curl

200、数回呼び出した後に 403

Chrome

200

ヘッダーをいくら調整しても変わりません。唯一有効なトランスポートはブラウザです。そしてリクエストはページから発行される必要があります — Playwright の APIRequestContext は Node の HTTP スタックを使用するため、fetch と同様にブロックされます。

そこで、サーバーは永続的な Chromium を保持し、すべての API 呼び出しをターゲットオリジンに駐車したページ内の fetch として実行します(オリジンごとに1ページ、CORS のため)。これはウィンドウレスで実行されますが、標準のヘッドレスモードではありません:

起動モード

結果

headless: true (ヘッドレスシェル)

403 — UA が HeadlessChrome を名乗る

headless: false

200

channel: 'chromium' + マスクされた UA + --disable-blink-features=AutomationControlled

200navigator.webdriverfalse

最後の行が実際に出荷されるものです。

認証の仕組み

2つの独立した Cookie システム:

ドメイン

役割

有効期間

moncompte.carrefour.fr

ForgeRock SSO、Cookie c4iamsecuretk

最大24時間、アイドル60分で失効

www.carrefour.fr

ストアセッション(HttpOnly Cookie)

短命、更新可能

ログインは2つの制約があるため対話式です。フォームは Cloudflare Turnstile キャプチャの背後にあり、CDP 駆動のブラウザでは検証を拒否します。また、c4iamsecuretkセッション Cookie であり、Chromium がディスクに書き込むことはありません。そこで、ウィンドウはデバッグポートを開いた通常の Chromium ですが、ログインが完了するまで何もアタッチされません。サーバーは /json/list 上のプレーン HTTP でタブをポーリングします(CDP ドメインが有効でないため、自動化の痕跡はありません)。OAuth ループがストアに戻ってきた瞬間にアタッチし、Cookie をメモリから読み取ります。

その後も更新は通常のナビゲーションです — Chromium がリダイレクトを追跡し、Cookie を自分で設定します:

GET moncompte.carrefour.fr/iam/oauth2/CarrefourConnect/authorize?client_id=…&redirect_uri=https://www.carrefour.fr/login/check
  └─302─► www.carrefour.fr/login/check?code=…   (the BFF exchanges the code)
      └─302─► www.carrefour.fr/                  (fresh session cookies)

エグゼキューターの仕組み

tools/*.json ──► loader (validation) ──► params (JSON Schema ➜ zod) ──► MCP tools/list
                                     └─► resolve ($param ➜ URL/query/headers/body)
                                              └─► http.service (cookies + rate limit + fetch)

tools/ 内のすべてのファイルは自己記述的です:

{
  "name": "add_item_to_cart",
  "parameters": { "type": "object", "properties": { … }, "required": [ … ] },
  "request": {
    "method": "PATCH",
    "url": "https://www.carrefour.fr/api/cart",
    "headers": { … },
    "query": {},
    "body": { "items": [ { "ean": { "$param": "ean" }, … } ] },
    "content_type": "application/json"
  },
  "requires_auth": true
}

エンジン(src/spec/):

  • headersquerybody 内の {"$param": "name"} ノードを再帰的に置換し、元の型(数値、ブール値、配列)を保持します;

  • 引数のないプレースホルダーを削除するため、オプションパラメータはリクエストから null として送信される代わりに消えます;

  • URL セグメント {basket_service_type}{store_id} などをエンコードして埋め込み、必須セグメントが欠けている場合は明確なメッセージで失敗します;

  • 配列を繰り返しクエリキーとしてシリアライズします(codes[]=14&codes[]=15);

  • content_type に応じてボディをエンコードします: JSON、x-www-form-urlencoded、または multipart/form-data(境界は fetch に任せます);

  • ジッター付きのスライディングレート制限とブラウザヘッダーを適用します。

エンドポイントの追加 = tools/ に新しい JSON ファイルを置くだけです。コードを書く必要はありません。

設定

.env.example を参照してください。主な変数:

変数

デフォルト

役割

CARREFOUR_COOKIES

セッション Cookie(ヘッダー、JSON マップ、または JSON 配列)

CARREFOUR_COOKIE_FILE

JSON Cookie エクスポートへのパス

CARREFOUR_DATA_DIR

~/.carrefour-drive-mcp(ソースからは data/)

以下に書き込まれるすべてのルート

CARREFOUR_SESSION_FILE

<data>/sessions/cookies.json

永続化された Cookie ジャー

CARREFOUR_BROWSER_PROFILE

<data>/browser-profile

永続的な Chromium プロファイル

CARREFOUR_KEEPALIVE_MINUTES

30

SSO キープアライブ期間;0 で無効

CARREFOUR_OAUTH_CLIENT_ID

carrefour_onecarrefour_web

リフレッシュに使用する OAuth2 クライアント

CARREFOUR_OAUTH_REDIRECT_URI

https://www.carrefour.fr/login/check

BFF コールバック

CARREFOUR_OAUTH_SCOPE

openid iam

要求されるスコープ

CARREFOUR_TOOLS_DIR

<project>/tools

JSON ツール定義ディレクトリ

CARREFOUR_MAX_RESPONSE_CHARS

60000

大きなレスポンスの切り詰め

REQUEST_TIMEOUT_MS

30000

HTTP タイムアウト

RATE_LIMIT_REQUESTS / RATE_LIMIT_WINDOW_MS

10 / 60000

レート制限ウィンドウ

MIN_DELAY_MS / MAX_DELAY_MS

100 / 500

リクエスト間のジッター

LOG_LEVEL, CARREFOUR_LOG_DIR

info, <data>

winston ログ(ファイル + stderr、決して stdout ではありません)

インストールの確認

ソースチェックアウトから:

npm run build     # tsc
npm test          # build + unit tests (node:test)
npm run smoke     # build + real MCP stdio handshake + tools/list
npm run verify    # all three

テストでは $param の置換、URL セグメント、クエリ文字列内の配列、3つのボディエンコーディング、Cookie ジャーの処理をカバーしています。スモークテストは実際にサーバーを起動し、JSON-RPC ハンドシェイクを実行してツールを一覧表示します。

carrefour.fr へのネットワーク呼び出しは自動テストされません — 実際のアカウントと有効な Cookie が必要です。

FAQ

API キーは必要ですか? いいえ。Carrefour には公開 API がありません。このサーバーは、ウェブサイトが使用するのと同じプライベートエンドポイントを、あなた自身のセッションで駆動します。

フランス国外でも動作しますか? カタログと店舗はフランス向けです(carrefour.fr)。Cloudflare は一部の IP からより厳格に動作する場合があります。

パスワードは保存されますか? いいえ。ブラウザウィンドウに入力するだけです。永続化されるのは Cookie のみで、~/.carrefour-drive-mcp/sessions/cookies.json0600 パーミッションで保存されます。このリポジトリには認証情報は一切含まれず、data/.env は gitignore されています。

実際の注文を発行できますか? はい — submit_checkout_payment は実際の支払いを請求します。そのように扱ってください。

エンドポイントを追加できますか? tools/ に JSON ファイルを置いてください。エグゼキューターの仕組み を参照してください。

サポートされているクライアントは? stdio 経由で MCP を話すものなら何でも: Claude Code、Claude Desktop、Cursor、Windsurf、VS Code / Copilot、Zed、Continue、MCP SDK を使用したカスタムエージェント。

免責事項

非公式プロジェクトであり、Carrefour とは提携、承認、支援の関係はありません。個人利用および教育目的で、ご自身のアカウントで使用してください。Carrefour の利用規約を尊重し、それに応じてレート制限を守ってください。

ライセンス

MIT © Maxime Allanic


キーワード: Carrefour MCP server · Carrefour Drive API · Model Context Protocol 食料品 · Claude Desktop MCP · Claude Code MCP server · Cursor MCP · フランスの食料品の買い物AIエージェント · オンラインショッピング · drive · 買い物リスト · Carrefour ロイヤルティ · MCP ショッピングカート自動化.

Install Server
A
license - permissive license
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    MCP server that connects Carrefour Drive to Claude and other MCP clients, enabling product search with real prices, nutriscore, availability, and natural language cart management.
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.

  • Shopping MCP for AI agents: search, compare, Amazon buy links. Auto-register.

  • Agent-native product catalog for AI shopping agents. 296M+ products, 28 countries.

View all MCP Connectors

Latest Blog Posts

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/maximeallanic/CarrefourDriveMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server