frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Code Mode for MCP in MCP-use's client

2•pzullo•1h ago
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 :)

Comments

luigipederzani•35m ago
One thing I’ve been thinking about: Should Code Mode live purely in the MCP client, or could there be real value in having MCP servers also expose a “code mode” execution surface themselves?

For some mcp servers, having domain-specific batch operations or embedded execution could unlock more efficient workflows.

ndimares•6m ago
We literally just did something like this on Gram, not exactly what you're saying, but it's pretty close... https://www.speakeasy.com/blog/how-we-reduced-token-usage-by...

We have a platform (Gram) which is serverless MCP. Now users can launch MCP servers that only have 3 tools, search, describe, execute. Gram handles the tool routing, and execution (acting sort of like the sandbox). So the client only ever needs to know about those three tools. Everything else is abstracted.

Re: Why Do You Need Big Tech for Your SSG?

https://ldstephens.net/blog/re-why-do-you-need-big-tech-for-your-ssg-kev-quirk/
1•speckx•39s ago•0 comments

Gary Mani Mounfield of the Stone Roses and Primal Scream Dead at 63

https://www.manchestereveningnews.co.uk/news/greater-manchester-news/gary-mani-dead-stone-roses-3...
1•jjgreen•1m ago•0 comments

OpenAI enables group chats in ChatGPT

https://openai.com/index/group-chats-in-chatgpt/
1•s1mon•2m ago•1 comments

Android Developer Verification Article on Consumer Rights Wiki

https://consumerrights.wiki/index.php?title=Android_Developer_Verification
1•goplayoutside•2m ago•0 comments

Parallel Extract API

https://parallel.ai/blog/introducing-parallel-extract
1•lukaslevert•2m ago•0 comments

Attack, defend, pursue—the Space Force's new naming scheme foretells new era

https://arstechnica.com/space/2025/11/attack-defend-pursue-the-space-forces-new-naming-scheme-for...
1•CharlesW•3m ago•0 comments

Peter Molyneux became a game developer due to a mix-up of Commodore

https://noc.social/@todayilearned/115583291635814367
1•doener•4m ago•0 comments

Show HN: Investigating why GPT-5 has made ChatGPT 'broken'

https://muhammadasmulkana.substack.com/p/why-chatgpt-feels-broken-since-the
1•muhammad-shafat•5m ago•0 comments

Is a bad flu season on the way? Experts see reason to be anxious

https://www.statnews.com/2025/11/20/flu-season-2025-vaccinations-still-helpful-h3n2-subclade-k/
2•bikenaga•5m ago•0 comments

Layanan Agoda Indonesia

1•reisrenzo•5m ago•0 comments

iPhone Users Can Now AirDrop Files to Android Devices

https://www.macrumors.com/2025/11/20/iphone-android-airdrop-quickshare/
2•tosh•11m ago•1 comments

Make product worse, get money

https://dynomight.substack.com/p/worse
1•crescit_eundo•13m ago•0 comments

Pkgstore.io

https://mfkl.github.io/2025/11/20/introducing-pkgstore.html
1•speckx•13m ago•0 comments

Launch HN: Poly (YC S22) – Cursor for Files

4•aabhay•15m ago•1 comments

Kvantify announces Qrunch for advanced quantum chemistry calculations

https://www.kvantify.com/products/qrunch
1•clemensnk•15m ago•0 comments

FreeSQL – Try Oracle Database SQL Without Login

https://freesql.com/
1•bprasanna•18m ago•1 comments

Unlocking the genomic repertoire of a cultivated megaphage

https://www.nature.com/articles/s44298-025-00150-9
1•PaulHoule•18m ago•0 comments

Thinking Machines

https://en.wikipedia.org/wiki/Thinking_Machines_Corporation
1•nikhizzle•19m ago•0 comments

Disruption with Some GitHub Services

https://www.githubstatus.com/incidents/zzl9nl31lb35
2•sudmishra•19m ago•0 comments

Complex Desmos – Interactive 3D Complex Function Explorer

https://complex-desmos.streamlit.app/
1•usbheadphones•20m ago•0 comments

Why Movies Don't Feel Real Anymore: A Close Look at Changing Filmmaking

https://www.openculture.com/2025/11/why-movies-dont-feel-real-anymore.html
1•speckx•21m ago•1 comments

Salesforce customer data theft via Gainsight breach possibly ShinyHunters

https://www.bleepingcomputer.com/news/security/salesforce-investigates-customer-data-theft-via-ga...
1•aiisjustanif•21m ago•0 comments

Hey Gemini 3, create a web game where the world is invisible until you paint it

https://www.fachords.com/static/inkmaze.html
2•giancaIta•22m ago•0 comments

Platonic space: where cognitive and morphological patterns come from

https://thoughtforms.life/platonic-space-where-cognitive-and-morphological-patterns-come-from-bes...
1•abracos•23m ago•0 comments

Probabilistic Programming and Echo Debugging on Quantica

https://github.com/Quantica-Foundation/quantica-lang
1•gurukasi2006•23m ago•0 comments

Ursula, Break Up Google

https://peoplevsbig.tech/standupursula/
3•vincvinc•27m ago•0 comments

AGI Doesn't Need More Parameters – It Needs an Epistemic Loop

https://www.researchgate.net/publication/397730862_Coherence_Over_Truth_On_Minds_Models_and_Reality
2•swirljak•30m ago•1 comments

Moss survived in space for nine months, study finds

https://www.nbcnews.com/science/space/moss-survived-outside-space-station-rcna244507
3•ceejayoz•35m ago•0 comments

How AI will change software engineering – with Martin Fowler [video]

https://www.youtube.com/watch?v=CQmI4XKTa0U
2•CharlesW•37m ago•0 comments

Macrophage-targeted immunocytokine for cancer immunotherapy

https://www.cell.com/cell/abstract/S0092-8674(25)01235-8?_returnURL=https%3A%2F%2Flinkinghub.else...
2•wslh•38m ago•0 comments