RabATt
<h1 align="center">🇦🇹 RabATt 🇦🇹</h1>
<p align="center"><sub>From the same series: <a href="https://github.com/Samxel/geizhals-mcp">geizhals-mcp</a> · <a href="https://github.com/Samxel/kleinanzeigen-mcp">kleinanzeigen-mcp</a> · <a href="https://github.com/Samxel/willhaben-mcp">willhaben-mcp</a></sub></p>
<p align="center">An MCP server that lets an AI compare prices and promotions at <b>BILLA, SPAR, HOFER and dm</b> in Austria.</p>
<p align="center">
<a href="#highlights">Highlights</a> ·
<a href="#setup">Setup</a> ·
<a href="#add-it-to-claude-and-other-mcp-clients">Add to Claude</a> ·
<a href="#run-it-yourself">Run</a> ·
<a href="#tools">Tools</a> ·
<a href="#disclaimer">Disclaimer</a> ·
<a href="#license">License</a>
</p>
<p align="center"><sub><a href="README.de.md">Diese Anleitung auf Deutsch</a></sub></p>
## Highlights
- **Four chains, one search**
Search **BILLA, SPAR, HOFER and dm** at once and see **where something is cheapest**, also per kilo or litre.
- **What the whole shopping list costs**
Hand over a **shopping list** and get **the total per chain**, the cheapest chain that has everything and the cheapest mix across all of them.
- **What's on sale, and what's coming**
The **current promotions**, the **leaflets** and **HOFER's upcoming promotions** with their prices.
- **Is it in my store?**
The **nearest stores** of every chain and whether they **have a product in stock**.
## Setup
Pick one of three ways. All of them need nothing running in the background:
the client starts the server when it needs it.
**Claude Desktop, no terminal.** Download `rabatt-mcp.mcpb` from the
[latest release](https://github.com/Samxel/rabatt-mcp/releases/latest) and
double-click it. Claude Desktop shows an install dialog, asks for your postcode
(optional) and sets up the dependencies itself. Done; skip the rest of this
section.
**With [uv](https://docs.astral.sh/uv/), no clone.** One command runs the
current version straight from GitHub:
```bash
uvx --from git+https://github.com/Samxel/rabatt-mcp rabatt-mcp --stdio
```
**From a clone.** Requires Python 3.10+.
```bash
git clone https://github.com/Samxel/rabatt-mcp
cd rabatt-mcp
pip install -r requirements.txt
python main.py --stdio
```
`uv run main.py --stdio` also works without the `pip install`: `main.py`
declares its own dependencies.
**Your home.** Set `RABATT_NEAR` to your postcode or town (`8020`, `Graz`) and
the store and stock tools use it whenever the AI doesn't name a place.
## Add it to Claude (and other MCP clients)
### Claude Code
One command, no config file:
```bash
claude mcp add rabatt -e RABATT_NEAR=8020 -- uvx --from git+https://github.com/Samxel/rabatt-mcp rabatt-mcp --stdio
```
From a clone, point it at `main.py` instead:
```bash
claude mcp add rabatt -- python /path/to/rabatt-mcp/main.py --stdio
```
Add `--scope user` to have it in every project instead of only the current one.
`claude mcp list` shows whether the connection came up, `claude mcp remove
rabatt` takes it out again.
### Claude Desktop
The `.mcpb` from [Setup](#setup) is the easiest way. Without it, open
**Settings > Developer > Edit Config**, add the `rabatt` entry to
`claude_desktop_config.json` and restart Claude Desktop:
```json
{
"mcpServers": {
"rabatt": {
"command": "uvx",
"args": ["--from", "git+https://github.com/Samxel/rabatt-mcp", "rabatt-mcp", "--stdio"],
"env": { "RABATT_NEAR": "8020" }
}
}
}
```
From a clone, use `"command": "python"` and `"args":
["C:\\path\\to\\rabatt-mcp\\main.py", "--stdio"]` (the full path to
`main.py`, forward slashes on macOS/Linux).
Custom connectors (**Settings > Connectors**) connect from Anthropic's cloud,
so they cannot reach a server running only on your own machine. To use the
tools in claude.ai and the mobile apps, expose the HTTP server (see [Run it
yourself](#run-it-yourself)) through cloudflared, ngrok or a box with a public
hostname, and add that HTTPS URL under **Settings > Connectors > Add custom
connector**. Anyone who finds the URL can use the server too, though, so put
authentication in front of it.
Every tool is marked read-only, so clients that honour that hint won't ask
before each call. In Claude Desktop you can also open **Settings > Connectors >
rabatt** and set the tools' dropdown on the right to **Always allow**.
### Cursor, Codex, VS Code and other JSON-config clients
The same entry as for Claude Desktop, in the client's MCP config. Clients that
connect to a URL instead take `"type": "http"` and `"url":
"http://127.0.0.1:8030/mcp"`, with the server started as below.
## Run it yourself
Without `--stdio`, the server starts over streamable HTTP and prints where it's
listening:
```bash
python main.py
```
```
Starting rabatt-mcp server on http://127.0.0.1:8030/mcp
```
Point your client at that URL, e.g. `claude mcp add --transport http rabatt
http://127.0.0.1:8030/mcp`. Host, port and path live at the top of
`rabatt/server.py`; the port differs from geizhals-mcp (8000), willhaben-mcp
(8010) and kleinanzeigen-mcp (8020), so all four can run side by side.
Installed with pip or uv, the `rabatt-mcp` command and `python -m rabatt` do
the same as `python main.py`.
## Tools
Every chain is named `billa`, `spar`, `hofer` or `dm`; tools that take
`chains` ask all four when it is left out. A hit's `id` belongs to its chain
and is what `get_product` and `check_availability` take. `price` and
`was_price` are in EUR, `unit_price` is per 1 `kg`, `l` or `stk` (piece).
Paging is per chain: `next_offset` is where that chain's next page starts,
`has_more` whether anything is left. Results come as compact JSON, and fields
without a value are left out.
<details>
<summary><code>search_products(query, ...)</code>: search every chain at once</summary>
Searches all four chains (or `chains`) in parallel and returns one entry per
chain with its `total`, `next_offset`, `has_more` and `hits` (`rows` 5 by
default, up to 20 per chain). Filters: `diet` (`vegan`, `vegetarian`,
`organic`, `gluten_free`, `lactose_free`), `on_sale` and `max_price`. `sort`
takes `""` (relevance), `"price"` or `"unit_price"`, the one to compare pack
sizes across chains.
A chain that has no such filter is left out with a `note` instead of answering
unfiltered. Where a chain can't sort or cap the price itself, the server does
it on that chain's 60 most relevant hits and says so in the `note`. One chain
failing (a timeout, a rate limit) leaves the others' answers standing.
</details>
<details>
<summary><code>compare_basket(items, chains)</code>: what a shopping list costs at each chain</summary>
Takes a shopping list of up to 15 items, each as specific as a search
(`"vollmilch 1l"`, `"barilla spaghetti"`) and optionally with a quantity
(`"2x butter"`). For every chain it picks the product whose name matches each
item best, sold by the same unit (l, kg, piece) as at most chains, and the
cheapest of equally good matches. A banana pudding does not stand in for
bananas just because it is cheaper.
Returns per chain the `total`, how many items were `found`, the `missing` ones
and the picked `items`, each with up to two `others` in case the pick is not
what was meant. `cheapest` is the chain with the lowest total among those that
found everything, `cheapest_mix` each item at whichever chain sells it
cheapest. BILLA, SPAR and HOFER are asked by default; add dm through `chains`
for drugstore goods, it has no food. Every item is one search per chain, so a
long list takes a few seconds.
</details>
<details>
<summary><code>browse_category(chain, category, ...)</code>: list the products of one category</summary>
The products of one category at one chain, by its code from
`list_categories`, with the same filters, sorting and paging as
`search_products` (`rows` 10 by default, up to 20). The category's path is
named once at the top.
</details>
<details>
<summary><code>list_categories(query, chain)</code>: look up category codes by name</summary>
Searches the shipped category trees of all four chains (or one) for a German
name. It matches a category's own name first, so "kaffee" finds the coffee
categories rather than every tea under "Kaffee, Tee & Co.", and the whole path
only if no name matches. Returns `{count, <chain>: [{code, path}]}`, at most `limit`
categories in all (40 by default, up to 100). Answers offline.
</details>
<details>
<summary><code>get_product(chain, product_id)</code>: one product in full</summary>
Price and unit price, a description and a picture at every chain, and what
each chain has besides:
- **BILLA**: allergens, origin, storage, nutrition, category with its code and
the product page `url`
- **SPAR**: ingredients, allergens, origin, storage and nutrition
- **HOFER**: ingredients, nutrition claims, storage, category with its code and
whether it keeps store stock for the product
- **dm**: ingredients, usage, warnings, features, the GTIN, the category, its
"price not raised since" note and the product page `url`
</details>
<details>
<summary><code>get_promotions(upcoming=False, leaflets=False, ...)</code>: what's on sale, and what's coming</summary>
Without arguments: the current promotions of BILLA and SPAR, and HOFER's
grouped by the day they started, each day with its `themes` and `total`. With
`upcoming=True`: HOFER's promotions of the coming days, with prices and
`available_from`. `leaflets=True` returns the BILLA and SPAR leaflets for
the province of `near` instead, with their validity and a link. dm runs no
promotions. `rows` (5 by default, up to 20) counts per chain, and per day at
HOFER.
</details>
<details>
<summary><code>find_stores(near, chains, limit=3)</code>: the nearest stores per chain</summary>
The stores closest to an Austrian postcode or town (or `RABATT_NEAR`), per
chain, with `id`, address, distance in `km` and today's opening hours.
</details>
<details>
<summary><code>check_availability(chain, product_id, near=None, store_id=None)</code>: is it in stock nearby?</summary>
Checks the nearest `limit` stores (5 by default, up to 10), or one `store_id`
from `find_stores`. `stock` is `"in stock"`, `"low"`, `"out of stock"` or `"no
data"`, and HOFER's red light is `"low or out of stock"`; dm adds the number of
`pieces`. SPAR only knows whether a store lists a product, and HOFER keeps
stock data for its promotion items only (it says so for anything else).
</details>
## Disclaimer
This is an independent, unofficial project and is not affiliated with, endorsed
by, or connected to BILLA, REWE International, SPAR, HOFER, ALDI SÜD or dm.
All names and trademarks belong to their respective owners.
It uses unofficial interfaces of the chains' apps and web shops, which can
change or go away at any time. Prices are the chains' national ones and can
differ in a single store. You are responsible for how you use it: respect the
chains' Terms of Service and applicable law, and don't hammer their servers.
If you're a rights holder and have a concern about this repository, please open
an issue and I'll respond promptly.
## License
[`MIT LICENSE`](LICENSE). Provided "as is", without warranty.
<p align="center"><sub><a href="README.de.md">Diese Anleitung auf Deutsch</a></sub></p>
TDQS
Scored across 8 tools
Most tools have clearly distinct purposes: product search, category browsing, detail lookup, basket comparison, store lookup, availability, and promotions are all separate workflows. There is minor overlap between search_products and browse_category (both list products) and between get_promotions and search_products with on_sale, but the descriptions explicitly clarify when to use each.
Every tool follows a clear snake_case verb_noun pattern: search_products, compare_basket, find_stores, browse_category, list_categories, get_product, check_availability, get_promotions. There are no mixed conventions or vague names.
Eight tools is well-scoped for a grocery price-comparison server. Each tool covers a distinct part of the workflow—discovery, detail, store lookup, availability, promotions, and basket comparison—without obvious redundancy.
The surface covers the core domain well: product search and browsing, product detail, cross-chain basket cost comparison, store locator, stock availability, and promotions/leaflets. A few minor gaps remain, such as direct item-level cross-chain comparison outside a basket and richer chain metadata, but no critical workflow is missing.