Swissgroceries Mcp

io.github.nicktcode由 GitHub 账号 nicktcode 发布v0.1.2更新于 Oct 24, 2026

Swiss grocery search, promotions, and shopping plans across Migros, Coop, Aldi, Denner, Lidl.

已验证STDIO仅桌面位置与生活商业与电商

概览

AI 生成的概览

一个本地 MCP 服务器,让助手搜索瑞士超市商品、跨连锁比价与查看促销,并规划多店购物行程。

可以做什么
跨 Migros、Coop、Aldi、Denner、Lidl、Farmy、Volgshop 和 Otto's 搜索商品,提供规范化价格、单价和营养信息,并按连锁与商品 ID 获取完整商品详情。按连锁和半径查找附近门店,并查询某连锁哪些门店有指定商品库存。列出当前促销,可按连锁、关键词、门店或到期时间筛选。用单店、拆分购物车或绝对最低价策略为购物清单规划行程,可设置每多一站的成本惩罚。对每个连锁适配器做健康检查,并读取已注册连锁及其能力列表。
适用场景
适合在瑞士购物时,让助手比较食品杂货价格、查找本周优惠、定位附近门店,或为一份购物清单算出最省钱的买法,包括跨店拆分购物车。
运行要求
通过 npx 以 stdio 本地进程运行,需要 Node.js 20 或更高版本。无需账号或 API 密钥,Denner 适配器会匿名自动注册。可选环境变量:DENNER_JWT、LIDL_DEFAULT_STORE、SWISSGROCERIES_USER_AGENT_COOP、SWISSGROCERIES_LOG_LEVEL 和 SWISSGROCERIES_DISABLE_CACHE。需要访问各零售商接口的网络连接。
安装前请注意
依赖非官方、公开可访问的手机应用接口,随时可能变更或失效,且与任何零售商均无关联。Coop 调用可能触发机器人防护。可选的 DENNER_JWT 是 Bearer 令牌,不设置时由适配器自行注册。商品、门店和促销查询会发送给第三方零售商服务。这些工具只做查询和规划,不会下单购买。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Swissgroceries Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[swissgroceries-mcp]

swissgroceries-mcp

[npm version] [npm downloads] [CI] [License: PolyForm Shield 1.0.0] [Node] [MCP compatible] [nicktcode/swissgroceries-mcp MCP server] [PRs Welcome]

Real-time Swiss grocery shopping over the Model Context Protocol. Search products, compare prices across Migros, Coop, Aldi, Denner, Lidl, Volgshop, Otto's, and Coop City, 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, 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)

bash
claude mcp add swissgroceries -- npx -y @nicktcode/swissgroceries-mcp

Cursor / 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):

