Skip to main content
Glama
pokys
by pokys

kupi-mcp

Neoficiální MCP server nad veřejnými slevovými stránkami Kupi.cz. Pouze čte: vyhledá akční produkty, porovná nabídky jednoho produktu a sestaví z akcí nákupní seznam.

Není spojený s provozovatelem Kupi.cz ani jím schválený.

Nástroje

Nástroj

K čemu je

search_products

Najde akční produkty. Každý výsledek nese match.score (0–1) a match.quality, tedy jak dobře odpovídá dotazu.

get_product_offers

Nabídky jednoho produktu z jeho detailu — víc obchodů než výsledek hledání.

compare_shopping_list

Hlavní nástroj: z celého seznamu sestaví proveditelný nákup přes několik obchodů.

Volitelný parametr radiusKm u prvního a třetího omezí výsledek na řetězce s ověřenou pobočkou v okolí. Stojí další HTTP požadavky; bez něj server vzdálenost obchodů nezná.

Related MCP server: coffee-price-mcp

Čemu výstup věří a čemu ne

  • Leták není sklad. Cena z akce neznamená, že produkt na pobočce je.

  • Vzdálenost je vzdušná čára ze souřadnic pobočky, ne délka jízdy.

  • Otevírací doba je běžná týdenní; svátky a jednorázová zavření zdroj neuvádí.

  • Platnost akce na konkrétní pobočce se nedá z veřejných stránek ověřit, proto je označená jako assumed.

  • Neúplný košík má totalPrice: null. Cena vyřešené části je v resolvedPrice.

  • Produkt, který dotazu neodpovídá dost jistě, se nepoužije; položka zůstane nevyřešená.

Lokalita

Kupi.cz drží lokalitu v cookies. Endpoint, který překládá název města na interní ID, je zakázaný v robots.txt, takže se ID nikdy neodhaduje. Buď ho předáte v KUPI_LOCALITIES, nebo se použije anonymní výchozí lokalita podle IP — a výsledek vždy uvádí, pro kterou lokalitu data skutečně jsou.

ID si zjistíte ve vlastním prohlížeči z cookies user_locality a user_slocality po nastavení města na Kupi.cz. Jsou to provozní data; do repozitáře nepatří.

Konfigurace

Proměnná

Výchozí

Význam

KUPI_LOCALITIES

prázdné

Mesto:localityId[:sublocalityId], oddělené čárkou

KUPI_USER_AGENT

obecný

User-Agent, kterým se server představuje

KUPI_MIN_REQUEST_INTERVAL_MS

600

Rozestup mezi požadavky na zdroj

KUPI_MAX_CONCURRENCY

2

Souběžné požadavky

KUPI_CACHE_TTL_MS

1800000

Platnost cache staženého HTML

KUPI_TIMEOUT_MS

15000

Timeout jednoho požadavku

KUPI_MAX_RETRIES

2

Opakování po dočasné chybě

KUPI_MAX_RESPONSE_BYTES

2097152

Strop velikosti odpovědi

Pro HTTP nasazení navíc:

Proměnná

Význam

MCP_HTTP_BEARER_TOKEN

Token, který klient posílá v Authorization: Bearer nebo X-Api-Key

MCP_HTTP_ALLOW_UNAUTHENTICATED

1 otevře endpoint bez tokenu — jen pro lokální vývoj

MCP_HTTP_ALLOWED_ORIGINS

Povolené Origin pro prohlížečové klienty, oddělené čárkou

MCP_HTTP_MAX_BODY_BYTES

Strop velikosti požadavku (výchozí 1 MiB)

Bez MCP_HTTP_BEARER_TOKEN a bez výslovného povolení anonymního přístupu endpoint odpovídá 503. Nezabezpečený server nikdy nevznikne omylem.

Spuštění

npm ci
npm run build
npm start

Přes stdio, například v Claude Desktop:

