Original: Anthropic Engineering · 31/01/2026
Summary
Connecting agents to tools and data traditionally requires a custom integration for each pairing, creating fragmentation and duplicated effort that makes it difficult to scale truly connected systems. The Model Context Protocol (MCP) is an open standard for connecting AI agents to external systems. Connecting agents to tools and data traditionally requires a custom integration for each pairing, creating fragmentation and duplicated effort that makes it difficult to scale truly connected systems.Key Insights
“Connecting agents to tools and data traditionally requires a custom integration for each pairing, creating fragmentation and duplicated effort that makes it difficult to scale truly connected systems.” — Discussing the challenges faced by developers in integrating AI agents with external systems before MCP.
“As MCP usage scales, there are two common patterns that can increase agent cost and latency: Tool definitions overload the context window; Intermediate tool results consume additional tokens.” — Highlighting the main issues with scaling MCP usage in terms of cost and latency.
“With code execution environments becoming more common for agents, a solution is to present MCP servers as code APIs rather than direct tool calls.” — Introducing a solution to improve efficiency by using code execution environments for MCP.
Topics
Full Article
Published: 2026-01-31
Source: https://www.anthropic.com/engineering/code-execution-with-mcp
The Model Context Protocol (MCP) is an open standard for connecting AI agents to external systems. Connecting agents to tools and data traditionally requires a custom integration for each pairing, creating fragmentation and duplicated effort that makes it difficult to scale truly connected systems. MCP provides a universal protocol—developers implement MCP once in their agent and it unlocks an entire ecosystem of integrations. Since launching MCP in November 2024, adoption has been rapid: the community has built thousands of MCP servers , SDKs are available for all major programming languages, and the industry has adopted MCP as the de-facto standard for connecting agents to tools and data. Today developers routinely build agents with access to hundreds or thousands of tools across dozens of MCP servers. However, as the number of connected tools grows, loading all tool definitions upfront and passing intermediate results through the context window slows down agents and increases costs. In this blog we’ll explore how code execution can enable agents to interact with MCP servers more efficiently, handling more tools while using fewer tokens. Excessive token consumption from tools makes agents less efficient As MCP usage scales, there are two common patterns that can increase agent cost and latency: Tool definitions overload the context window; Intermediate tool results consume additional tokens.
- Tool definitions overload the context window Most MCP clients load all tool definitions upfront directly into context, exposing them to the model using a direct tool-calling syntax. These tool definitions might look like: gdrive.getDocument
Key Takeaways
Notable Quotes
Connecting agents to tools and data traditionally requires a custom integration for each pairing, creating fragmentation and duplicated effort that makes it difficult to scale truly connected systems.Context: Discussing the challenges faced by developers in integrating AI agents with external systems before MCP.
As MCP usage scales, there are two common patterns that can increase agent cost and latency: Tool definitions overload the context window; Intermediate tool results consume additional tokens.Context: Highlighting the main issues with scaling MCP usage in terms of cost and latency.
With code execution environments becoming more common for agents, a solution is to present MCP servers as code APIs rather than direct tool calls.Context: Introducing a solution to improve efficiency by using code execution environments for MCP.
Related Topics
- [[topics/software-development]]
- [[topics/efficiency-in-computing]]
- [[topics/protocol-standards]]
- [[topics/ai-integration]]
Related Articles
Writing effective tools for agents — with agents
Anthropic Engineering · how-to · 78% similar
A Model Context Protocol Server (MCP) for Microsoft Paint
Geoffrey Huntley · explanation · 74% similar
Streamlinear, a new MCP for Linear
Jesse Chen · explanation · 72% similar
Originally published at https://www.anthropic.com/engineering/code-execution-with-mcp.