Agent MCP

Connect an AI agent to HiMarket over MCP to search the catalog and market, and to manage your sell listings and buylist.

What it is

HiMarket exposes a Model Context Protocol (MCP) server so an AI agent can use the marketplace as you: search the catalog, read the market, and manage your own sell listings and buylist. The agent acts as the account owner — it never receives staff or admin powers.

Endpoint: https://www.himarket.hk/api/mcp (Streamable HTTP). Works with MCP-capable clients such as Cursor and Claude.

Connecting

Most developer clients authenticate with a Personal Access Token as a bearer token. Create one under API tokens on your Profile page (you must be signed in). The full token is shown once at creation — treat it like a password.

  1. Open Profile and expand API tokens.
  2. Create a token, choosing its scopes and mode (see below).
  3. Configure your MCP client with the endpoint above and the token as a bearer (Authorization: Bearer …).

Clients that support MCP OAuth discovery can connect without pasting a token. After you approve the app, HiMarket issues a token with the scopes and mode you chose. The consent screen defaults to propose mode.

Scopes and modes

Every token has one or more scopes. These are the only scopes:

ScopeGrants
readCatalog, market, your listings and buylist, whoami, get_capacity, get_pricing_guidance
sellist:writeCreate, price, and cancel sell listings
buylist:writeCreate, price, and cancel buylist items

Every token also has a mode, chosen when it is created:

ModeBehavior
directWrite tools apply immediately to the live marketplace.
proposeLive write tools are denied. The agent submits drafts with propose_changes; you review and approve them on My Listings before anything goes live.

Propose mode is the safe default for third-party agents. Drafts are inert until you approve them. whoami reports the mode as tokenMode, so an agent can tell up front whether its writes go live or must go through propose_changes.

Two games

Magic: The Gathering and Riftbound share one marketplace and one account. Catalog tools default to MTG and take game: "riftbound" to query the Riftbound catalog instead — some card names exist in both games, so the scope matters.

Everything keyed by printing id is already game-agnostic: Riftbound printing ids carry the rb- prefix. search_catalog, get_format_staples, and get_demand_overview are MTG-shaped and stay MTG-only.

Tool overview

Clients introspect the full schemas; this is a compact map of what exists. One line each.

Discovery and read (read)

ToolPurpose
search_cardsName search over HiMarket's catalog (prefix-preferred, with fuzzy fallback).
search_catalogStructured MTG catalog search (type, color, format legality, set, price range, and more).
get_card_printingsEvery paper printing of a card name, with set, collector number, and reference prices.
get_reference_pricesBatch reference prices and a live supply snapshot for up to 25 names.
get_supply_countsBatch copy-accurate live sell counts (and cheapest live sell) for up to 25 names.
get_for_saleActive for-sale rows for one exact card name.
get_market_overviewAggregated lowest-sell / highest-buy per printing.
get_demand_overviewCard names ranked by HiMarket page views, joined with supply and staple signals (MTG).
get_format_staplesTop tournament staples of one constructed format (MTG).
get_pricing_guidancePreset ratios, price floors, condition factors, and the Riftbound Chinese language factor.
whoamiThe account this token acts as, plus the token's scopes and tokenMode.
get_capacityActive sell/buy counts, account caps, and slots remaining.
list_my_sellistThis account's sell listings as compact rows.
list_my_buylistThis account's active buylist items, same compact row shape.
list_my_cardsThe account's entire collection, including cards not for sale.

Live writes — direct mode only

These apply immediately. In propose mode they are denied; use propose_changes instead. Each side needs its write scope (sellist:write or buylist:write).

ToolPurpose
create_sellistCreate 1–20 copies of one printing as sell listings.
bulk_create_sellistCreate sell listings for many distinct printings (auto-chunked).
set_sellist_price / bulk_set_sellist_priceSet absolute HK$ sell prices.
bulk_price_sellist_by_ratioPrice sell listings at ratio × reference.
cancel_sellist / bulk_cancel_sellistCancel (soft-delete) listings entirely.
bulk_delistRemove listings from sale; the cards stay in your collection.
create_buylistCreate 1–20 copies of one buy offer, priced immediately.
bulk_create_buylistCreate buy offers for many printings (auto-chunked). Optional maxTotalHKD budget.
set_buylist_price / bulk_price_buylist_by_ratioPrice buy offers (absolute HK$ or by ratio).
cancel_buylist / bulk_cancel_buylistCancel buy offers.

Proposals

propose_changes needs the write scope of the side being edited. Listing and fetching proposals needs read. Cancelling a still-pending draft needs any write scope.

ToolPurpose
propose_changesSubmit a draft mass edit for the owner to review and approve on My Listings.
list_my_proposalsList this account's proposals (id, side, status, plan summary).
get_proposalFetch one proposal in full — poll to see whether it was approved.
cancel_proposalWithdraw a still-pending draft.

Pricing

All prices are HK$ integers. ratio pricing = ratio × the printing's USD reference (sell side is condition-adjusted; buy side is the seller-credit ratio). Riftbound Chinese (zhs / zht) references are scaled by 0.6 (on the buy side, only when every accepted language is Chinese).

Floors: sell HK$8, buy HK$4.

A buy-side ratio on a reference below roughly US$0.5 / ratio rounds to zero and is rejected. For very cheap cards, pass an absolute price instead (minimum HK$4).

Money guardrails

  • Budget abort: bulk_create_buylist and propose_changes accept optional maxTotalHKD. If the summed exposure would exceed it, the whole call is aborted and nothing is written.
  • Real money: buylist fulfilment debits real store credit from the buyer's account.
  • Fees: the buyer pays a HK$3 + 4% transaction fee on top of the offer when a buylist item is fulfilled; the seller receives the full offer.
  • Rate limits: per-token rate limits apply to both MCP tools and equivalent API calls.

Safety

  • Tokens are revocable at any time from ProfileAPI tokens. Revoking an OAuth-connected token disconnects that app.
  • Propose-mode drafts are inert until you approve them on My Listings. Approve, reject, and apply are done in your signed-in browser session — not by the agent.