UK Supermarkets

io.github.jbeshir由 GitHub 帳號 jbeshir 發布v1.0.3更新於 Oct 30, 2026

Search and compare grocery prices across UK supermarkets with product details.

概覽

AI 產生的概覽

在九家英國超市之間搜尋與比較食品雜貨價格,並提供商品詳情、分類瀏覽與 Tesco 購物籃工具。

可以做什麼
  • 列出支援的超市及其狀態
  • 在一家或多加超市搜尋商品,並比較同一商品的價格
  • 查看商品詳情,例如價格、說明、成分與營養資訊
  • 瀏覽某家超市的商品分類
  • 登入 Tesco 後可讀取歷史訂單、查看購物籃、加入商品或調整數量、移除商品
適用情境
適合讓助理查核食品雜貨價格、比較同一商品在不同英國超市的售價,或在規劃採買時查詢成分與營養資訊。Tesco 購物籃與訂單歷史工具只有在你有在 Tesco 購物並啟用登入時才有意義。
執行需求
以本機程序執行(Go 二進位檔、預先建置的版本或 Docker 映像)。Tesco、Asda 與 Waitrose 以及任何登入都需要 Chrome、Chromium 或 Edge,可用 CHROME_EXEC_PATH 指定瀏覽器路徑。不登入瀏覽時不需要任何環境變數;登入需依超市設定 TESCO_LOGIN 等變數,SUPERMARKET_COOKIE_DIR 可覆寫 Cookie 儲存目錄。需要能連線至各超市網站。
安裝前請注意
登入會開啟可見的瀏覽器視窗供手動登入,並將工作階段 Cookie 快取到磁碟,應將該 Cookie 目錄視為敏感資料。購物籃工具會在真實的 Tesco 帳戶中新增、修改與移除商品。請求直接送往超市網站,可能遭限流或封鎖;工作階段經常過期,需要反覆登入。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 UK Supermarkets,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

supermarkets-uk-mcp

An MCP server for searching and comparing grocery prices across 9 UK supermarkets. It provides product search, price comparison, category browsing, and (for Tesco) order history and basket management. Each supermarket is implemented as a pluggable datasource behind a common interface, with the server fanning out concurrent requests across stores and aggregating the results.

Getting Started

Requirements

  • Go 1.27.3+ (to build from source)

  • Chrome, Chromium, or Microsoft Edge — required for Tesco, Asda, and Waitrose (headless browser rendering), and for login to any supermarket. Sainsbury's, Ocado, Morrisons, and the Shopify stores work without a browser.

    On Linux, avoid snap-packaged Chromium (Ubuntu's default chromium package). It is known to hang indefinitely — both on graceful CDP tab-close and on OS-level process reaping after a forced kill — when launched as a descendant of certain parent processes (observed running under Claude Desktop's Electron process tree). The hang was 100% reproducible under that setup and never reproduced with the same code against a non-snap Chrome/Chromium build. Install Google Chrome or a non-snap Chromium build instead, and point CHROME_EXEC_PATH at it if it isn't picked up automatically.

Installation

Pre-built binaries are available from Releases.

Install from source:

go install github.com/jbeshir/mcp-servers/supermarkets-uk/cmd/supermarkets-uk-mcp@latest

Or build from the repo root:

make build

A Dockerfile is also provided, based on chromedp/headless-shell so that browser-based stores work out of the box:

docker build -t supermarkets-uk-mcp ./supermarkets-uk

Configuration

No environment variables are required to get started — all supermarkets work without login.

VariableRequiredDescription
CHROME_EXEC_PATHNoPath to the Chrome/Chromium binary to launch. Leave unset to use automatic detection. See the note above about snap-packaged Chromium on Linux.

See Login below for the additional variables that enable interactive login.

Claude Desktop
json
{  "mcpServers": {    "supermarkets-uk": {      "command": "/path/to/supermarkets-uk-mcp"    }  }}
Claude Code
claude mcp add supermarkets-uk /path/to/supermarkets-uk-mcp

Tools

ToolDescription
list_supermarketsList all supported supermarkets with IDs and status
search_productsSearch for products across one or more supermarkets
compare_pricesCompare prices for a product across all supermarkets
get_product_detailsGet detailed product info (price, description, ingredients, nutrition)
browse_categoriesBrowse product categories for a supermarket
get_order_historyGet past order history (Tesco only, requires login)
get_basketGet current shopping basket contents (Tesco only, requires login)
add_to_basketAdd a product to the basket or update its quantity (Tesco only, requires login)
remove_from_basketRemove a product from the basket (Tesco only, requires login)

Supported Supermarkets

SupermarketIDData SourceBrowser Required
TescotescoHTML (headless browser)Yes
Sainsbury'ssainsburysJSON APINo
OcadoocadoServer-rendered HTML (OSP)No
MorrisonsmorrisonsServer-rendered HTML (OSP)No
AsdaasdaAlgolia API (search) + HTML (details)Yes
WaitrosewaitroseHTML (headless browser)Yes
HiYoUhiyouShopify predictive search APINo
Tuk Tuk MarttuktukmartShopify predictive search APINo
MorueatsmorueatsShopify predictive search APINo

Product Information Coverage

Not all supermarkets provide the same level of detail:

FieldTescoSainsbury'sOcadoMorrisonsAsdaWaitroseShopify stores
Name / Price / URLYesYesYesYesYesYesYes
Price per unitYesYesYesYesYesYes--
PromotionsYesYesYesYesYesYes--
DescriptionYesYesYesYesYesYesYes
IngredientsYesYesYesYesYesYes--
NutritionYesYesYesYesYesYes--
Dietary info--------Yes----
Weight------YesYesYesYes

