Fail-closed Polymarket CLOB V2 data and execution; trading tools gated behind PMQ_MCP_LIVE=1.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Fail-closed execution and market data for Polymarket CLOB V2, in Python,
built agent-first. Local signing (your keys never leave your process),
exchange-confirmed fills only, fee-correct math, deposit-wallet
(POLY_1271) support that actually works in production, order-attribution
registries (several bots can share one wallet, each with its own
exchange-truth accounting), and a bundled
MCP server: plug any LLM or agent framework that speaks MCP (Claude,
ChatGPT, LangChain, your own loop) on top and it can read every market and,
if and only if the operator enables it, trade under hard rails: tools that
do not exist until you create them, a cap per order, a daily buy budget.
The model cannot widen any of this from inside a session.
(PyPI's similarity check reserves the bare name; the module you import is
pmq, same pattern as beautifulsoup4/bs4.)
Point any MCP client at uvx; it installs the MCP extra in an isolated
environment and starts pmq-mcp with one environment variable:
PMQ_MCP_PAPER=1 registers the same trading tools as live, but fills are
simulated against the real live order books using the displayed best
quote, venue minimums, and a documented crypto-rate fee estimate. The first
paper ledger starts at 1000 USD, configurable with PMQ_MCP_PAPER_USD; it
then persists locally across server restarts. No keys are needed and no order
can reach the exchange. A real session, captured 2026-07-04, quoted verbatim:
Five calls: discover, resolve, read the live book, buy with simulated
money at the real ask, check the balance. The same session rendered as a
step-by-step page: docs/demo.html (one self-contained
HTML file, no JavaScript, no external requests; download and open it).
Trading real money additionally requires keys and an explicit
PMQ_MCP_LIVE=1, under the rails in
the agents section.
As of 2026-07-03 this is, to our knowledge, the only maintained Python layer combining local CLOB V2 signing, an exchange-confirmed fill contract, and working deposit-wallet (POLY_1271) auth. That claim is dated and falsifiable: docs/comparison.md names the alternatives and what each does instead; open an issue if it goes stale.
Market data needs no keys:
Execution (reads POLY_PRIVATE_KEY, POLY_FUNDER, POLY_SIG_TYPE from the
environment):
sell_fak and limit_gtc follow the same contract, and all three paths
have carried production volume: a FAK round trip (buy 5.149 @ 0.94, sell
back 5.14 @ 0.94, cross-checked via get_trades, 2026-07-03) and a GTC
maker fill (posted above the bid, matched as MAKER at zero fee,
2026-07-04, settlement tx in the production section below).
Python 3.10 to 3.14 (the CI matrix runs all five). Plain REST round trips, measured 2026-07-04 (medians of 5, residential fiber, Western Europe): resolve a market 76 ms, fetch a book 85 ms, sign + POST an order and get the exchange's answer 73 ms. Sub-second everywhere, built for second-scale strategies (the maintainer's bot polls 15-minute windows every 2.5 s); it is not a microsecond market-making stack: no websockets, no co-location, one HTTP call per action.
Polymarket cut over to CLOB V2 on 2026-04-28. V1-signed orders are rejected in production, the fee schedule is decided at match time, and the official client examples leave several traps undocumented. Every line of pmq was paid for with a real error in live trading:
invalid amounts, the market buy orders maker amount supports a max accuracy of 2 decimals, taker amount a max of 4 decimals: the CLOB treats FAK/FOK
buys as market orders and caps their signed amounts at 2 decimals
(maker) / 4 decimals (taker) whatever the tick size. The official client's
rounding table allows 5-6 taker decimals on markets whose tick is finer
than 0.01 (any book trading past 0.96 or under 0.04), so market orders
there are rejected wholesale (reported upstream:
py-clob-client-v2#99).
pmq clamps the signed
pair to the exchange caps before signing and refuses at startup any
client build that would still sign a rejectable pair, so the trap cannot
reach your orders. Measurements in
docs/rounding-study.md.no orders found to match with FAK order (HTTP 400, yet with an orderID):
a clean no-fill, not an error. pmq returns an empty Fill instead of crashing
or, worse, retrying blindly.balance: 0 while your pUSD sits on-chain: the balance endpoint
ignores your funder parameter and derives the wallet from your EOA and
signature_type. Funds in the Polymarket app's default wallet (an ERC-1271
deposit wallet) are only visible with signature_type=3.The full write-up with reproduction details: docs/war-story.md.
I built pmq for my own trading. It executes real volume with my funds every
day, and it has never booked a fill the exchange did not confirm. If you
want to see it on-chain, here is a settlement from one of my wallets
(2026-07-03):
0x387f5f09...100d88a8
on the CTF Exchange V2: a FAK market buy built by this library, matched and
settled, with the builder code visible in the calldata. The maker path has
its own receipt (2026-07-04): a limit_gtc posted one tick above the bid,
matched as MAKER at zero fee and settled in
0x1b60f19a...c35d09,
where the maker_orders slice accounting that release 0.4.6 encodes is
visible in the raw trade record. A weekly
canary workflow exercises the real endpoints
and the installed client surface, and opens an issue by itself if Polymarket
drifts.
It checks, in order: the installed client surface (introspection), your
derived EOA, the funder wallet on-chain (owner() and bytecode: is it a
deposit wallet?), whether POLY_SIG_TYPE matches the wallet type, whether
the CLOB actually sees your collateral (and if not, WHICH sig_type does),
and the target market's minimum size and tick. Real output on a real
deposit-wallet account:
If you landed here from "the order signer address has to be the address of the API KEY" or a CLOB balance of 0 with funds on-chain: this is the tool.
| Situation | What pmq does |
|---|---|
Response is a dict with orderID, not flagged failed | Fill with the matched size read from the response |
Error dict on HTTP 200, string body, success: false | Fill(rejected=True), zero booked |
| HTTP 4xx (incl. FAK no-match) | Fill(rejected=True), zero booked |
| Timeout, 5xx, exception after send | raises OrderUncertain: the order MAY exist. Call reconcile() before trading that market again |
| Unparseable matched amounts | zero booked (fail closed) |
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/pmq-polymarket-clob-v2)<a href="https://allmcps.com/mcp/pmq-polymarket-clob-v2"><img src="https://allmcps.com/api/badge/pmq-polymarket-clob-v2?style=directory" alt="Pmq (Polymarket CLOB V2) on AllMCPs" /></a>