gratis-mcp
# gratis-mcp
Unofficial read-only MCP server for **Gratis** (gratis.com) — Türkiye's #1 personal-care & cosmetics retail chain (800+ stores in 81 provinces, founded 2009, 486 brands, 19.5M+ Gratis Kart members): product search, full product detail, reviews, category listings, the category tree, the brand directory, price statistics and the store locator.
mcp-name: io.github.mohammad-abbasi-sh/gratis-mcp
## Tools
| Tool | What it does |
| --- | --- |
| `gratis_search_products` | Search products by keyword (Turkish), e.g. `şampuan` (shampoo), `ruj`, `güneş kremi`. 24 products/page, optional in-stock filter. |
| `gratis_get_product` | Full detail of one product (numeric id, e.g. `10217999`): name, brand, current / list / Gratis Kart prices in TRY, stock status, categories, volume, EAN, origin, description, features, review summary, view/sales/favourite counts, variants, images. |
| `gratis_product_reviews` | Reviews of one product: total count, average rating and the review list (rating, comment, masked reviewer, date). |
| `gratis_category_products` | Products of one category (id from `gratis_list_categories`, e.g. `502` Cilt Bakım), with paging. |
| `gratis_list_categories` | The full nested category tree: 14 top-level departments with subcategories down to leaf level. |
| `gratis_list_brands` | The brand directory (486 brands): name + numeric id, optional name filter. |
| `gratis_price_stats` | Price statistics for a search (first 24 results): min / median / mean / max in TRY, cheapest / most expensive, discount share, top categories. |
| `gratis_list_stores` | Gratis stores (926 stores): name, city, district, address, phone, store type, returns, coordinates, opening hours per weekday. Optional city filter, e.g. `İstanbul`. |
| `gratis_health` | Reachability check (one search against the API). |
## Install
Requires Python 3.10+. The package is published on PyPI (pending publisher setup — see below); once live:
```bash
uvx gratis-mcp
```
Claude Desktop (`claude_desktop_config.json`):
```json
{
"mcpServers": {
"gratis": {
"command": "uvx",
"args": ["gratis-mcp"]
}
}
}
```
No login, no API key. Read-only: the server only calls the storefront's public read-only API.
## For AI agents
- Search is Turkish: use Turkish keywords (`şampuan`, not `shampoo`). Results carry `exact_match` — a nonsense query returns zero results (`itemCount: 0`), so `exact_match: false` means the site found nothing.
- Prices are live and move with campaigns. `price_try` is the effective shelf price, `gratis_card_price_try` is the Gratis Kart member price (often ~50% off), `list_price_try` the non-discounted price. Verify price and availability on gratis.com before buying.
- Product ids are numeric strings (e.g. `10217999`) — find one with `gratis_search_products` first, then pass it to `gratis_get_product` / `gratis_product_reviews`.
- Category ids are numeric strings from `gratis_list_categories` (e.g. `502` = Cilt Bakım / skincare, `503` = Saç Bakım / hair care). Brand filters use the numeric brand id from `gratis_list_brands`.
- There is no server-side sort: results come in the site's default order; sort the returned page client-side if needed.
- Every response includes `fetched_at` (UTC) and `source`.
## How it works
- All data comes from the storefront's own public Retter backend (`api.gratis.retter.io`, project `1oakekr4e`) — the same endpoints the website's JavaScript calls: `CALL/Search/search`, `CALL/Product/getProductDetail/<id>`, `CALL/Product/getReviews/<id>`, `CALL/Search/getCategoryTree`, `CALL/Search/getBrands`, `CALL/StoreManager/getStores/default`.
- GET calls that carry an input object follow the Retter SDK convention: the input JSON is key-sorted, JSON-stringified, base64-encoded and sent as the `data` query param with `__isbase64=true` (plus `__culture=tr-TR` and `__platform=WEB`). A plain `?query=<json>` is rejected by the server's input validation.
- Search returns 24 products per page with prices as integer kuruş (converted to TRY), stock status, categories, review counts and image URLs. Category listings are the same search with a `categories` filter.
- Prices are integers in kuruş in the API (71900 = 719.00 TL) and are exposed as TRY floats.
- Transport is plain HTTPS with a browser user-agent (the API answers plain requests with HTTP 200 — no bot wall). Requests are spaced ~0.5s apart and retried once on transport errors.
## Caveats
- Gratis runs frequent campaigns: a price seen in the morning can change the same day. The server always returns what the API returns at fetch time.
- Review paging is not exposed by the API: `gratis_product_reviews` returns the review list the API returns for the product (usually the most recent page).
- Descriptions are HTML on the site; the server returns them as plain text (truncated to 2000 chars).
- The store list is large (926 stores) — use the `city` filter to narrow it down.
## License
[PolyForm Noncommercial 1.0.0](https://polyformproject.org/licenses/noncommercial/1.0.0/) — free for personal and non-commercial use; commercial use needs a separate license.
Built by [Mohammad Abbasi](https://github.com/mohammad-abbasi-sh) — [Almanibama](https://almanibama.ir) · [mabbasi.ir](https://mabbasi.ir)
TDQS
Scored across 9 tools
Most tools target a distinct resource+action (detail, reviews, categories, brands, stores, health), and descriptions clearly explain when to use each. The only mild overlap is between gratis_search_products, gratis_category_products and gratis_price_stats, which all revolve around querying product listings, though keyword browse vs. category browse vs. aggregate stats are reasonably differentiated.
All names share a consistent gratis_ prefix and snake_case, which makes them predictable. However, the convention mixes verb_noun (get_product, search_products, list_categories) with noun_noun (product_reviews, category_products, price_stats) and a bare noun (health), a minor deviation from a single pattern.
Nine tools is well within the ideal range and each one earns its place: discovery (search, category, brand), detail (product, reviews), aggregation (price stats), plus stores and health. No tool feels redundant or like filler.
The surface covers the core shopping-research lifecycle (find, inspect, review, price-compare, locate stores) but has notable gaps: gratis_list_brands returns numeric brand ids with no tool that consumes a brand id, so listing products by brand is a dead end. There is also no filtering/sorting on search (brand, category, price) and no pagination on reviews.