Login

Login is optional and enables personalised results (e.g. local stock, delivery availability), order history, and basket management. It requires running the server locally with a browser available.

To enable login, set <SUPERMARKET>_LOGIN=true for each supermarket you want to log in to. On first use, a visible browser window opens for you to complete login manually. Session cookies are cached to disk and reused across restarts. If cookies expire, the server clears them and triggers a fresh login automatically.

Login requires Chrome, Chromium, or Edge for all supermarkets, including those that do not otherwise need a browser. Supermarket sessions tend to expire frequently, so expect to be prompted to log in again regularly.

VariableDescription
TESCO_LOGINEnable Tesco login
SAINSBURYS_LOGINEnable Sainsbury's login
OCADO_LOGINEnable Ocado login
MORRISONS_LOGINEnable Morrisons login
ASDA_LOGINEnable Asda login
WAITROSE_LOGINEnable Waitrose login
SUPERMARKET_COOKIE_DIROverride cookie storage directory (default: OS config dir)

Example with login enabled:

json
{  "mcpServers": {    "supermarkets-uk": {      "command": "/path/to/supermarkets-uk-mcp",      "env": {        "TESCO_LOGIN": "true",        "WAITROSE_LOGIN": "true",        "SUPERMARKET_COOKIE_DIR": "/home/you/.supermarket-cookies"      }    }  }}

Key Concepts

  • Datasource — A pluggable adapter for a single supermarket. Each datasource implements a common ProductSource interface (search, product details, category browsing) using whatever transport the supermarket requires: JSON API, server-rendered HTML scraping, or headless Chrome rendering.
  • AuthProductSource — An extension of ProductSource that supports session cookie injection and validation. Six of the nine supermarkets implement this interface, allowing logged-in features like personalised results. The three Shopify-based stores are plain ProductSource implementations with no auth support.
  • Client orchestrator — The client.Client type wires together all nine datasources. It manages concurrent fan-out for searches, lazy authentication with session expiry detection, and per-host rate limiting.
  • Auth resolver — A per-supermarket wrapper that handles lazy login. On first use of a login-enabled supermarket, it opens a visible browser window for the user to complete login manually. Session cookies are persisted to disk and reused. If a request returns ErrSessionExpired, the resolver clears the cookies and triggers a fresh login.
  • Shared browser — A single headless Chrome instance (via chromedp) shared across all browser-based datasources. Each request opens a new tab within the shared browser context so that cookies persist between navigations.
  • OSP (Ocado Smart Platform) — Ocado and Morrisons share a common server-rendered HTML structure. A single osp package implements both, parameterised by store-specific config.

Architecture

mermaid
graph TD    MCP["MCP Client<br/>(Claude Desktop, etc.)"]    SRV["MCP Server<br/>9 tools"]    ORCH["Client Orchestrator<br/>concurrent fan-out + auth"]
    MCP -->|"stdio JSON-RPC"| SRV    SRV --> ORCH
    subgraph "Datasource Adapters"        direction LR        BROWSER["Browser-based<br/>Tesco, Asda, Waitrose"]        HTML["HTML scraping<br/>Ocado, Morrisons"]        API["JSON API<br/>Sainsburys"]        SHOPIFY["Shopify API<br/>HiYoU, TukTukMart, Morueats"]    end
    ORCH --> BROWSER    ORCH --> HTML    ORCH --> API    ORCH --> SHOPIFY
    CHROME["Headless Chrome"]    BROWSER --> CHROME

External Dependencies

mermaid
graph LR    SM["supermarkets-uk-mcp"]
    SM -->|"Headless Chrome"| TESCO["tesco.com"]    SM -->|"Headless Chrome"| ASDA_BR["asda.com"]    SM -->|"Headless Chrome"| WAITROSE["waitrose.com"]    SM -->|"HTTP + HTML parsing"| OCADO["ocado.com"]    SM -->|"HTTP + HTML parsing"| MORR["groceries.morrisons.com"]    SM -->|"JSON API"| SAINS["sainsburys.co.uk"]    SM -->|"Shopify predictive search API"| SHOPIFY["hiyou.co / tuktukmart.co.uk / morueats.co.uk"]

Data Flow

A search_products call with multiple supermarkets triggers concurrent requests across all targeted stores. Individual store failures are captured per-result rather than failing the entire request.

mermaid
sequenceDiagram    participant Client as MCP Client    participant Server as MCP Server    participant Orch as Orchestrator    participant Auth as Auth Resolver    participant DS as Datasource Adapters    participant Ext as Supermarket Sites
    Client->>Server: search_products(query, stores)    Server->>Orch: SearchAll(query, stores)
    par One goroutine per store        Orch->>Auth: ensureAuth(tesco)        Note over Auth: Lazy login on first use        Auth-->>Orch: ready        Orch->>DS: Tesco.SearchProducts        DS->>Ext: Headless Chrome        Ext-->>DS: Rendered HTML    and        Orch->>DS: Sainsburys.SearchProducts        DS->>Ext: JSON API        Ext-->>DS: JSON response    and        Orch->>DS: Ocado.SearchProducts        DS->>Ext: HTTP GET        Ext-->>DS: Server-rendered HTML    end
    DS-->>Orch: Parsed products (per store)    Orch-->>Server: Combined results    Server-->>Client: Formatted tool response

When a logged-in request fails with ErrSessionExpired, the auth resolver clears the cached cookies, opens a browser window for re-login, and retries the request transparently.

來源:supermarkets-uk/README.md,提交 27dc1b2

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

2
  1. v1.0.3最新Oct 29, 2026
  2. v1.0.2Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分