Skip to main content
Glama
walmart-ca-mcp
by anaqi

walmart-ca-mcp

An MCP server for Walmart.ca (Canada). It lets an AI assistant search products and read product details through a real Chrome browser with a persistent profile.

Unofficial. Not affiliated with or endorsed by Walmart. It drives the public website the way a browser does; use it for personal, low-volume use and respect Walmart.ca's terms.

Tools

Tool

What it does

search_products

Search Walmart.ca. Returns id, name, brand, price and was-price (CAD), stock, rating, seller (Walmart or marketplace), badges, delivery estimate, URL and image. Sponsored listings are excluded unless includeSponsored is true. Supports page and limit.

get_product_details

One product by id or walmart.ca URL: price, stock, seller, category, highlights, description, specifications, variants and images.

get_my_items

The account's My Items (previously bought products, up to 300): current price, unit price, stock and how often bought ("Bought 5+ times"). Filter by category (case-insensitive; the list comes back in categories), name search, inStockOnly; page with limit/offset. Reorder by passing an id to add_to_cart.

get_orders

Purchase history, newest first: order id, date, total, item count, and per delivery/pickup group the status and item names with quantities. Filters: last-3-months, last-6-months, year-0 (this year), year-1, ..., returned, in-store (valid ids come back in filters); item-name search; limit up to 100 (pages through the site's 5-per-page history).

get_order_details

One order: each item with product id, quantity, price and what happened to it (Received, Received with weight-adjusted price, Substitute received, Refunded, Unavailable and not charged), a per-shipment summary ("7 items received", "1 unavailable item"), plus subtotal, savings, fees, tax, tip and total. Payment and address details are left out.

track_order

Live status of an order: status message, step tracker (Placed / Preparing / On the way / Delivered), window, delay flags, the live header Walmart shows while a driver is on the way, carrier tracking for shipped items, and whether the slot can still be changed or the order cancelled. Without orderId it tracks every order not yet delivered among the 10 most recent.

get_cart

Items in the signed-in cart: id, name, quantity, price, line total, seller, plus item count, subtotal and fees, and the current pickup/delivery mode, store and reserved time slot. Saved-for-later items are not included.

add_to_cart

Add a product (by id or URL) to the cart, quantity 1-12, added to any quantity already there. Returns the cart line and new subtotal.

set_cart_quantity

Set an item already in the cart to an exact quantity (0-12; 0 removes it), using the cart's own - / + buttons.

remove_from_cart

Remove a product (all units) from the cart. Saved-for-later items are never touched.

get_flyer

Current flyer items for the profile's store (main weekly flyer by default; Private Brands, Holiday Gifting, ... via flyer): name, brand, flyer price ("$2.44", "$3.97/lb", "From $9.97"), regular price, deal (e.g. Rollback), category, details, valid-to date. id is the Walmart product id, so items go straight into add_to_cart. Filter by search words or category. Cached for an hour.

get_my_deals

Which of My Items are in any current flyer. onSale: exact matches by product id (flyer price, regular price, deal, how often bought), most-bought first. possibleMatches: flyer items that look like one of your items (same brand and product word, e.g. "Sealtest 5% or 10% cream"), to check.

get_delivery_slots

Pickup or delivery time slots: window, price (Walmart+ prices as $0 with the regular price), kind (scheduled, or express / "now" options when offered, usually same day) and slotId; plus the current mode and reservation. Filter with date (YYYY-MM-DD, today, tomorrow), earliest / latest ("10am", "14:00"); without a date, days (default 3) from the first bookable day. Viewing the other mode does not change the cart.

reserve_slot

Reserve a slot by slotId (pass mode if it was listed under the other method; that also switches the cart). Walmart holds it until heldUntil.

set_fulfillment_mode

Switch the cart between pickup and delivery.

session_status

Whether the site is reachable, whether the bot check is blocking, whether the profile is signed in, and which store prices are shown for. Returns no account details.

get_my_items, the order tools and the cart tools need a signed-in profile (see Signing in). There is no checkout or order tool: the server can fill a cart, but placing the order stays with you. Other tools are read-only. Prices depend on the store / postal code selected in the profile (store in each result).

Related MCP server: mcp-walmart

Why a real browser, and why rebrowser

Walmart.ca is protected by HUMAN (PerimeterX) bot detection, which answers suspicious traffic with a "Press & Hold" page. In testing:

  • Stock puppeteer loaded the home page, then got "Press & Hold" on the first search, with a new or a used profile.

  • rebrowser-puppeteer-core, with the same browser and network, completed 40 back-to-back searches without a challenge. It removes the Chrome DevTools Protocol Runtime.enable leak that bot checks use to spot automation.

The server also:

  • runs Chrome headed (on a virtual display in Docker), since headless Chrome is easier to flag;

  • keeps one browser on a persistent profile, so cookies, including the bot check's own, carry over between calls;

  • uses a pinned Chrome build and no fake user agent, so the browser identity stays consistent;

  • closes Chrome after 10 idle minutes (~500 MB freed) and relaunches it on the next call.

If a challenge does appear, tools return a clear error instead of empty results. Open the profile in a visible browser (see Signing in), complete the check once and retry.

docker build -t walmart-ca-mcp .
docker volume create walmart-profile

stdio (for MCP clients that start the server themselves):

{
  "mcpServers": {
    "walmart-ca": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "--shm-size=512m", "-v", "walmart-profile:/profile", "walmart-ca-mcp"]
    }
  }
}