json
{  "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.json in the project, or ~/.cursor/mcp.json globally.
  • Cline / Continue / VS Code: see each client's MCP documentation.
  • Custom clients: any stdio-based MCP client can spawn npx -y @nicktcode/swissgroceries-mcp directly.

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

ToolWhat it does
find_storesFind grocery stores near a location, filtered by chain and radius.
search_productsCross-chain product search with normalised price, unit price, size, and tags.
get_productFull product details for a chain plus product ID pair.
get_promotionsCurrent promotional deals, filterable by chain, keyword, store, or expiry.
find_stockStores of a chain that have a given product in stock.
plan_shoppingPlan a multi-store trip for a shopping list near a location.
health_checkProbe 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

PromptWhat it does
weekly_deals_digestSummarise this week's best grocery deals across the configured chains. Optional category, chains, and location filters.
compare_basket_across_chainsCompare a shopping basket across all chains and recommend single-store vs split-cart strategies.
cheapest_recipe_ingredientsFrom 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

URIContent
swissgroceries://chainsJSON list of registered chain adapters and their capabilities (productSearch, productDetail, storeSearch, promotions, perStoreStock, perStorePricing).

Chain coverage

ChainProduct searchPromotionsPer-store stockNutritionAuth
MigrosFull catalogYesYesYes (product detail)Guest token (auto, rotated on expiry)
Coopcoop.ch catalog (coopathome)YesYes (geo)Yes (product detail)None
AldiFull catalogYesNoNo (API exposes only allergen claims)None
DennerFull catalogYesNoNoAnonymous self-auth (signup + signin, rotated)
LidlOnline assortment via the lidl.ch storefront (current + upcoming weekly offers, ~600 items; food only, de/fr/it)Yes (weekly leaflet)NoNoNone
VolgshopFull catalogYes (on_sale filter)No (delivery-only)Yes (parsed from free-text attribute, basis assumed 100g)None
Otto'sGrocery-adjacent (food, drugstore, baby)Yes (priceLabels facet)Yes (per-store stockLevel)NoNone
Coop CityDepartment-store catalog (coop-city.ch: cosmetics, household, fashion, electronics). Opt-in: only queried when chains includes coopcityYes (hasDiscount facet, current price only, no was-price or end date)Yes (per-store stockLevel, capped at 50)NoNone

NormalizedProduct.nutrition is normalized to a per-100g (or per-100ml) basis with the standard Swiss labelling fields — energyKj, energyKcal, fat, saturatedFat, carbs, sugar, fiber, protein, salt — so consumers can sort across chains ("highest protein per 100g lasagne") even though each upstream API exposes the data on a different surface and in a different shape. Missing or unparseable fields are left undefined; adapters never fabricate values.


Configuration

Env varDefaultEffect
DENNER_JWT(unset)Optional pre-supplied Denner Bearer JWT. Without it, the adapter self-registers anonymously on first use and rotates the token automatically.
LIDL_DEFAULT_STORECH0149Default Lidl store ID used when no storeIds are passed.
SWISSGROCERIES_USER_AGENT_COOP(default iOS Safari UA)Override the User-Agent for Coop calls if DataDome ever blocks the default.
SWISSGROCERIES_LOG_LEVELinfosilent, info, or debug.
SWISSGROCERIES_DISABLE_CACHE(unset)Set to 1 to bypass the in-memory HTTP cache (useful for debugging).

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                                            NormalizedPromotion

Build from source

bash
node --version   # requires Node.js >=20git clone https://github.com/nicktcode/swissgroceries-mcpcd swissgroceries-mcpnpm installnpm run build

To also build the .mcpb bundle locally:

bash
npx tsx scripts/build-mcpb.ts

Troubleshooting

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 Switzerland has no online grocery shop; lidl.ch only lists the current and upcoming weekly offers (around 600 items, food and non-food). Search covers that assortment, so a product that isn't on offer this or next week returns 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

bash
npm test              # full test suite, no network callsRUN_LIVE=1 npm test   # also runs live smoke tests against real chain APIsnpm run dev           # tsx watcher for local iterationSWISSGROCERIES_DISABLE_CACHE=1 RUN_LIVE=1 npm test  # cache off, useful for debuggingSWISSGROCERIES_LOG_LEVEL=debug npm run dev          # verbose logging

The 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:

  1. Capture API responses with Charles Proxy or mitmproxy on the chain's iOS or Android app.
  2. Create src/adapters/<chain>/{client,tags,normalize,index}.ts following the existing patterns. Use src/adapters/aldi/ as the simplest reference.
  3. Map raw responses to NormalizedProduct, NormalizedStore, and NormalizedPromotion.
  4. Declare capability flags accurately.
  5. Register the adapter in src/index.ts's buildRegistry().
  6. Add fixture-based tests under tests/adapters/.

License

PolyForm Shield 1.0.0 from v0.10.0. You can use and modify it for anything that doesn't compete with this software or the author's own products built on it (Swiss grocery search, price comparison and shopping apps or services), even if your product is free. Personal use in your own MCP client is fine. See LICENSING.md or contact [email protected].

v0.7.5 to v0.9.0 were released under AGPL-3.0-only and v0.7.4 and earlier under MIT; those published versions keep their original licenses.

来源:README.md,提交 c95862b

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.2最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。