{
  "mcpServers": {
    "kupi": {
      "command": "node",
      "args": ["/cesta/ke/kupi-mcp/dist/index.js"],
      "env": { "KUPI_LOCALITIES": "Mesto:localityId:sublocalityId" }
    }
  }
}

Nasazení na Vercel

Repozitář je připravený jako drop-in projekt: api/mcp.ts je MCP endpoint, api/health.ts odpovídá na kořenové cestě. Nastavte MCP_HTTP_BEARER_TOKEN mezi proměnnými prostředí projektu a nasaďte. npm run package vyrobí ZIP, který se dá na Vercel přetáhnout beze změn.

Klient se pak připojí na https://vase-nasazeni.vercel.app/api/mcp s hlavičkou Authorization: Bearer <token>; klienti, které vlastní hlavička Authorization nepustí, mohou poslat X-Api-Key.

Snapshot poboček

Vyhledávání s radiusKm jinak stahuje stránky poboček za běhu, což je po studeném startu pomalé. Předgenerovaný snapshot to odstraní:

npm run branches:refresh -- --location Mesto --radius 50

Zapíše data/store-branches.json. Opakované běhy pro různá města se slučují. Soubor je volitelný — bez něj se pobočky dohledávají živě.

Vývoj

npm run typecheck
npm run lint
npm test

npm run privacy:check hlídá, aby se do repozitáře nedostaly e-maily, absolutní cesty z domovského adresáře ani konkrétní ID lokalit.

Co jsme o zdroji zjistili a proč je kód místy opatrnější, než by se zdálo nutné, je v docs/kupi-facts.md.

Ohleduplnost ke zdroji

Požadavky jsou sériové s rozestupem, odpovědi se cachují a odpovědi 429/403 se nepřekračují — server se je nesnaží obejít, vrátí strukturovanou chybu. Skupina User-agent: AI má v robots.txt Kupi.cz úplný zákaz; pro veřejné nebo objemné nasazení si vyžádejte souhlas provozovatele.

Licence

MIT, viz LICENSE.

Available Tools

3 tools
compare_shopping_listOptimalizovat nákupní seznamA
Read-onlyIdempotent

Porovná letákové nabídky pro více položek, respektuje obchody, dostupná členství a maximální počet obchodů. Ve výchozím stavu používá jen akce platné dnes. Množství zadávejte přes amount + unit („2 kg“); počet balení se dopočítá podle skutečné velikosti balení (2 kg z balení po 600 g = 4 balení). Produkty s nízkou jistotou shody se nepoužijí a skončí v unresolvedItems. Pokud není pokryt celý košík, je status „partial“ a totalPrice je null — cena vyřešené části je v resolvedPrice. Výsledek je přibližný a neřeší vzdálenost ani sklad.

ParametersJSON Schema
NameRequiredDescriptionDefault
debugNoPřidá strukturovanou diagnostiku odmítnutých kandidátů a reason codes. Výchozí je vypnuto.
itemsYes
validOnNoDatum, ke kterému musí akce platit (YYYY-MM-DD). Výchozí je dnešek v Praze.
locationNo
maxStoresNo
optimizationNobalanced
allowedStoresNo
excludedStoresNo
availableMembershipsNo
requireCompleteBasketNoUpřednostní kombinaci obchodů pokrývající celý košík před nižší cenou.

Output Schema

