Code Mode: the better way to use MCP
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
related reading
- Code execution with MCP: building more efficient AI agents \ Anthropicanthropic.com
- LLM Function-Calling vs. Model Context Protocol (MCP)gentoro.com
- Introducing Model Context Protocol (MCP) | Glamaglama.ai
- A Guide to Claude Code 2.0 and getting better at using coding agents – sankalp's blogsankalp.bearblog.dev
- Building Effective AI Agents \ Anthropicanthropic.com
- How I Use Claude Code | Philipp Spiessspiess.dev
- What if you don't need MCP at all?mariozechner.at
- What is the Model Context Protocol (MCP)? - Model Context Protocolmodelcontextprotocol.io
- A Deep Dive Into MCP and the Future of AI Tooling | Andreessen Horowitza16z.com
- Building Effective AI Agents \ Anthropicanthropic.com
- Thoughts on the MCPondr.sh
- Designing agentic loopssimonwillison.net