Swissgroceries MCP
Real-time Swiss grocery shopping over the Model Context Protocol. Search products, compare prices across Migros, Coop, Aldi, Denner, Lidl, Farmy, Volgshop, and Otto's, see weekly promotions, and plan multi-store shopping trips. Works with any MCP-compatible client (Claude Desktop, Claude Code, Cursor, Cline, Continue, VS Code MCP extensions, custom clients).
Disclaimer
This is a personal fun project. It is not affiliated with, endorsed by, or sponsored by Migros, Coop, Aldi, Denner, Lidl, Farmy, Volg, Otto's, or any other retailer. It uses publicly accessible mobile-app endpoints to make Swiss grocery shopping a bit smarter for end users.
If you represent any of these stores and have concerns (about API usage, branding, scraping rate, or anything else), please reach out to the maintainer through GitHub and we will work it out. No need to escalate.
API stability: the chain APIs used here are unofficial and can change at any time. The maintainer is not responsible for failures caused by upstream changes; please open an issue with the response sample so the affected adapter can be updated.
PRs welcome. New chains, better matchers, smarter strategies, bug fixes, doc improvements; all encouraged. See CONTRIBUTING.md.
Install
No accounts, no tokens, no API keys required. The Denner adapter self-registers an anonymous client on first use; everything else uses public endpoints.
Claude Desktop (one-click)
Download swissgroceries-mcp.mcpb from the Releases page and:
macOS: double-click or drag onto the Claude Desktop app icon.
Windows: Settings → Extensions → Advanced → Install Extension → select the file.
Claude Code (one-liner)
claude mcp add swissgroceries -- npx -y @nicktcode/swissgroceries-mcpCursor / Cline / Continue / VS Code / Claude Desktop (manual config)
Most MCP-compatible clients accept the same JSON server entry. Add it to your client's MCP config file (paths vary, see your client's docs):
{
"mcpServers": {
"swissgroceries": {
"command": "npx",
"args": ["-y", "@nicktcode/swissgroceries-mcp"]
}
}
}Common config paths:
Claude Desktop:
~/Library/Application Support/Claude/claude_desktop_config.json(macOS),%APPDATA%\Claude\claude_desktop_config.json(Windows).Cursor:
.cursor/mcp.jsonin the project, or~/.cursor/mcp.jsonglobally.Cline / Continue / VS Code: see each client's MCP documentation.
Custom clients: any stdio-based MCP client can spawn
npx -y @nicktcode/swissgroceries-mcpdirectly.
Related MCP server: baumarkt-mcp
What you can ask
Price comparison
"Where is milk cheapest near 8001 Zürich right now?"
"Compare pasta prices across Migros and Coop."
"Show me organic milk options under CHF 3."
Shopping planning
"I need milk, bread, eggs, chicken, and pasta near 8050. Where should I shop to keep costs down?"
"Plan my weekly shop for 5 items near 4052 Basel, one stop only."
"Split my cart across stores for the absolute lowest total, but add a 2 CHF penalty per extra trip."
Promotions and deals
"What is on sale at Aldi this week?"
"Any Migros deals on cheese ending this week?"
"Show me all promotions across chains for pasta."
Stores and stock
"Find Coop stores within 3 km of Bern Hauptbahnhof."
"Which Migros near me has product 4389992 in stock?"
"List Denner branches near 8050."
Tools
Tool | What it does |
| Find grocery stores near a location, filtered by chain and radius. |
| Cross-chain product search with normalised price, unit price, size, and tags. |
| Full product details for a chain plus product ID pair. |
| Current promotional deals, filterable by chain, keyword, store, or expiry. |
| Stores of a chain that have a given product in stock. |
| Plan a multi-store trip for a shopping list near a location. |
| Probe each registered chain adapter and report status, latency, and capabilities. |
Each tool exposes rich JSON Schema with field-level descriptions, so the LLM knows when and how to call it.
Prompts
Prompt | What it does |
| Summarise this week's best grocery deals across the configured chains. Optional category, chains, and location filters. |
| Compare a shopping basket across all chains and recommend single-store vs split-cart strategies. |
| From an ingredient list (or recipe URL) find the cheapest place to buy each item and produce a consolidated shopping plan. |
Prompts are surfaced as one-click templates in MCP-aware clients (Claude Desktop, Cursor, Cline). They produce structured user messages that drive the right tool calls — useful as a starting point and as discovery of what the server can do.
Resources
URI | Content |
| JSON list of registered chain adapters and their capabilities ( |
Chain coverage
Chain | Product search | Promotions | Per-store stock | Auth |
Migros | Full catalog | Yes | Yes | Guest token (auto, rotated on expiry) |
Coop | Full catalog (coopathome) | Yes | Yes (geo) | None |
Aldi | Full catalog | Yes | No | None |
Denner | Full catalog | Yes | No | Anonymous self-auth (signup + signin, rotated) |
Lidl | Weekly leaflet only | Yes | No | None |
Farmy | Full catalog (organic delivery) | Yes (strikeout-price filter) | No (delivery-only) | None |
Volgshop | Full catalog | Yes ( | No (delivery-only) | None |
Otto's | Grocery-adjacent (food, drugstore, baby) | Yes (priceLabels facet) | Yes (per-store stockLevel) | None |
Configuration
Env var | Default | Effect |
| (unset) | Optional pre-supplied Denner Bearer JWT. Without it, the adapter self-registers anonymously on first use and rotates the token automatically. |
|
| Default Lidl store ID used when no |
| (default iOS Safari UA) | Override the User-Agent for Coop calls if DataDome ever blocks the default. |
|
|
|
| (unset) | Set to |
How it works
Each grocery chain is wrapped in an independent adapter (src/adapters/<chain>/) that handles authentication, HTTP calls, and raw-to-normalised mapping. Adapters all produce the same NormalizedProduct, NormalizedStore, and NormalizedPromotion shapes (defined in src/adapters/types.ts), so the rest of the system never has to know which chain it is talking to.
The HTTP utility (src/util/http.ts) underpins every adapter except Migros (which delegates to the migros-api-wrapper library): in-memory response caching with a 5-minute TTL, retry with exponential backoff (3 attempts, 250 ms base), per-host rate limiting (~10 requests per second), and a per-host circuit breaker that opens after 5 consecutive failures and resets after 60 seconds.
The shopping planner (src/services/planner.ts) fans out store and product searches in parallel across all active adapters, then feeds results into a strategy solver (src/services/strategy.ts) that supports three modes:
single_store: minimise the number of stops.split_cart: cheapest split across chains, with a configurable per-stop penalty.absolute_cheapest: cheapest split, ignoring stop count.
Cross-chain comparisons are kept fair by a category-text canonicality filter (src/services/matcher.ts, isCanonical). When at least one chain returns a product whose category text matches the query, results from chains that only returned tangential products (for example, Apfelschorle when searching for "apfel") are dropped from the comparison matrix for that item.
MCP client (any LLM)
│
│ MCP tool call
▼
src/index.ts ── buildRegistry() ────────────────────────────────────────┐
│ │
│ routes to tool handler │
▼ ▼
src/tools/ src/adapters/
find_stores.ts ──► geocoding ──► adapter.searchStores migros/
search_products.ts ──────────────► adapter.searchProducts coop/
get_product.ts ──────────────► adapter.getProduct aldi/
get_promotions.ts ──────────────► adapter.getPromotions denner/ (auto-auth)
find_stock.ts ──────────────► adapter.findStoresWithStock lidl/
plan_shopping.ts ──► geocoding ──► planner ──► strategy solver
│
NormalizedProduct
NormalizedStore
NormalizedPromotionBuild from source
node --version # requires Node.js >=20
git clone https://github.com/nicktcode/swissgroceries-mcp
cd swissgroceries-mcp
npm install
npm run buildTo also build the .mcpb bundle locally:
npx tsx scripts/build-mcpb.tsTroubleshooting
Coop "DataDome challenge" error
You hit Coop's bot protection. Set SWISSGROCERIES_USER_AGENT_COOP to a freshly captured iOS Safari User-Agent string and try again.
Denner "auth_expired" error
Rare, since the adapter rotates its token automatically. If it persists, unset any custom DENNER_JWT and let the adapter re-bootstrap from scratch.
Lidl returns 0 results
Lidl only indexes products from the current weekly campaign leaflet. If your search term is not in this week's campaigns, you will get 0 results. This is expected.
ZIP unknown error
The static lookup table covers all 3,190 official Swiss postcodes. If yours is missing, pass { lat, lng } directly or open an issue with the missing PLZ.
Migros stores nowhere near my location
The Migros store-search API caps at ~10 results per query. The adapter passes a city hint derived from your ZIP. If you call the adapter directly without ZIP-based geocoding, pass cityHint explicitly.
Development
npm test # full test suite, no network calls
RUN_LIVE=1 npm test # also runs live smoke tests against real chain APIs
npm run dev # tsx watcher for local iteration
SWISSGROCERIES_DISABLE_CACHE=1 RUN_LIVE=1 npm test # cache off, useful for debugging
SWISSGROCERIES_LOG_LEVEL=debug npm run dev # verbose loggingThe test suite uses Vitest. Fixture JSON files live under tests/fixtures/<chain>/. Capture scripts in scripts/ show how to refresh them.
Adding a new chain
See CONTRIBUTING.md for the full guide. Quick version:
Capture API responses with Charles Proxy or mitmproxy on the chain's iOS or Android app.
Create
src/adapters/<chain>/{client,tags,normalize,index}.tsfollowing the existing patterns. Usesrc/adapters/aldi/as the simplest reference.Map raw responses to
NormalizedProduct,NormalizedStore, andNormalizedPromotion.Declare capability flags accurately.
Register the adapter in
src/index.ts'sbuildRegistry().Add fixture-based tests under
tests/adapters/.
License
Dual-licensed:
Open-source use: AGPL-3.0-only. If you run a modified version of this software as a network service, you must publish your modifications.
Commercial use: if AGPL-3.0 is incompatible with your project (e.g. a closed-source SaaS or proprietary app), a commercial license is available — see LICENSING.md or contact
nick@thommen.it.
Versions ≤ 0.7.4 were released under MIT and remain MIT-licensed in their existing published form. Starting with 0.7.5 the license is AGPL-3.0-only.
Available Tools
7 toolsfind_stockA
Check which stores of a given chain have a specific product in stock. Optionally filter by proximity to GPS coordinates or query a single store by ID. Not all chains support per-store stock queries; unsupported chains return a clear error. Use for "is this product available near Zurich HB?", "which Coop has item X in stock?".
Inputs: chain (required), productId (required), near, storeId.
find_storesA
Find grocery stores near a location, filtered by chain and search radius. Accepts a Swiss ZIP code, GPS coordinates, or a free-text address as the search center. Returns store name, address, chain, location, and opening hours where available. Use for "find a Migros near me", "which Coop branches are in 8001?", or before checking stock.
Inputs: near (required), chains, radiusKm.
get_productA
Fetch full product details for a specific chain + product ID pair. Returns { product, fetchedAt, fromCache }: the product carries price, brand, size, unit price, tags, category, image URL, and active promotions, while fetchedAt + fromCache report how fresh the data is. Obtain product IDs from search_products. Useful for drilling into a search result. Use for "get details for this Migros product" or "what is the unit price of this item?".
Inputs: id (required), chain (required).
get_promotionsA
List current promotional deals across configured Swiss grocery chains. Filter by chain, keyword, store ID, or how many days until the promotion expires. Returns promotion name, discount, validity dates, and applicable stores. Use for "what is on sale this week?", "any Migros deals on cheese?", or "promotions ending today".
Inputs: query, chains, storeIds, endingWithinDays.
health_checkA
Probe each registered chain adapter with a trivial query and report status, latency, and capability flags. Use this when a chain seems missing from results or when debugging adapter problems.
Inputs: chains, timeoutMs.
plan_shoppingA
Plan a multi-store shopping trip near a location, picking the best products across configured Swiss grocery chains. Items can be generic ("milch", "pasta") or pinned to a specific SKU. Returns a primary plan plus alternatives. Use when the user gives a list of items and asks "where should I shop?" or "what's cheapest?". Strategies: single_store (one chain), split_cart (multi-chain with stop penalty), absolute_cheapest (no penalty).
Inputs: near (required), items (required), strategy (required), chains, +2 more.
search_productsA
Search for products across configured Swiss grocery chains (Migros, Coop, Aldi, Denner, Lidl, Volgshop, Otto's, Coop City) by keyword. The coop chain covers the coop.ch supermarket assortment (groceries, household, drugstore) only. The Coop City department-store range (coop-city.ch: cosmetics, fashion, household, electronics) is the separate coopcity chain, which is opt-in: include it in chains to search it (it is skipped when chains is omitted). Supports optional filters for price, size range, and product tags (organic, vegan, budget, etc.). Returns results grouped by chain with normalised price, unit price, size, and promotion info. A sources map reports each chain's data freshness (fetchedAt timestamp + fromCache flag) so you can tell the user how current the prices are. Every queried chain has a key in byChain; when a chain fails (e.g. bot protection or an outage) its array is empty and errors lists the chain with a code and reason, so check errors before telling the user a chain has no results. Use for "find organic milk under 2 CHF", "compare pasta prices", or "search for gluten-free bread".
Inputs: query (required), limit, chains, offset, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool targets a clearly distinct user intent: store discovery, product search, product detail, promotions, per-store stock, adapter health, and trip planning. The only mild overlap is that search_products includes promotion info while get_promotions is dedicated to deals, but the tool descriptions make the boundary clear.
All names use clear snake_case and are readable, with paired patterns like find_stores/find_stock and get_product/get_promotions. However, verbs vary across find, search, get, plan, and health_check does not follow a verb_noun pattern, so it is mostly rather than fully consistent.
Seven tools is well-scoped for a Swiss grocery comparison and planning server. Each tool has a distinct role and none feels redundant or excessive.
The surface covers the full read-only shopping workflow: finding stores, searching and inspecting products, discovering promotions, checking stock, diagnosing chain issues, and planning multi-store trips. No obvious lifecycle gap exists for the stated grocery-assistant purpose.
Maintenance
Related MCP Connectors
Unlock the power of food transparency with our Open Food Facts MCP server. Easily look up any food
Live prices, deals & optimal multi-stop shopping routes for German grocery & drug stores.
Hosted MCP for e-commerce: live product catalog, stock, and pricing for AI agents.
Shopping infrastructure for AI agents: product search, category price overviews, price checks and seller vetting across US online retail, as structured facts over MCP.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceMCP server for Dutch supermarkets and drugstores, enabling product search, price comparison, promotions, shopping lists, meal planning, price alerts, and budget tracking via natural language.MIT
- AlicenseNot gradedqualityBmaintenanceMCP server that lets an LLM search and compare prices across four German hardware-store retailers (Hornbach, BAUHAUS, Globus, OBI), with store pickup availability for local branches.MIT
- AlicenseNot gradedqualityBmaintenanceAn MCP server that provides a queryable, agent-native layer over Israeli supermarket price transparency feeds, enabling Hebrew product search, online delivery optimization, and cross-chain price comparison.1Apache 2.0
- AlicenseAqualityBmaintenanceEnables natural-language search of Swiss grocery products, price comparison, and weekly promotion lookup across retailers including Migros, Coop, Aldi, Denner, Lidl, Farmy, Volgshop, and Otto's.7MIT