sainsburys-mcp
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., "@sainsburys-mcpAdd milk, eggs, and bread to my basket"
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.
sainsburys-cli
Build a Sainsbury's Groceries basket from a plain-text shopping list, from the command line.
It talks directly to Sainsbury's internal Groceries API and authenticates by borrowing the session from a browser you're already logged in to — so there's no password to store and no browser being driven around. It never places an order; it only fills the basket, ready for you to review and check out yourself.
⚠️ This uses an undocumented, unofficial API. It can break if Sainsbury's changes their site, and it's for personal use with your own account only.
Install
cd ~/code/sainsburys_cli
python3 -m venv .venv
.venv/bin/pip install -e .This gives you a sainsburys command (at .venv/bin/sainsburys).
Related MCP server: Willys MCP Server
First-time setup: log in
Open your normal browser and log in at https://www.sainsburys.co.uk.
Leave that session logged in.
Check it works:
.venv/bin/sainsburys whoamiYou should see your name/email. The CLI reads the Sainsbury's cookies from your browser automatically. If you have several browsers, point it at one:
.venv/bin/sainsburys --browser firefox whoami
When your session later expires, just reload sainsburys.co.uk in the browser and
run any command with --refresh.
Build a basket from a list
Write a shopping list, one item per line:
# weekly shop
2 x semi skimmed milk
free range eggs x2
wholemeal bread
600g chicken breast
bananasQuantities can go at the start (2 x milk, 3 bananas) or end (milk x2).
Blank lines and # comments are ignored.
Preview first (nothing is added):
.venv/bin/sainsburys add-list shopping.txtYou'll get a per-line report: ✓ confident matches, ? low-confidence or
out-of-stock (with alternatives shown), and ✗ no-match. When it looks right,
commit:
.venv/bin/sainsburys add-list shopping.txt --commitOnly confident, in-stock matches are added; anything flagged for review is left
for you to add manually (e.g. with search + add). Then open the basket on
the website to review and check out.
Other commands
.venv/bin/sainsburys search "oat milk" # find products + their ids
.venv/bin/sainsburys add 7977681 --qty 2 # add one product by id
.venv/bin/sainsburys basket # show the current basket (with item ids)
.venv/bin/sainsburys remove "oat milk" # remove an item by name (or [item ...] id)remove matches on the product name; if more than one basket item matches
equally (e.g. remove "milk" with two milks) it lists them and does nothing, so
you can re-run with the specific [item ...] id or --all.
Add --json to any command for machine-readable output (handy when Claude is
driving it).
Using it with Claude Desktop
Claude Desktop drives this through a bundled MCP server (sainsburys-mcp) so
your partner can just chat — "add milk, eggs and bread to my Sainsbury's basket"
— with no terminal. See docs/CLAUDE_DESKTOP.md for
the one-time setup. (In Claude Code, use the CLI directly as below.)
Using it with Claude (CLI)
You don't have to pre-format anything. Paste a messy list into Claude — prose,
a copied spreadsheet, mixed units ("6 pints semi-skimmed, a dozen eggs, loaf of
wholemeal") — and ask it to build the basket. Claude interprets the list itself,
then uses search --json to find each product and add to put it in the
basket, stopping to ask you whenever an item is ambiguous (which size? which
brand? the usual one's out of stock — swap it?). It confirms the basket at the
end; you review and check out on the website. See CLAUDE.md for the exact
protocol Claude follows.
If reading browser cookies doesn't work
Some locked-down work machines (or Chrome on recent Windows) block reading the
cookie store. Fallback: copy the request cookies from your browser's dev tools
(Network tab → any groceries-api request → Cookie header, and the
wcauthtoken request header) and set them as env vars:
set -x SAINSBURYS_COOKIE "WC_AUTHENTICATION_123=...; JSESSIONID=..."
set -x SAINSBURYS_WCAUTHTOKEN "..."Running the tests
.venv/bin/pip install pytest
.venv/bin/python -m pytestThe tests cover the list-parsing and product-matching logic (which run offline); the API calls themselves need a live logged-in session to exercise.
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.
Related MCP Servers
- Flicense-qualityBmaintenanceAn MCP server for programmatically interacting with the Oda grocery shopping platform. It enables users to search for products, browse results, and manage their shopping cart contents through natural language.Last updated12
- Alicense-qualityDmaintenanceAn MCP server for Sweden's largest grocery chain Willys. Enables controlling your shopping cart, browsing orders, searching products, and getting AI-powered recommendations from any MCP client.Last updated4MIT
- Flicense-qualityAmaintenanceMCP server that integrates with AnyList for managing shopping lists, recipes, and meal planning via natural language.Last updated19
- Flicense-qualityAmaintenanceMCP server for the Bring! shopping list API, enabling management of shopping lists via natural language.Last updated
Related MCP Connectors
MCP server for generating rough-draft project plans from natural-language prompts.
A paid remote MCP for CLI tool MCP, built to return verdicts, receipts, usage logs, and audit-ready
Hosted MCP server exposing US hospital procedure cost data to AI assistants
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/henryjcee/sainsburys-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server