Close Menu
  • AI
  • Content Creation
  • Tech
  • Robotics
AI-trends.todayAI-trends.today
  • AI
  • Content Creation
  • Tech
  • Robotics
Trending
  • GitNexus, an Open-Source Knowledge Graph Engine that is MCP Native and Gives Claude Coding and Cursor Complete Codebase Structure Awareness
  • Deepgram Python SDK Implementation for Transcription and Async Processing of Audio, Async Text Intelligence, and Async Text Intelligence.
  • DeepSeek AI releases DeepSeek V4: Sparse attention and heavily compressed attention enable one-million-token contexts.
  • AI-Designed drugs by a DeepMind spinoff are headed to human trials
  • Apple’s new CEO must launch an AI killer product
  • OpenMythos Coding Tutorial: Recurrent-Depth Transformers, Depth Extrapolation and Mixture of Experts Routing
  • 5 Reasons to Think Twice Before Using ChatGPT—or Any Chatbot—for Financial Advice
  • OpenAI Releases GPT-5.5, a Absolutely Retrained Agentic Mannequin That Scores 82.7% on Terminal-Bench 2.0 and 84.9% on GDPval
AI-trends.todayAI-trends.today
Home»Tech»Code execution with MCP is a new approach that Anthropic uses to turn MCP agents into Code First Systems.

Code execution with MCP is a new approach that Anthropic uses to turn MCP agents into Code First Systems.

Tech By Gavin Wallace08/11/20255 Mins Read
Facebook Twitter LinkedIn Email
NVIDIA Introduces ProRL: Long-Horizon Reinforcement Learning Boosts Reasoning and Generalization
NVIDIA Introduces ProRL: Long-Horizon Reinforcement Learning Boosts Reasoning and Generalization
Share
Facebook Twitter LinkedIn Email

The Model Context Protocol MCP has a problem with scaling. The context window pushes every tool definition, and each intermediate result through it. This means that large workflows quickly burn tokens or reach their latency and costs limits. Anthropic’s new ‘code execution with MCP’ pattern This pipeline is restructured by turning MCP Tools into APIs at the code level and asking models to run and write code, instead of calling directly tools.

MCP Tools as Direct Model Calls

MCP, an open standard, allows AI systems to communicate with other external systems using MCP servers. The tools allow a model to query databases, use APIs or access files via a single interface.

In default patterns, agents load many tool definitions to the model context. Every tool definition includes schema and metadata. The context is also notified of the intermediate results for each tool.

Anthropic describes an example where an agent would use an MCP Server for Google Drive in order to retrieve a lengthy sales meeting transcript, and then update the record using another MCP Server for Salesforce. First, the full transcript will be returned via the model. Then it will be sent again once the Salesforce tool has been called. This can result in tens or thousands of tokens being added to a meeting that is long.

The pattern will not scale when there are numerous MCP Servers and tools. It is profitable to use large catalogs of tools and move payloads from one tool to another. Costs increase, latency grows, and system behavior becomes more rigid as context limitations are imposed.

MCP Servers are now coded APIs

Anthropic proposes to embed MCP within a loop of code execution. The MCP client does not let the model directly call the tools, but instead exposes the code modules of each server in a filesystem. TypeScript is used by the model to compose and import these modules. The code then runs within a sandboxed system.

There are three steps to the design.

  1. The MCP Client generates an directory like You can also find out more about the following: This mirrors all the MCP server and tool options.
  2. The MCP creates, for each tool in the MCP, a thin wrapping function that is implemented within a file source, such as servers/google-drive/getDocument.tsThis internally invokes the MCP Tool with parameters typed.
  3. The model must write TypeScript that runs the functions imported, handles data flow inside execution environments, controls control flow within them and imports those functions.

The previous Google Drive and Salesforce work flow becomes a script. The script uses the Google Drive wrapper to manipulate or inspect the data, and then invokes the Salesforce Wrapper. Only the summary and the small sample or final transcripts are passed through to the model.

Cloudflare’s ‘Code Mode’ work uses the same idea in its Workers platform. The MCP tool is converted into TypeScript and model-generated code runs inside an isolated with restricted bindings.

