pmqpip install pmquant, import pmq

What an agent sees through pmq

A real MCP session against live Polymarket order books, captured 2026-07-04 and replayed here verbatim: five tool calls from market discovery to a simulated fill. Paper money, real books, no keys.

Paper session Real live order books No keys This page: HTML and CSS only

The whole setup, any MCP client

{ "mcpServers": { "pmq": { "command": "pmq-mcp", "env": { "PMQ_MCP_PAPER": "1" } } } }
  1. find_markets(query="fed decision july")

    How many dissent at the July Fed meeting?
    will-no-one-dissent-the-july-fed-decision-20260616001928666 agent picks this
    $164.99
    Fed Decision in July?
    will-the-fed-decrease-interest-rates-by-50-bps-after-the-july-2026-meeting
    $310,450
    Fed Decision in July?
    will-the-fed-decrease-interest-rates-by-25-bps-after-the-july-2026-meeting
    $310,450

    plus 9 more of the 12 markets returned; right column: 24h event volume

    Full-text market discovery across every Polymarket category. Works with zero credentials.

  2. market(slug="will-no-one-dissent-the-july-fed-decision-20260616001928666")

    condition_id
    0x50ba1767…4ba17967
    token: Yes
    30048105…83432002
    token: No
    24681329…07939148
    closes
    2026-07-29 15:59 UTC
    settled winner
    none yet

    Slug resolved to the condition id and one token id per outcome. Those token ids drive the book and the trading tools. Long ids are shortened here for display, nothing else on this page is.

  3. book(token_id=<Yes>)

    Best bid

    0.54

    592.75 shares showing

    0.02
    spread

    Best ask

    0.56

    21 shares showing

    min order 5 shares · tick 0.01 · last trade 0.57 · asks resting across 0 to 1.00: $50,243.75 · negative-risk event

    Served by the matching engine in real time, still no keys. The exchange minimums and tick come from the venue, not from constants in the library.

  4. fak_buy(token_id=<Yes>, price_cap=0.58, usd=10)

    booked paper
    matched
    17.8571 shares
    price
    0.56 (cap was 0.58)
    cost
    10.00 USD
    taker fee
    0.308 USD
    cash left
    989.69 USD

    The simulator fills at the real best ask, never at the wished cap, caps the fill at the displayed size, refuses anything under the 5-share exchange minimum, and charges the documented taker fee formula, rate·p·(1-p)·shares. No order was sent: with PMQ_MCP_PAPER=1 none can be.

  5. account_collateral()

    989.69 paper USD, started at 1,000.00

    One buy and its fee, nothing else. In live mode this tool reports the collateral the exchange actually sees, with a signature-type diagnostic when it disagrees with the chain.

What changes when real money is involved

Everything above ran keyless. Live trading must be switched on by the operator, in the server environment, out of the model's reach:

PMQ_MCP_LIVE unset the trading tools are never registered; an agent cannot call a tool that does not exist
PMQ_MCP_PAPER=1 this page's mode: simulated fills on the real books, keyless; wins over live if both are set
PMQ_MCP_MAX_USD hard cap per single order, default 10, enforced in live and paper alike
PMQ_MCP_DAILY_USD cumulative buy budget per UTC day; unknown outcomes conservatively consume it until reconciled

Structural rails on top: only fill-and-kill orders exist, so nothing ever rests unattended on the book; a fill is booked only from an exchange confirmation, never from optimism; any uncertain outcome routes the agent to reconciliation before it may trade that market again.

Run it yourself

pip install "pmquant[mcp]"

Then point your MCP client (Claude Desktop or Code, ChatGPT, LangChain, a bare SDK loop) at pmq-mcp with PMQ_MCP_PAPER=1, as in the snippet at the top, and ask the agent to find a market and trade it. Books move, so your numbers will differ from this captured session.

Every figure on this page comes from the captured session of 2026-07-04, unedited. The page itself is one file of HTML and CSS: no JavaScript, no network requests, view source to check.

github.com/crp4222/pmq pypi.org/project/pmquant MCP registry: io.github.crp4222/pmq MIT