HTTP (streamable HTTP at /mcp, SSE at /sse, via mcp-proxy):

docker run -d --name walmart-ca-mcp --init --shm-size=512m -p 127.0.0.1:3000:3000 \
  -v walmart-profile:/profile walmart-ca-mcp http

There is no authentication on the HTTP endpoint. Keep it on localhost or put it behind your own auth.

Quick check without an MCP client: docker run --rm --shm-size=512m -v walmart-profile:/profile walmart-ca-mcp smoke "coffee"

Run with Node

Needs Node 20+ and Chrome or Chromium.

npm install
npm run build
CHROME_PATH="/path/to/chrome" node build/index.js     # stdio MCP server
npm run smoke -- "coffee"                             # quick live check

On a machine without a display, run it under xvfb-run, or set HEADLESS=true (more likely to be challenged).

Signing in (optional)

Search and product details work without an account. The cart tools need one, and signing in can also lower the chance of challenges.

Stop the server first (Chrome locks the profile), then:

docker run --rm --shm-size=512m -p 127.0.0.1:6080:6080 -v walmart-profile:/profile walmart-ca-mcp login

Open http://localhost:6080/vnc.html, sign in, and complete any "Press & Hold" yourself. The container exits when the account menu shows you are signed in, and the session stays in the profile. Without Docker: npm run login.

Configuration

Variable

Default

Purpose

WALMART_PROFILE_DIR

./profile (/profile in Docker)

Chrome profile. Holds the session: keep it private.

CHROME_PATH

auto-detect (/usr/local/bin/chrome in Docker)

Chrome binary. Use one build for the profile.

HEADLESS

false

Headless Chrome. Not recommended.

BROWSER_IDLE_CLOSE_MS

600000

Close Chrome after this long without calls. 0 keeps it open.

WALMART_LANG

en

en or fr.

WALMART_NAV_TIMEOUT_MS

45000

Page load timeout.

WALMART_DEBUG_DIR

unset

Save a screenshot and HTML of failed pages here (they can include account details), and the raw slot data of each get_delivery_slots call (customer details removed, newest 20 kept).

LOGIN_TIMEOUT_MS

1800000

How long login waits for you to sign in.

How it works

Purchase history: the orders page makes its own history request; further pages and filters repeat that request from inside the page with a new cursor or filter, the same way the site's "Next page" does.

The flyer is Walmart's embedded Flipp flyer: the flyer page lists the store's current flyers, and items come from the same flyer service with the public token the page uses (cached for an hour, so repeat searches skip the browser).

Time slots come from the cart's "Reserve a time" panel; reserving clicks the slot and the panel's Reserve button. The cart must have items for pickup/delivery options to show.

Cart changes click the site's own buttons ("Add to cart", "Increase quantity", "Remove") and wait for the cart update Walmart.ca sends in response, then re-read the cart to confirm. The cart itself is read from the data the cart page loads, so results are the same as what you see on walmart.ca.

