Code Mode: turning MCP tools into TypeScript APIs cut agent context from 150k to 2k tokens
blaizedsouza · x · 2026-12-01
Cloudflare's Code Mode approach converts MCP tools into a TypeScript API and has the LLM write code to call them, executed in a sandbox with results filtered before reaching the model. Context drops from 150,000 to 2,000 tokens on the first turn (98.7% less), agents handle far more and more complex tools, and multi-step chains no longer waste tokens relaying intermediate outputs. Includes a 7-rule playbook: tools → files → execution → filter → response.
More from coding & agent
- User finds mystery $2,000 in Cursor/Grok build credits expiring in 15 days — Daniel_Farinax · 2026-12-01
- Dev running an 8-hour-a-day software factory hits limits of two $20 coding agent plans — andfanilo · 2026-12-01
- Compact MoE coding tests across 20 model-harness pairings show the harness decides which issues get solved — Pawel Zarzycki · 2026-12-01
- NVIDIA open-sources Auto Ontology to fix text-to-SQL agent reliability — bigaiguy · 2026-12-01
- OpenLIT: one-line OpenTelemetry-native observability for AI agent harnesses — thisguyknowsai · 2026-12-01
- Fortune 500 Firms Spend 6 Months Picking AI Tools They'll Replace Within a Year — blaizedsouza · 2026-12-01