Skip to main content
Glama
xvyslo05

cz-mtg-compare-mcp

by xvyslo05

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MKM_API_BASENoOverride Cardmarket API base URL.https://api.cardmarket.com/ws/v2.0/output.json
MKM_APP_TOKENNoCardmarket OAuth1 app token. Unset means Cardmarket disabled.
MKM_APP_SECRETNoCardmarket OAuth1 app secret.
MKM_EUR_TO_CZKNoEUR to CZK conversion rate for Cardmarket prices.24.5
MKM_ACCESS_TOKENNoCardmarket OAuth1 access token.
CZ_MTG_UNTAP_PASSNoUntap account password or 1Password reference.
CZ_MTG_UNTAP_USERNoUntap account username or 1Password reference.
CZ_MTG_NAJADA_PASSNoNajada account password or 1Password reference.
CZ_MTG_NAJADA_USERNoNajada account username or 1Password reference.
CZ_MTG_DATABASE_URLNoSQLAlchemy URL for the web app's database.sqlite+aiosqlite:///:memory:
CZ_MTG_RISHADA_PASSNoRishada account password or 1Password reference.
CZ_MTG_RISHADA_USERNoRishada account username or 1Password reference.
CZ_MTG_TOLARIE_PASSNoTolarie account password or 1Password reference.
CZ_MTG_TOLARIE_USERNoTolarie account username or 1Password reference.
CZ_MTG_COOKIE_DOMAINNoCookie Domain attribute.
CZ_MTG_COOKIE_SECURENoWhether session/CSRF cookies require HTTPS.true
CZ_MTG_DATABASE_ECHONoLog all SQL emitted by the web app's engine.false
CZ_MTG_DISABLED_SHOPSNoComma-separated list of shop IDs to drop at startup.
CZ_MTG_SCRYFALL_CACHENoOverride Scryfall on-disk cache directory.~/.cache/cz-mtg-compare/scryfall/
CZ_MTG_BLACKLOTUS_PASSNoBlacklotus account password or 1Password reference.
CZ_MTG_BLACKLOTUS_USERNoBlacklotus account username or 1Password reference.
CZ_MTG_CERNYRYTIR_PASSNoČerný rytíř account password or 1Password reference.
CZ_MTG_CERNYRYTIR_USERNoČerný rytíř account username or 1Password reference.
CZ_MTG_COOKIE_SAMESITENoSameSite flag for both cookies.lax
CZ_MTG_PUBLIC_BASE_URLNoOrigin used when building links in outbound mail and Google's OAuth redirect URI.http://localhost:8080
CZ_MTG_CSRF_COOKIE_NAMENoCookie name carrying the CSRF token.cz_csrf
CZ_MTG_MAX_UNIQUE_CARDSNoHard cap on unique cards per optimize_decklist call.100
MKM_ACCESS_TOKEN_SECRETNoCardmarket OAuth1 access token secret.
CZ_MTG_SESSION_COOKIE_NAMENoCookie name carrying the opaque server-side session id.cz_session
CZ_MTG_SESSION_TTL_SECONDSNoSession lifetime in seconds.2592000
CZ_MTG_OAUTH_GOOGLE_CLIENT_IDNoOAuth 2.0 client id from Google Cloud Console.
CZ_MTG_EMAIL_VERIFY_TTL_SECONDSNoEmail-verification token lifetime in seconds.86400
CZ_MTG_CONSOLIDATE_TOLERANCE_PCTNoPercentage tolerance for fewest_shops strategy.10
CZ_MTG_OAUTH_GOOGLE_REDIRECT_URINoOverride the callback URL.
CZ_MTG_OAUTH_GOOGLE_CLIENT_SECRETNoOAuth 2.0 client secret.

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
search_cardA

Search a Magic: The Gathering single card across Czech shops.

Returns a flat list of offers sorted by price_czk ascending. Each offer has shop, edition, condition, language, foil, price_czk, stock_qty, and a deep-link url.

Shop selection:

  • shops: optional allow-list. If given, only these shops are queried. None = all.

  • exclude_shops: optional deny-list. Any shop here is dropped after shops is applied. Use this when the user wants results "from everywhere except shop X".

Display-only products (Art Series, oversized, helper / tip / checklist cards, spindowns) are excluded by default because they aren't legal in constructed Magic formats. Pass include_non_playable=True if you specifically want them (e.g. for a collector / art print query).

list_shopsA

List configured shops with their last-call status.

lookup_cardA

Resolve a Magic: The Gathering card name via Scryfall.

Returns canonical name, set code/name, oracle text, mana cost, image URL, Scryfall URI. Useful for disambiguating reprints, validating spelling, or fetching multilingual names.

Set exact=True to require an exact name match; default is fuzzy. Returns null if no card matches.