Product data comes from the JSON that Walmart.ca embeds in each page (__NEXT_DATA__), not from scraping the layout, so small visual changes do not break it. Each tool call opens a tab in the shared browser, reads the page and closes the tab.

src/
  index.ts     MCP server and tool definitions
  walmart.ts   search, product details and session status
  browser.ts   shared persistent Chrome, idle close, bot-check detection
  config.ts    environment settings
  login.ts     visible sign-in helper
  smoke.ts     command-line live check

Limitations

  • A browser per server: about 500 MB of RAM while active, and a few seconds on the first call after an idle close.

  • Walmart.ca can change its pages or bot checks at any time. A layout change shows up as a "page layout may have changed" error.

  • Keep the request rate low. Bursts are what bot checks look for.

License

MIT

Available Tools

16 tools
add_to_cartAdd to Walmart.ca cartA

Add a product to the signed-in Walmart.ca cart (adds to any quantity already there). Does not check out or place an order. Returns the cart line and the new subtotal. Needs a signed-in profile.

Inputs: product (required), quantity.

get_cartWalmart.ca cartA
Read-only

List the items in the signed-in Walmart.ca cart: product id, name, quantity, price, line total and seller, plus item count, subtotal and fees. Saved-for-later items are not included. Needs a signed-in profile.

Inputs: no named parameters.

get_delivery_slotsWalmart.ca pickup / delivery time slotsA
Read-only

Time slots for the signed-in cart (Walmart lists 7 days; default returns 3 from the first bookable day): per day, each slot window, price (Walmart+ prices shown as $0 with the regular price), kind (scheduled, or express/"now" options when Walmart offers them, usually same day) and slotId. Also the cart's current mode, store and reserved slot. mode picks pickup or delivery slots (default: the cart's current mode; viewing does not change the cart). The cart must have items.

Inputs: date, days, mode, latest, +2 more.

get_flyerWalmart.ca weekly flyerA
Read-only

Items in the current Walmart.ca flyers for the profile's store: name, brand, flyer price (e.g. "$2.44", "$3.97/lb", "From $9.97"), regular price, deal (e.g. Rollback), category, details and valid-to date. "id" is the Walmart product id (works with add_to_cart / get_product_details). Defaults to the main weekly flyer; others (Private Brands, Holiday Gifting, ...) are listed in "flyers". Filter by words in the name/description or by category (as listed in "categories"). Cached for an hour.

Inputs: flyer, limit, offset, search, +1 more.

get_my_dealsMy usual Walmart.ca items on saleA
Read-only

Cross-check My Items (products the account has bought before) against every current flyer for the store. "onSale": exact matches by product id, with flyer price, regular price, deal and how often bought. "possibleMatches": flyer items that look like a usual item by brand and name (flyer items often cover several products, e.g. "Sealtest 5% or 10% cream") - worth checking. Use add_to_cart with myItem.id to buy.

Inputs: includePossible.

get_my_itemsWalmart.ca My ItemsA
Read-only

Products the signed-in account has bought before (Walmart.ca "My Items" / reorder page): current price, unit price, stock and how often bought (e.g. "Bought 5+ times"). Filter by category (as listed in "categories"), by words in the name, or to in-stock items. Use add_to_cart with an item id to reorder.

Inputs: limit, offset, search, category, +1 more.

get_order_detailsWalmart.ca order detailsA
Read-only

One Walmart.ca order: each item with product id, quantity, price and what happened to it: Received, Received (price adjusted to actual weight), Substitute received, Refunded (no need to return), Unavailable (not charged; "charged": false). Walmart does not say which ordered item a substitute replaced. Also a per-shipment summary ("7 items received", "1 unavailable item") and subtotal, savings, fees, tax, tip and total. Payment and address details are not returned.

Inputs: orderId (required).

get_ordersWalmart.ca purchase historyA
Read-only

Recent Walmart.ca orders for the signed-in account, newest first: order id, date, total, item count, and per delivery/pickup group the status and item names with quantities. Filter by date ("last-3-months", "last-6-months", "year-0" = this year, "year-1" = last year, ...), "returned", or in-store purchases; the valid ids come back in "filters". Item lists here are as ordered; use get_order_details for what was actually received (unavailable / substituted items), item prices and the order breakdown.

