Co

Code Mode for MCP in MCP-use's client

Hacker News

Code Mode for MCP in MCP-use's client

Recently, Anthropic [ https://www.anthropic.com/engineering/code-execution-with-mc... ] and Cloudflare [ https://blog.cloudflare.com/code-mode/ ] released two blog posts that discuss a more efficient way for agents to interact with MCP servers, called Code Mode. There are three key issues when agents interact with MCP servers traditionally: - Context flooding - All tool definitions are loaded upfront, including ones that might not be necessary for a certain task. - Sequential execution overhead - Some operations require multiple tool calls in a chain. Normally, the agent must execute them sequentially and load intermediate return values into the context, wasting time and tokens (costing both time and money). - Code vs. tool calling - Models are better at writing code than calling tools directly. To solve these issues, they proposed a new method: instead of letting models perform direct tool calls to the MCP server, the client should allow the model to write code that calls the tools. This way, the model can write for loops and sequential operations using the tools, allowing for more efficient and faster execution. For example, if you ask an agent to rename all files in a folder to match a certain pattern, the traditional approach would require one tool call per file, wasting time and tokens. With Code Mode, the agent can write a simple for loop that calls the move_file tool from the filesystem MCP server, completing the entire task in one execution instead of dozens of sequential tool calls. We implemented Code Mode in mcp-use's (repo https://github.com/mcp-use/mcp-use ) MCPClient . All you need to do is define which servers you want your agent to use, enable code mode, and you're done! The client will expose two tools: - One that allows the agent to progressively discover which servers and tools are available - One that allows the agent to execute code in an environment where the MCP servers are available as Python modules (SDKs) Is this going against MCP? Not at all. MCP is the enabler of this approach. Code Mode can now be done over the network, with authentication, and with proper SDK documentation, all made possible by Model Context Protocol (MCP)'s standardized protocol. Hope you like it and have some improvements to propose :)

Share card

Actual performance

3points
3comments
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Product HuntOn track for Day 1 leaderboard · Strong signals: agents, agent, model · Missing: mac, macos, cursor
95%95% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Indie HackersFits the IH revenue-focused audience · Strong signals: including · Missing: supports, reddit linkedin, podcasting
77%77% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
Hacker NewsStrong engagement from HN community · Strong signals: filesystem, io, including · Missing: https docs, excited, just released
57%57% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
AppSumoStrong fit for a featured deal · Strong signals: efficient, calls · Missing: plus, platform, intuitive
53%53% predicted probability of success on AppSumo, based on ML models trained on real launch data.
TrustMRRLess likely to generate early MRR · Strong signals: way · Missing: mobile apps, ios, personal
35%35% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
13%13% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Incorrect prediction on native model

Similar products

Op
Optimizing JIT Compiler for Code Mode MCP52%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Optimizing JIT Compiler for Code Mode MCP

Hacker News1
Si
Sigh* Taco Bell MCP29%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Sigh* Taco Bell MCP

Hacker News1
MC
MCP Harbor – An MCP Registry25%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

MCP Harbor – An MCP Registry

Hacker News4
Code Mode
Code Mode93%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Slash MCP token usage by 68%

Product Hunt+141Open Source
Si
Signal MCP Client39%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Signal MCP Client

Hacker News2
Mc
Mcp-use – Connect any LLM to any MCP50%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Mcp-use – Connect any LLM to any MCP

Hacker News155
Co
Context Mode – 315 KB of MCP output becomes 5.4 KB in Claude Code32%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Context Mode – 315 KB of MCP output becomes 5.4 KB in Claude Code

Hacker News84
Co
Context Mode – 315 KB of MCP output becomes 5.4 KB in Claude Code40%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Context Mode – 315 KB of MCP output becomes 5.4 KB in Claude Code

Hacker News1
Tr
Trello Compact Mode60%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Trello Compact Mode

Hacker News4
at
attract mode likes56%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

attract mode likes

Hacker News2