<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/code-mode-the-better-way-to-use-mcp-lhuoafkfq" -->

---
title: Code Mode: the better way to use MCP | daily.dev
description: Cloudflare introduces "Code Mode" for MCP (Model Context Protocol), where instead of exposing tools directly to LLMs, the system converts MCP tools into...
canonical: https://daily.dev/posts/code-mode-the-better-way-to-use-mcp-lhuoafkfq
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Code Mode: the better way to use MCP | daily.dev
og:description: Cloudflare introduces "Code Mode" for MCP (Model Context Protocol), where instead of exposing tools directly to LLMs, the system converts MCP tools into...
og:url: https://daily.dev/posts/code-mode-the-better-way-to-use-mcp-lhuoafkfq
og:image: https://api.daily.dev/og/posts/lHuOAfKfQ.png
og:image:alt: Code Mode: the better way to use MCP
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Code Mode: the better way to use MCP

**[Cloudflare](https://daily.dev/sources/cloudflare)** · 15 min read · 2 upvotes · 0 comments

## Summary

Cloudflare introduces "Code Mode" for MCP (Model Context Protocol), where instead of exposing tools directly to LLMs, the system converts MCP tools into TypeScript APIs and asks LLMs to write code that calls these APIs. This approach leverages LLMs' superior code-writing abilities compared to tool-calling, enables handling of more complex tools, and improves efficiency when chaining multiple calls. The implementation uses Cloudflare Workers' V8 isolates for secure sandboxing, with a new Worker Loader API that creates lightweight, millisecond-startup sandboxes for executing agent-generated code.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.cloudflare.com/code-mode/>

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#cloudflare](https://daily.dev/tags/cloudflare), [#llm](https://daily.dev/tags/llm), [#mcp](https://daily.dev/tags/mcp), [#typescript](https://daily.dev/tags/typescript)

[View this post on daily.dev](https://daily.dev/posts/code-mode-the-better-way-to-use-mcp-lhuoafkfq)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Code Mode: the better way to use MCP","url":"https://daily.dev/posts/code-mode-the-better-way-to-use-mcp-lhuoafkfq","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/code-mode-the-better-way-to-use-mcp-lhuoafkfq"},"datePublished":"2025-09-26T13:44:27.540Z","dateModified":"2026-03-15T04:01:28.773Z","description":"Cloudflare introduces \"Code Mode\" for MCP (Model Context Protocol), where instead of exposing tools directly to LLMs, the system converts MCP tools into...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/67c6f6f87b90e25fabf46d11f0084e7f?_a=AQAEulh","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/67c6f6f87b90e25fabf46d11f0084e7f?_a=AQAEulh","isAccessibleForFree":true,"articleSection":"Cloudflare","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Cloudflare","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/38522e1d11354cd6b7af66f9d4316735","url":"https://daily.dev/sources/cloudflare"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/code-mode-the-better-way-to-use-mcp-lhuoafkfq","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-agents,cloudflare,llm,mcp,typescript","timeRequired":"PT15M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Cloudflare","item":"https://daily.dev/sources/cloudflare"},{"@type":"ListItem","position":3,"name":"Code Mode: the better way to use MCP"}]}
```

