Skills + Code Mode MCP: using hundreds of tools without bloating agent context
ievkz · reddit · 2026-11-13
While building Nanabot (a personal coding agent) and a company MCP server, the author hit a known problem: detailed descriptions of many MCP methods bloat the LLM's context, yet hiding them behind Code Mode MCP means the agent sometimes can't find — or doesn't realize it should look for — the right method.
Context from Cloudflare: with 2,500+ API methods, representing all as MCP tools would take 1.17M tokens. Cloudflare's Code Mode MCP gives the agent just two primitives:
- search() — find needed API methods and fetch signatures on demand;
- execute() — run JavaScript that calls those methods, combining multiple MCP calls in one shot without round-tripping to the LLM.
The post walks through an aggregator implementation (e.g., tools.filter(...) matching navigate/screenshot by name) and notes this isn't universal syntax — Cloudflare's search operates over an OpenAPI spec. Token savings depend on catalog size, search frequency, and call count; accurate measurement needs testing on concrete tasks.
Related event: Code Mode MCP in Practice: Replacing Thousands of Tools with Two Endpoints(3 posts)→
More from coding & agent
- Product idea: cloud Android VMs and home WiFi proxies to make agents look human — Darpinian · 2026-11-29
- 38 free agent skills distilled from shipping three live AI products — PawelHuryn · 2026-11-29
- Step 5: run evals on synthetic data pre-launch, watch real traces after — PawelHuryn · 2026-11-29
- Agent build costs: Messages API $0.003/msg vs Agent SDK $0.041 in real test — PawelHuryn · 2026-11-29
- Break your agent before attackers do: 6 tests mapped to OWASP LLM Top 10 — PawelHuryn · 2026-11-29
- Step 1: have Claude draft an agent card before building your embedded agent — PawelHuryn · 2026-11-29