ParametersJSON Schema
NameRequiredDescription
errorNo
statusNo
storesNo
successYes
validOnNo
completeNo
coverageNo
locationNo
warningsNo
sourceUrlsNo
totalItemsNo
totalPriceNo
approximateNo
diagnosticsNo
explanationNo
retrievedAtNo
optimizationNo
resolvedItemsNo
resolvedPriceNo
unresolvedItemsNo
requestedLocationNo

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly=true, openWorld=true, idempotent=true, and destructive=false. The description adds substantial behavioral detail: default date scope, package-count rounding, low-confidence products going to unresolvedItems, partial status with null totalPrice and resolvedPrice, and the approximation/distance/stock limitation. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the tool's purpose and then delivers compact behavioral rules: date default, quantity semantics, unresolved items, partial results, and limitations. Every sentence earns its place with no filler or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 10-parameter tool with an output schema and strong annotations, the description covers the most important behaviors and caveats clearly. It still leaves some optional parameters like optimization modes, allowedStores/excludedStores, and requireCompleteBasket to schema-only documentation, and it does not explicitly route between this tool and its siblings.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 30%, so the description must compensate. It meaningfully explains the critical amount+unit semantics with a concrete example and package-count recalculation, and it steers away from deprecated quantity/preferredPackage. It does not cover optimization, requireCompleteBasket, or store-filter parameters, but those are at least present in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: comparing leaflet offers for multiple items while respecting stores, memberships, and maxStores. This clearly differentiates it from the sibling tools search_products and get_product_offers, which are individual product/offer lookups.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context: it is for multi-item basket optimization, defaults to today's valid actions, and explains quantity input via amount+unit. It does not explicitly name alternatives or say when not to use it, but the intended use case is evident.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_product_offersPorovnat nabídky konkrétního produktuA
Read-onlyIdempotent

Načte veřejný detail /sleva/{slug}, deduplikuje doporučené nabídky a nabídky dle ceny a označí klubové, aplikační a množstevní podmínky.

ParametersJSON Schema
NameRequiredDescriptionDefault
slugNo
storesNo
validOnNoDatum, ke kterému musí akce platit (YYYY-MM-DD). Výchozí je dnešek v Praze.
locationNo
productUrlNo
excludeMembershipOnlyNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
errorNo
successYes
validOnNo
locationNo
productsNo
warningsNo
sourceUrlNo
retrievedAtNo
searchQueryNo
rejectedOffersNo
rejectedMatchesNo
requestedLocationNo

TDQS

A3.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already declare readOnly, openWorld, idempotent, and non-destructive behavior, so the description focuses on additional behavior: it loads a public endpoint, deduplicates recommended and price-based offers, and labels club/application/quantity conditions. It adds meaningful processing context beyond the structured annotations, though it does not discuss edge cases or failure modes.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The entire description is one dense sentence that front-loads the action and resource, then adds two valuable behavioral notes about deduplication and condition marking. There is no filler, repetition, or unnecessary context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The output schema and annotations cover return structure and safety, but with six parameters, zero required fields, and very low schema coverage, the description leaves significant ambiguity about invocation. In particular, it presents slug as part of the endpoint while the schema marks no parameters as required, which could confuse an agent about what must be supplied.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 17%, with only validOn having a real description in the schema. The description hints at slug via the endpoint template and at condition labeling, but it does not explain stores, location, productUrl, excludeMembershipOnly, or how they affect results. It fails to compensate for the otherwise low schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the action ('Načte' / loads), the resource ('veřejný detail /sleva/{slug}'), and the distinguishing post-processing behaviors: deduplicating offers and marking club, application, and quantity conditions. This makes it clearly distinct from siblings like search_products or compare_shopping_list, which are about discovery and comparison across products.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when a specific product slug is available and the agent needs its offers, but it does not explicitly state when to prefer this tool over search_products or compare_shopping_list. There is no mention of exclusions, prerequisites, or alternative routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_productsVyhledat akční produkty na Kupi.czA
Read-onlyIdempotent

Vyhledá nabídky ve veřejném server-renderovaném HTML Kupi.cz. Ve výchozím stavu vrací jen akce platné dnes; budoucí akce nejsou vydávány za aktuálně platné. Údaje o balení v dotazu („hermelín 100 g“) se automaticky oddělí, aby nekazily hledání. Každý produkt nese match.confidence (0–1) a match.quality (high/medium/low) vyjadřující, jak dobře odpovídá dotazu. Výsledek uvádí skutečnou lokalitu dat; nejde o potvrzení skladové dostupnosti.

