0.44.0 — MCP Apps: Polymarket order card and wallet panel - #122
Merged
Conversation
Two generative-UI apps (extension io.modelcontextprotocol/ui) that capable hosts — Claude Desktop, claude.ai, VS Code, Cursor — render inline instead of the tool's text. Hosts without the extension ignore _meta.ui and see today's text unchanged, so Claude Code and Codex are unaffected. ui://blockrun/order-preview.html, on blockrun_polymarket_read: the preview action becomes a live card — question, outcome, side, best quote in cents, est. shares, notional, per-order cap meter, session ledger. The amount is editable and re-quotes through the read-only tool. Place order is a two-click arm/confirm that calls blockrun_polymarket with confirm:true THROUGH THE HOST, so the host's own tool-consent prompt and every server cap still apply; the card then shows orderID/status/tx links and updates the model context. positions/orders results render as tables; anything else falls back to text. ui://blockrun/wallet.html, on blockrun_wallet: both chains' balances, active chain switch, copy address, EIP-681 / Solana Pay QR (same encoding as utils/qr.ts), explorer link, card on-ramp via ui/open-link. The preview payload now carries question/outcome/conditionId/bestQuote/ minSize/maxBetUsd/session so the card never parses prose. Bundles are single-file HTML built by vite-plugin-singlefile from apps/ into ui/ (pretest + build), shipped in the tarball, located from the package root like skills/. Resources are registered only for profiles exposing the tool. test/apps.test.ts pins the _meta wiring, per-profile registration, and that each bundle is self-contained (no external script/stylesheet).
resolveToken returned only { tokenId } for a token_id input, so the order
card could title itself no better than 'Token 9292…' and the closed /
acceptingOrders guard never ran on that path. Gamma indexes markets by CLOB
token id (GET /markets?clob_token_ids=…); ask it best-effort with a 4 s
timeout and spread whatever comes back — question, outcome (by index into
the token list), conditionId, closed, acceptingOrders. Gamma serialises
those two lists as JSON strings; parseGammaMarket tolerates both that and
real arrays and returns {} on anything else, so the CLOB book stays the
authority when Gamma is slow or down.
…shots Screenshots are element captures from the MCPJam inspector rendering the published server over stdio on 2026-08-30 — not mockups. docs/mcp-apps.md carries the host table, the money path (what the card does, what the host does, what the server still enforces), the wallet-panel action map, profile gating, local-testing recipes and limitations.
…_id resolves its market
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Item 4 of the CopilotKit-derived list: one MCP App (generative UI) — in fact two, since the wallet panel was the natural second.
What
ui://blockrun/order-preview.htmlonblockrun_polymarket_read— live order card: question/outcome (now resolved for a baretoken_idvia Gamma), side, best quote in cents, est. shares, notional, per-order cap meter, session ledger. Editable amount → Re-quote (read-only tool). Place order is arm-then-confirm and asks the host to callblockrun_polymarket … confirm:true, so the host's consent prompt and every server cap still apply; result lands in the card and in the model context.positions/ordersrender as tables; anything else falls back to text.ui://blockrun/wallet.htmlonblockrun_wallet— both chains, switch chain, copy, EIP-681 / Solana Pay QR, explorer, card on-ramp viaui/open-link._meta.ui— Claude Code / Codex output is byte-identical.vite-plugin-singlefile) built fromapps/intoui/(pretest + build, gitignored, shipped in the tarball, ~350 KB each). Resources registered only for profiles that expose the tool.resolveTokenfills question / outcome / conditionId / closed / acceptingOrders for a baretoken_id(Gammaclob_token_ids, best-effort, 4 s, spread-safe{}).Verified
npm test423/423, typecheck clean, build ok,--version= 0.44.0, tarball hasui/*.html.visibility: ["model","app"]on exactly the two tools.callServerToolplumbing; a first real click in Claude Desktop is the remaining validation — please tryblockrun_walletthere after merge.Not in scope
Appclass).Merging publishes 0.44.0 via publish.yml.