AI Research Atlas

Code execution with MCP

Anthropic · 4 November 2025

Having agents write code to call MCP tools cut one example's token use from 150,000 to 2,000, a 98.7% saving.

Direct tool calls load every tool definition and pass results through the model. Presenting MCP servers as code APIs lets agents load only needed definitions and process data in a sandbox, saving context and cost. Cloudflare reported a similar finding.

Date
Tuesday, 4 November 2025
Lab
Anthropic
Kind
paper
Access
paper only

Figures

MeasureValueMeasured by
Token use in example workflow150,000 to 2,000 tokens (-98.7%)
code execution instead of direct tool calls
company

Single illustrative example, not a benchmark; the same idea underlies programmatic tool calling.

Sources

  1. www.anthropic.com/engineering/code-execution-with-mcp

This record was checked against its sources on 6 October 2026. How we check

Related