Token usage falls by 987 percent.

Anthropic is a good example. The workflow, which consumed approximately 150,000 tokens before when the tools and data intermediates were directly passed through the model has been reimplemented using code execution APIs and MCP filesystem-based APIs. This new pattern only used 2,000 tokens. The tokens were used 98.7 % less in this scenario. Cost and latency are also lower.

Agent builders can benefit from design benefits

The code execution of MCP offers several benefits to engineers that design agents.

Progressive tool discoveryAgents do not require all definitions of tools in context. This allows it to explore the created filesystem and list all available servers. It will only read certain tool modules if they are needed. It moves tool catalogs out of the model context and into code so tokens only go towards relevant interfaces.

Context efficient data handling: The execution environment is able to handle large datasets. TypeScript code, for instance, can be used to read through a spreadsheet using an MCP, filter columns, compute aggregates and then log back only small sample data and summary stats. Code does all the work, while the model only sees the compact version of the data.

Operation privacy preservingThe Anthropic pattern describes how sensitive fields, such as phone or email addresses are tokenized within the execution environment. While the model only sees placeholders in its execution environment, MCP maintains secure mappings and returns real values to downstream tools. The data can move freely between MCP servers, without having to reveal raw identifiers.

Skills that are reusable and state-specificAgents can store scripts and intermediate files in the filesystem. The filesystem allows agents to store scripts and intermediate files. The following are some of the skills that you can learn. Directory and import in subsequent sessions. Anthropic equates this with Claude Skills.

Anthropic’s ‘code execution with MCP’ approach is a sensible next step for MCP powered agents. The MCP server is presented as a code API, which pushes work to an isolated TypeScript runtime. This directly targets the costs of routing large results and loading tools definitions. Agents become more efficient and teams are forced to consider code execution security. This launch converts MCP, which was a list of tools into an API that is executable.


Michal is a professional in the field of data science with a Masters of Science degree from University of Padova. Michal is a data scientist with a background in machine learning, statistical analysis and data engineering.

🙌 Follow MARKTECHPOST: Add us as a preferred source on Google.

anthropic stem x
Share. Facebook Twitter LinkedIn Email
Avatar
Gavin Wallace

Related Posts

GitNexus, an Open-Source Knowledge Graph Engine that is MCP Native and Gives Claude Coding and Cursor Complete Codebase Structure Awareness

25/04/2026

Deepgram Python SDK Implementation for Transcription and Async Processing of Audio, Async Text Intelligence, and Async Text Intelligence.

25/04/2026

DeepSeek AI releases DeepSeek V4: Sparse attention and heavily compressed attention enable one-million-token contexts.

24/04/2026

OpenMythos Coding Tutorial: Recurrent-Depth Transformers, Depth Extrapolation and Mixture of Experts Routing

24/04/2026
Top News

Anthropic agrees to pay authors at least $1.5 billion in AI Copyright Settlement

The Viral Storm Streamers Predicting Deadly Tornadoes—Sometimes Faster Than the Government

Gemini on Google Home keeps mistaking my dog for a cat

Three Actionable AI recommendations for Business in 2026

Grammarly Is Offering ‘Expert’ AI Reviews From Your Favorite Authors—Dead or Alive

Load More
AI-Trends.Today

Your daily source of AI news and trends. Stay up to date with everything AI and automation!

X (Twitter) Instagram
Top Insights

Google AI introduces VISTA, a test time self-improving agent for text to video generation

22/10/2025

The Full Information to Utilizing Tales to Enhance Engagement + Attain

09/07/2025
Latest News

GitNexus, an Open-Source Knowledge Graph Engine that is MCP Native and Gives Claude Coding and Cursor Complete Codebase Structure Awareness

25/04/2026

Deepgram Python SDK Implementation for Transcription and Async Processing of Audio, Async Text Intelligence, and Async Text Intelligence.

25/04/2026
X (Twitter) Instagram
  • Privacy Policy
  • Contact Us
  • Terms and Conditions
© 2026 AI-Trends.Today

Type above and press Enter to search. Press Esc to cancel.