optimize_decklistA

Resolve a Magic decklist (Arena/MTGO text) against all shops in parallel and return a shopping_plan built under one of two strategies.

Strategies (strategy param):

  • "cheapest" (default): per-card greedy lowest price across all shops. Minimises total CZK; may fragment the order across many shops.

  • "fewest_shops": minimises the number of distinct shops in the final plan so the user places fewer separate orders / pays less shipping. Stays within 10% of the cheapest-split total by default; override the tolerance via the CZ_MTG_CONSOLIDATE_TOLERANCE_PCT env var (integer percent). When no single shop can cover everything, cards missing from the chosen set fall back to the globally-cheapest offer (which may add one or more shops to the plan).

Response shape:

  • strategy: echoes the strategy that produced the picks/plan.

  • picks: chosen offer per card under the active strategy.

  • shopping_plan: the picks regrouped per shop — render as a summary table. Each group has the shop name, a lines list (quantity, card name, edition, condition, foil, unit price, subtotal, url) and a subtotal_czk. Groups sorted by descending shop subtotal.

  • cheapest_split_total_czk: total of the per-card cheapest split, always populated as a reference even in fewest_shops mode.

  • consolidated_total_czk: total of the consolidated plan in fewest_shops mode (equals the sum of shopping_plan subtotals). null in cheapest mode.

  • per_shop_bundles: how each individual shop covers the decklist on its own (cards covered/missing, single-shop total CZK), sorted best-to-worst.

  • cheapest_split_missing: cards no shop has in stock.

When presenting results to the user, render the shopping_plan as a per-shop chart: one section per shop with a table of cards to buy from it, plus the shop subtotal. Then show the headline total (use consolidated_total_czk for fewest_shops, otherwise cheapest_split_total_czk) and any cheapest_split_missing. In fewest_shops mode it's useful to also surface the delta vs. the cheapest split so the user can see the consolidation premium.

The decklist must contain at most 100 cards in total (Commander deck size) AND at most 100 unique cards (one HTTP request per unique card per shop — the unique-cards cap exists to keep a single tool call from spawning a runaway number of requests). Override the unique cap via the CZ_MTG_MAX_UNIQUE_CARDS env var if you need a higher limit. Format example:

4 Lightning Bolt
4 Counterspell
2 Sol Ring (CMR) 263

Sideboard
1 Negate

Display-only products (Art Series, oversized, helper cards) are excluded by default. Pass include_non_playable=True to keep them in the picks.

Shop selection mirrors search_card:

  • shops: allow-list (None = all configured shops).

  • exclude_shops: deny-list (applied after the allow-list). Excluded shops also disappear from per_shop_bundles so the chart only shows the shops the user actually wants to see.

shop_account_capabilitiesA

Per-shop account-feature support and credential status.

Returns one entry per enabled shop with:

  • shop: shop id

  • supports_login / supports_cart / supports_watchlist: capability flags

  • credentials_configured: whether CZ_MTG_<SHOP>_USER and CZ_MTG_<SHOP>_PASS env vars are both set (does NOT resolve op://... 1Password references — just a presence check).

Use this to tell the user which shops they can actually log into and which account actions are available before attempting them.

shop_loginA

Authenticate against a shop using its CZ_MTG__USER / _PASS credentials.

The credentials may be literal strings or 1Password secret references of the form op://Vault/Item/Field — the latter is resolved via the op CLI on first use. Login sessions are kept in-process for as long as the MCP server runs and are reused automatically by add_to_cart / view_cart.

Returns {"shop": ..., "ok": true} on success. Raises with a clear message if the shop doesn't support login, credentials are missing/invalid, or the 1Password reference can't be resolved.

add_to_cartA

Add count of a specific offer to the shop's online cart.

shop_ref is the per-shop product/article identifier that appears on every Offer returned by search_card / optimize_decklist. For najada it's the article UUID (e.g. d762c438-8915-4131-be7e-e301d91d8935); for tolarie it's the numeric product id. Pass it through verbatim — don't construct it yourself. If you don't have one for the offer the user wants, call search_card first.

Logs in automatically on first call and transparently re-logs in if the cached token expires. Returns the shop's raw response (e.g. the updated cart-item record).

view_cartA

Return the current contents of the shop's online cart for the authenticated user. Logs in automatically if needed.

clear_cartA

Remove every item from the shop's online cart for the authenticated user.

Returns {"removed_items": <int>}. Destructive — confirm with the user before calling.

add_to_watchlistA

Add an offer to the shop's wishlist / watchlist / wantlist if the shop supports it. shop_ref is the same per-shop product/article identifier used by add_to_cart. Raises AccountFeatureNotSupported if the shop has no watchlist concept — check shop_account_capabilities first.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/xvyslo05/czech-mtg-price-comparator-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server