Inputs: limit, filter, search.

get_product_detailsWalmart.ca product detailsA
Read-only

Full details for one Walmart.ca product: price, stock, seller, specifications, description, variants and images. Accepts a product id from search_products or a walmart.ca product URL.

Inputs: product (required).

remove_from_cartRemove from Walmart.ca cartB
DestructiveIdempotent

Remove a product (all units) from the signed-in Walmart.ca cart. Saved-for-later items are not touched.

Inputs: product (required).

reserve_slotReserve a Walmart.ca time slotA
Idempotent

Reserve a pickup or delivery time slot for the cart (slotId from get_delivery_slots; pass the same mode). Reserving a slot of the other method also switches the cart to it. Walmart holds a reservation for a limited time (heldUntil); it does not place an order.

Inputs: slotId (required), mode.

search_productsSearch Walmart.caA
Read-only

Search products on Walmart.ca. Returns name, price (CAD), stock, rating, seller (Walmart or marketplace), delivery estimate and product id. Prices are for the store shown in "store". Sponsored results are left out unless asked for.

Inputs: query (required), page, limit, includeSponsored.

session_statusWalmart.ca session statusA
Read-only

Check that Walmart.ca is reachable, whether the bot check is blocking requests, whether the browser profile is signed in, and which store prices are shown for. Returns no account details.

Inputs: no named parameters.

set_cart_quantitySet quantity in Walmart.ca cartA
DestructiveIdempotent

Set an item already in the signed-in cart to an exact quantity (0 removes it). Use add_to_cart for items not yet in the cart. Returns the new line total and cart subtotal.

Inputs: product (required), quantity (required).

set_fulfillment_modeSwitch Walmart.ca cart to pickup or deliveryA
Idempotent

Switch the signed-in cart between pickup and delivery (without choosing a time). The cart must have items.

Inputs: mode (required).

track_orderTrack a Walmart.ca orderA
Read-only

Live status of an order: status message (e.g. "Arriving by 3:40pm"), step tracker (Placed / Preparing / On the way / Delivered), delivery or pickup window, delay flags, driver/live header when Walmart shows one, carrier tracking for shipped items, and whether the slot can still be changed or the order cancelled. Without orderId, checks the 10 most recent orders and tracks any not yet delivered.

Inputs: orderId.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 16 tools

    Disambiguation5/5

    Each tool targets a distinct resource+action pair, and the descriptions actively draw the boundaries (get_orders = ordered items, get_order_details = what was actually received, track_order = live shipment status; get_flyer = browse current flyers, get_my_deals = cross-reference against purchase history). Cart tools are cleanly split into read/add/set-quantity/remove with explicit cross-references. No two tools appear to do the same thing.

    Naming Consistency4/5

    Nearly everything follows a snake_case verb_noun pattern (search_products, get_cart, add_to_cart, set_cart_quantity, remove_from_cart, reserve_slot, track_order). The only deviation is session_status, which drops the verb, and get_my_items / get_my_deals use possessive phrasing, but the overall convention is highly predictable.

    Tool Count4/5

    16 tools is at the upper end of the comfortable band, but each one maps to a real step in the shopping lifecycle (discover, inspect, cart, fulfillment, order history). Nothing looks redundant or padded, though it sits just past the typically-scoped 3-15 range.

    Completeness3/5

    Search, product, cart CRUD, flyer/deals, delivery slots and order history/tracking are all well covered, so the browse-to-cart-to-slot flow is complete. However, there is no checkout/place-order tool (the descriptions explicitly stop at the cart), no order cancellation despite track_order reporting eligibility, and no way to change the store used for pricing — real dead ends for the assistant's stated workflow.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants to search the catalog, manage a cart and usual orders, find delivery slots, and handle favorites, shopping lists, past orders, and item remarks through the store's API, with login and payment left to the user on the website.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants to drive a visible Chrome session to search products, apply filters and sorting, and extract listings, product details, variants, stock, reviews, and AI-generated summaries. It also supports price tracking, cart previews, favorites, and wardrobe-aware personalized shopping recommendations.
      MIT