Shipping a remote OAuth 2.1 + MCP Apps server for 13k US stocks: lessons from Monk.trade
vishr · reddit · 2026-12-03
Monk.trade team shares engineering lessons from building a remote Streamable HTTP MCP server (with MCP Apps UI) serving 13,270 US stocks/ETFs, 34 futures, and SEC filings:
- Tiny tool surface, expressiveness in a typed DSL: only 7 tools instead of 40 overlapping endpoints; models write MonkQL, a Rust compiler runs it in 130ms median across 13k symbols.
- Compiler errors designed for LLM self-repair: parser recovers at the next clause and returns all type/unit errors in one round with exact hints, so models fix everything in one retry instead of hallucinating TradingView/SQL syntax.
- Dual-path MCP Apps output: stateless HTTP hosts don't preserve initialize capabilities, so they detect io.modelcontextprotocol/ui via per-request capability metadata (with ChatGPT request-hint fallbacks); UI hosts get summary + structuredContent + charts, non-UI hosts get full JSON.
- Separate read/write OAuth scopes: write consent for saved queries is optional with optimistic concurrency; brokerage accounts never touched.
More from coding & agent
- Sundar Pichai amplifies praise: Gemini Neon excels at product prototyping — sundarpichai · 2026-12-03
- Cybersecurity could double coding token demand and fill labs' 2027 ARR gap — zephyr_z9 · 2026-12-03
- AI filmmaking lessons: 3D layouts, face binding, prompt physics over adjectives — CurieuxExplorer · 2026-12-03
- Replit details new sandbox engine: Kubernetes-orchestrated microVMs starting 1M+ sandboxes daily — amasad · 2026-12-03
- Regulated-industry writer: AI drafts in seconds, but verifying it takes domain expertise — Ubunta · 2026-12-03
- Open-source PM tool Worklenz is building an MCP server for Claude and ChatGPT — GayanThakshila · 2026-12-03