ParametersJSON Schema
NameRequiredDescriptionDefault
debugNoPřidá strukturovanou diagnostiku odmítnutých kandidátů a reason codes. Výchozí je vypnuto.
limitNo
queryYes
sortByNorelevance
storesNo
excludeNoSlova, která produkt diskvalifikují, například ["uzená"].
validOnNoDatum, ke kterému musí akce platit (YYYY-MM-DD). Výchozí je dnešek v Praze.
locationNo
onlyOnSaleNo
excludeMembershipOnlyNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
errorNo
successYes
validOnNo
locationNo
productsNo
warningsNo
sourceUrlNo
retrievedAtNo
searchQueryNo
rejectedOffersNo
rejectedMatchesNo
requestedLocationNo

TDQS

A4.1/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already mark the tool read-only, idempotent, and non-destructive, and the description adds substantial behavior beyond that: it discloses the source type (public server-rendered HTML), default date semantics, automatic packaging-term separation, match.confidence/match.quality output fields, and the important caveat that results reflect data location, not stock availability. There is no contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Five dense sentences are ordered well: search source, default date behavior, query handling, match metadata, and the key limitation. Each sentence earns its place and there is no repeated schema information or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite 10 parameters and only 30% schema coverage, the description explains the tool's core behavior, defaults, query nuance, output metadata, and a crucial non-goal (stock confirmation); an output schema exists for return semantics. It falls short only on full parameter guidance and explicit sibling routing, but it is still largely complete for correct high-level use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 30%, so the description carries a heavy burden for parameter meaning. It adds some value by explaining that packaging details in the query are separated automatically, but it does not address limit, sortBy, stores, location, onlyOnSale, excludeMembershipOnly, or other parameters. Most parameter semantics remain undocumented in both the schema and the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a concrete action ('Vyhledá nabídky') and a precise target ('veřejném server-renderovaném HTML Kupi.cz'), with the title further scoping it to 'akční produkty na Kupi.cz'. This clearly differentiates the tool from offer-lookup and shopping-list comparison siblings even without naming them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides useful behavioral caveats: it defaults to today's deals, does not present future deals as current, and is not a stock-availability confirmation. However, it never explicitly tells the agent when to choose search_products over get_product_offers or compare_shopping_list; usage is only implied through purpose and caveats.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv0.1.0
    • First observedcompare_shopping_list
    • First observedget_product_offers
    • First observedsearch_products

TDQS

A4.2/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: search products, fetch detailed offers for a specific product, and compare a whole shopping list. There is no meaningful overlap between any pair, and the descriptions emphasize their different inputs and outputs.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case: search_products, get_product_offers, compare_shopping_list. The verbs clearly indicate the action and the object indicates the resource.

Tool Count5/5

Three tools is a compact but well-scoped set for a narrow domain. Each tool earns its place: search handles discovery, get_product_offers handles per-product detail, and compare_shopping_list handles batch comparison.

Completeness4/5

The core workflow of searching products, viewing offer details, and comparing a shopping list is covered with no dead ends. Minor gaps exist, such as no explicit store listing or category browsing tool, but these do not undermine the server's stated purpose.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    A Model Context Protocol server for real-time Swiss grocery shopping that searches and compares products across 8 major Swiss retailers (Migros, Coop, Aldi, Denner, Lidl, Farmy, Volgshop, Otto’s), normalizes per-unit prices, surfaces promotions, computes optimal multi-store shopping plans, and works with any MCP-compatible client without API keys or accounts.
    7
    86 npm
    30
    AGPL 3.0
  • A
    license
    A
    quality
    D
    maintenance
    A read-only MCP server that wraps the coffee.pryzm.gg public API to calculate effective prices of coffee drinks after discounts, enabling users to find the cheapest coffee deals, search for discounts, and verify receipt prices.
    3
    2
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Read-only MCP server for Greek supermarket product and price data from PosoKanei. Enables product search, barcode lookup, price comparison across retailers, and basket evaluation.
    10
    32 npm
    3
    MIT