flâneur — a map of the web's best reading

Code Mode: the better way to use MCP

blog.cloudflare.com · 3,104 words · saved by 1 readers

It turns out we've all been using MCP wrong. Most agents today use MCP by exposing the "tools" directly to the LLM. We tried something different: Convert the MCP tools into a TypeScript API, and then ask an LLM to write code that calls that API. The results are striking.

It turns out we've all been using MCP wrong. Most agents today use MCP by directly exposing the "tools" to the LLM . We tried something different: Convert the MCP tools into a TypeScript API, and then ask an LLM to write code that calls that API. The results are striking: We found agents are able to handle many more tools, and more complex tools, when those tools are presented as a TypeScript API rather than directly. Perhaps this is because LLMs have an enormous amount of real-world TypeScript in their training set, but only a small set of contrived examples of tool calls. The approach really

Explore this link on the map →

related reading