Skip to content

0.44.0 — MCP Apps: Polymarket order card and wallet panel - #122

Merged
VickyXAI merged 4 commits into
mainfrom
feat/mcp-apps
Aug 30, 2026
Merged

0.44.0 — MCP Apps: Polymarket order card and wallet panel#122
VickyXAI merged 4 commits into
mainfrom
feat/mcp-apps

Conversation

@VickyXAI

Copy link
Copy Markdown
Contributor

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.html on blockrun_polymarket_read — live order card: question/outcome (now resolved for a bare token_id via 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 call blockrun_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 / orders render as tables; anything else falls back to text.
  • ui://blockrun/wallet.html on blockrun_wallet — both chains, switch chain, copy, EIP-681 / Solana Pay QR, explorer, card on-ramp via ui/open-link.
  • Hosts without the extension ignore _meta.ui — Claude Code / Codex output is byte-identical.
  • Vanilla TS, single-file bundles (vite-plugin-singlefile) built from apps/ into ui/ (pretest + build, gitignored, shipped in the tarball, ~350 KB each). Resources registered only for profiles that expose the tool.
  • resolveToken fills question / outcome / conditionId / closed / acceptingOrders for a bare token_id (Gamma clob_token_ids, best-effort, 4 s, spread-safe {}).

Verified

  • npm test 423/423, typecheck clean, build ok, --version = 0.44.0, tarball has ui/*.html.
  • Rendered for real in the MCPJam inspector (stdio → this server): the README/docs screenshots are element captures of the Claude-host simulation — wallet panel with live balances, order card with a live $5 FOK preview on a real market (best ask 57.0¢, ≈8.77 shares, cap meter). Recognised by MCPJam as visibility: ["model","app"] on exactly the two tools.
  • Not exercised end-to-end from inside the sandboxed iframe (cross-origin from the test driver): Re-quote / Place / chain-switch button paths. They use the same callServerTool plumbing; a first real click in Claude Desktop is the remaining validation — please try blockrun_wallet there after merge.

Not in scope

  • Slimming the bundle (hand-rolled postMessage client instead of the App class).
  • Re-quote on a timer.

Merging publishes 0.44.0 via publish.yml.

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.
@VickyXAI
VickyXAI merged commit 42ebe76 into main Aug 30, 2026
1 check passed
@VickyXAI
VickyXAI deleted the feat/mcp-apps branch August 30, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant