---
title: "Cloudflare Code Mode: Does 1,000 Tokens Mean MCP Is Dead?"
date: "2026-11-12"
video_id: "7707386609120857375"
tiktok_url: "https://www.tiktok.com/@maxwealthtech/video/7707386609120857375"
creator: "@maxwealthtech"
category: "Coding"
tags: ["cloudflare code mode", "mcp", "model context protocol", "goose", "programmatic tool calling"]
excerpt: "Cloudflare's Code Mode covers 2,500+ API endpoints in about 1,000 tokens instead of 1.17 million. It still runs on MCP, which a \"RIP MCP\" TikTok misses."
---
Cloudflare's Code Mode lets an AI agent use the entire Cloudflare API, over 2,500 endpoints, through two tools that take code, in about 1,000 tokens. The same API exposed as one MCP tool per endpoint would take about 1.17 million tokens. A TikTok from Max Parker (@maxwealthtech) gets those numbers right but frames them as "RIP MCP." Code Mode still runs on MCP, and the video's own last frame tags MCP "ALIVE."

## What is Cloudflare Code Mode?

Code Mode changes how an agent uses tools. Instead of loading a schema for every tool and calling them one at a time, the agent writes code that calls the tools, and that code runs in a sandbox.

The idea first appeared in Cloudflare's post "Code Mode," dated September 26, 2025, by Kenton Varda and Sunil Pai. In that design, the Agents SDK fetches an MCP server's schema and generates a TypeScript API with doc comments. The agent gets one tool that runs TypeScript in a V8 isolate with no internet access. The sandbox reaches MCP servers only through bindings that call back into the agent loop, which holds the credentials.

The authors argue that passing each tool result through the model just to copy it into the next call wastes time, compute and tokens. The video makes the same complaint about round trips.

## Does Code Mode really cut tokens from 1.17 million to 1,000?

Yes, for Cloudflare's own API. The video says "Cloudflare has over 2,500 endpoints. Code mode covers every single one with just search and execute in about 1,000 tokens, down from 1.17 million."

Cloudflare's February 20, 2026 post by Matt Carey, "Code Mode: give agents an entire API in 1,000 tokens," supports each part. The Cloudflare API has over 2,500 endpoints. The Code Mode server uses about 1,000 tokens through two tools, `search()` and `execute()`. An equivalent MCP server without Code Mode would use 1.17 million tokens.

Cloudflare's developer docs give a comparison table:

| Approach | Tools | Tokens |
|---|---|---|
| Native MCP, full schemas | 2,594 | about 1,170,000 |
| Native MCP, required parameters only | 2,594 | about 244,000 |
| Code Mode | 2 | about 1,000 |

## Caveats the video leaves out

**There is more than one baseline.** The blog post also says exposing every endpoint as its own tool "would consume over 2 million tokens." The docs table adds the 244,000-token row, which cuts the saving from about 1,170 times to about 244 times when optional parameters are dropped.

**The baseline is hypothetical.** Nobody ships 2,594 separate tool definitions to a model. Cloudflare itself says that much exceeds the context window of most foundation models.

**It is one very large API.** Cloudflare's docs say Code Mode stays at about 1,000 tokens no matter how many endpoints exist. That is a property of the search-then-execute design, not a result measured across many agents.

**The exact figure is unsourced.** The video's on-screen number, "1,169,837 tokens," is more precise than anything on Cloudflare's pages, which say 1.17 million or about 1,170,000.

## Two releases, one sentence

The video says "Cloudflare solved this with code mode. It turns MCP tools into a TypeScript API, letting the LLM write code in an isolated sandbox instead of spamming tool calls." That describes the September 2025 design.

The 1,000-token result comes from the February 2026 server. There, `search()` queries the OpenAPI spec and `execute()` makes Cloudflare API requests. Both take JavaScript async arrow functions. The code runs in a Dynamic Worker, a V8 isolate with no file system and no environment variables, with outside fetches off by default. The two designs are five months apart.

## Does Goose use Code Mode?

Yes. The video says "Block uses it in Goose." Cloudflare's February 2026 post says Goose implements Code Mode. Goose's own December 21, 2025 post says its author learned of the concept from a Cloudflare blog post. Block created Goose as an open-source agent, so "Block uses it" is loose wording for an idea Goose borrowed from Cloudflare.

## Is Anthropic's programmatic tool calling the same thing?

It is the same pattern with a separate implementation. The video says "Anthropic calls it programmatic tool calling." Anthropic's docs describe Programmatic tool calling as a feature that lets Claude call your tools from code in the code execution container, cutting round trips and token use. It requires the code execution tool at version `code_execution_20260120` or later.

Cloudflare's post says Anthropic's Claude SDK implements Code Mode as Programmatic Tool Calling, and that Anthropic explored the same pattern on its own in its "Code Execution with MCP" post. No source says Anthropic renamed Cloudflare's feature. Cloudflare's code runs in a Cloudflare V8 isolate, while Anthropic's runs in Anthropic's code execution container.

## Is MCP dead?

No. The video opens on a gravestone reading "RIP," "MCP" and "2024 - ?" and ends with "Classic MCP usage is done." The sources say otherwise.

Cloudflare's docs list the Code Mode server under "Cloudflare API MCP server." The 1,000-token result comes from an MCP server with two tools. Goose's December 2025 post, titled "Code Mode doesn't replace MCP," says "many people claimed it was a replacement for MCP" and then states "Code Mode still uses MCP under the hood." It compares the two to HTTP and REST: MCP is the protocol, and Code Mode is a more efficient way to use it.

The video's final frame shows a gravestone labelled "THE OLD WAY" with the MCP logo beside it tagged "ALIVE." That image matches the sources. What Code Mode replaces is loading one tool schema per endpoint, not MCP.

## Bottom line

Cloudflare's Code Mode server does cover over 2,500 endpoints in about 1,000 tokens, against 1.17 million for full per-endpoint schemas or 244,000 with required parameters only. It is itself an MCP server. Goose and Anthropic use the same pattern, and none of them treat it as a replacement for MCP.

## Sources

- [Code Mode: give agents an entire API in 1,000 tokens, Cloudflare blog (Matt Carey), 2026-02-20](https://blog.cloudflare.com/code-mode-mcp/): endpoints, the two tools, token baselines, the Dynamic Worker sandbox, and the Goose and Anthropic mentions.
- [Code Mode, Cloudflare blog (Kenton Varda and Sunil Pai), 2025-09-26](https://blog.cloudflare.com/code-mode/): the original TypeScript API design and the round-trip argument.
- [Cloudflare MCP servers docs](https://developers.cloudflare.com/agents/model-context-protocol/cloudflare/servers-for-cloudflare/): the token comparison table.
- [Code Mode doesn't replace MCP, Goose blog, 2025-12-21](https://goose-docs.ai/blog/2025/12/21/code-mode-doesnt-replace-mcp): Code Mode running on MCP and its Cloudflare origin.
- [Programmatic tool calling, Claude Platform docs](https://platform.claude.com/docs/en/agents-and-tools/tool-use/programmatic-tool-calling): the feature description and required tool version.


## Video description and verification notes

**The file is a 49.91 s, 720x1280 (9:16) MP4 container (isom) with H.264 High video at 30 fps and 321,104 bit/s, plus HE-AACv2 stereo audio at 44.1 kHz and 64,189 bit/s. The container bitrate is 391,707 bit/s and the filesize is 2,443,961 bytes, confirmed with ffprobe (video stream 49.87 s, audio stream 49.91 s). @maxwealthtech (nickname "Max Parker") posted it at epoch 1794515794, which is 2026-11-12 20:36:34 UTC. The audio credit is "original sound - Max Parker". The description runs about 480 characters and carries five hashtags, including #mcp, #cloudflare and #aiagents. Engagement at archive capture (2026-11-13T13:01:03Z) was 8,164 views, 177 likes, 2 comments, 55 reposts and 159 saves. I read 7 of the staged 2-second frames (001, 005, 010, 014, 018, 022, 025), fewer than the 10-15 the spec asks for, so any card between those frames is unread. Frame N falls at roughly 2N seconds, judging by the burned-in word captions. Frame 001 shows a gravestone card reading "RIP", the MCP logo, "MCP" and "2024 - ?", with a presenter on camera below and a lower-third caption "MCP". Frame 005 shows a card with a "01 · MCP" tab, "How agents use tools", an "AI AGENT" icon wired through MCP to GitHub, Slack, Notion, Gmail and Linear, and a "THE STANDARD" pill, captioned "but". Frame 010 is a mid-transition blur of a "03 · CODE MODE" card reading "Models know", captioned "while". Frame 014 shows "Tools become TypeScript" with a code block `declare const codemode: { findCustomer(name: string): Promise<Customer>; getOrders(id: string): Promise<Order[]>; };`, an agent icon labelled "writes code" and four chained `call()` pills, captioned "LLM". Frame 018 shows "04 · THE WIN", "A huge win for Cloudflare", a dot grid and a "2,500+ ENDPOINTS" pill. Frame 022 shows `search()` and `execute()` buttons, "Code Mode ~1,000 tokens", "The old way 1,169,837 tokens" and the footnote "Cloudflare's numbers for its own MCP server (Feb 2026). 1.17M tokens is more than a whole context window." Frame 025 shows "The old way is." over a gravestone labelled "THE OLD WAY 2024 - ?", with a small MCP logo beside it tagged "ALIVE". No terminal, repository, URL or live demo of Code Mode running appears in any frame I read. The spoken argument (10 Whisper segments, about 120 words) says MCP tool chaining wastes tokens and round trips, that Cloudflare fixed this with Code Mode, and that classic MCP usage is done. The last transcript segment ends at 49.68 s and the audio runs 49.91 s, so no text lies past the audio and the transcript is genuine. Product names (Cloudflare, Goose, Block, Anthropic) match the on-screen captions and the sources below.**

## The 1.17 million to 1,000 token figure is accurate, with a baseline caveat

At 34.48 s the video says "Cloudflare has over 2,500 endpoints. Code mode covers every single one with just search and execute in about 1,000 tokens, down from 1.17 million." Cloudflare's February 2026 post by Matt Carey, "Code Mode: give agents an entire API in 1,000 tokens", backs each part. It gives the Cloudflare API as having over 2,500 endpoints and the Code Mode server as using roughly 1,000 tokens. It names two tools, `search()` and `execute()`, and says an equivalent MCP server without Code Mode would use 1.17 million tokens. Cloudflare's developer docs carry a comparison table. Native MCP with full schemas lists 2,594 tools at about 1,170,000 tokens, native MCP with required parameters only lists 2,594 tools at about 244,000 tokens, and Code Mode lists 2 tools at about 1,000 tokens.

The video omits several caveats. The same blog post says exposing every endpoint as its own MCP tool "would consume over 2 million tokens", so Cloudflare gives two baselines, 2 million and 1.17 million, depending on how the schemas are counted. The docs add the 244,000-token row, which cuts the saving to about 244 times instead of about 1,170 times when optional parameters are stripped. The on-screen figure "1,169,837 tokens" in frame 022 is more precise than anything in the Cloudflare pages I fetched, which say 1.17 million or about 1,170,000. I could not trace the exact digits, so I could not source that precision. The frame footnote "Feb 2026" matches the blog date of February 20, 2026. The baseline is also hypothetical, since nobody ships 2,594 separate tool definitions to a model. Cloudflare itself says that much exceeds the context window of most foundation models.

## "Cloudflare solved this with code mode" compresses two separate releases

At 19.78 s the video says "Cloudflare solved this with code mode. It turns MCP tools into a TypeScript API, letting the LLM write code in an isolated sandbox instead of spamming tool calls." Cloudflare's earlier post, "Code Mode", dated September 26, 2025 and credited to Kenton Varda and Sunil Pai, is where the TypeScript idea originates. It says the Agents SDK fetches an MCP server's schema and generates a TypeScript API with doc comments from it. The agent then gets one tool that executes TypeScript in a V8-isolate sandbox with no internet access. That sandbox reaches MCP servers only through bindings that call back into the agent loop, which holds the credentials. The authors argue that passing each tool result through the model just to copy it into the next call wastes time, compute and tokens, which matches the video's round-trip complaint and the frame 014 illustration.

The 1,000-token result comes from a different, later product. The February 2026 post describes a server for the Cloudflare API with two tools, `search()` and `execute()`, each taking a code string. `search()` queries the OpenAPI spec and `execute()` makes Cloudflare API requests. The generated code runs in a Dynamic Worker, a V8 isolate with no file system and no environment variables, with external fetches disabled by default. That post says the server's tools take JavaScript async arrow functions, and it uses TypeScript only to describe the client-side Code Mode. So the video's sentence that Code Mode "turns MCP tools into a TypeScript API" and the 1,000-token result belong to two designs five months apart. The phrasing fairly summarizes the 2025 design but does not describe the 2026 server behind the number.

The video also presents the problem as general ("thousands of tool definitions overload the context") while the measured figure comes from one very large API. Cloudflare's docs say Code Mode uses about 1,000 tokens regardless of how many endpoints exist. That is a design property of search-then-execute, not a result measured across many agents.

## "Block uses it in Goose" holds, as a borrowed idea

At 45.68 s the video says "Block uses it in Goose." Cloudflare's February 2026 post says Goose implements Code Mode, linking to a Block-hosted page, though the post does not otherwise name Block. Goose's own December 21, 2025 post says its author first learned of the concept from a Cloudflare blog post, which proposed that agents write JavaScript or TypeScript to decide which tools to call and run that logic in a single execution. A search result for the Goose docs describes the extension as built in from v1.17.0 (December 2025) with three meta-tools (`list_functions`, `get_function_details`, `execute_typescript`). I did not fetch the page that states the version and tool names, so those two details come from search results only. The core claim, that Goose has a Code Mode derived from Cloudflare's, holds. The wording "Block uses it" is loose, because Block created Goose as an open-source agent and Goose's docs name the Cloudflare post as the origin.

## "Anthropic calls it programmatic tool calling" is close, with a caveat on origin

At 45.68 s the video says "Anthropic calls it programmatic tool calling." Anthropic's docs page titled "Programmatic tool calling" describes, in its metadata, a feature that lets Claude call your tools from code in the code execution container, cutting model round trips and token use in multi-tool workflows. It requires the code execution tool at version `code_execution_20260120` or later. I did not read the full page, so I make no claims beyond that description. Cloudflare's post frames the relationship differently from the video. It says Anthropic's Claude SDK implements Code Mode as Programmatic Tool Calling, and that Anthropic independently explored the same pattern in its "Code Execution with MCP" post. I found no source saying Anthropic merely renamed Cloudflare's feature. The mechanisms also differ in where code runs: Cloudflare's runs in a Cloudflare V8 isolate and Anthropic's runs in Anthropic's code execution container, so "calls it" equates two separate implementations.

## "Classic MCP usage is done" contradicts the sources and the video's last frame

At 45.68 s the video ends with "Classic MCP usage is done." The opening claim at 0.0 s is "RIP MCP." The sources do not support a death notice. Cloudflare's server is itself an MCP server: its docs list the Code Mode server under "Cloudflare API MCP server", and the 1,000-token result comes from an MCP server exposing two tools. The Goose post of December 21, 2025 says "many people claimed it was a replacement for MCP" and then states "Code Mode still uses MCP under the hood", with Goose running Code Mode as an MCP extension. It uses an HTTP and REST analogy: MCP is the protocol and Code Mode is a pattern for using it more efficiently.

The video's own graphics hedge the headline. Frame 025 shows "The old way is." over a gravestone labelled "THE OLD WAY", while the MCP logo sits beside it with a green "ALIVE" tag. So the visuals bury the old way of loading every tool schema, not MCP itself, while the audio says classic MCP usage is done and the opening frame's gravestone reads "MCP 2024 - ?". The narration and the frames disagree. The sources side with the frames: Cloudflare and Goose replace the one-tool-per-endpoint presentation, and the protocol stays in use.

## Key Takeaways

- **Verified:** Cloudflare's February 20, 2026 post and its developer docs give over 2,500 endpoints, two tools (`search()` and `execute()`), about 1,000 tokens, and 1.17 million tokens for the equivalent native MCP server, matching the video's figures at 34.48 s to 45.68 s.
- **Correction:** The video says "Classic MCP usage is done" (45.68 s). Goose's December 2025 post says Code Mode "still uses MCP under the hood", and Cloudflare's 1,000-token server is an MCP server. The video's own last frame tags MCP "ALIVE".
- **Partial correction:** The video presents "Cloudflare solved this with code mode" and "turns MCP tools into a TypeScript API" as one product. The TypeScript client-side design comes from the September 26, 2025 post by Kenton Varda and Sunil Pai, while the `search()` and `execute()` server comes from February 20, 2026 and takes JavaScript async arrow functions.
- **Clarification:** Cloudflare's text gives two baselines, over 2 million tokens for per-endpoint tools in the blog and about 1,170,000 tokens in the docs table. The docs also list about 244,000 tokens with required parameters only.
- **Unverified:** I found no source for the on-screen figure "1,169,837 tokens" (frame 022). Every Cloudflare page I fetched says 1.17 million or about 1,170,000.
- **Context:** Cloudflare's post says Goose has Code Mode and that Anthropic's SDK has Programmatic Tool Calling. Anthropic's docs describe code calling tools inside the code execution container. I could not read the full Anthropic page or Anthropic's "Code Execution with MCP" post, so claims about their internals and chronology rest on Cloudflare's description.

## Resources

- [Code Mode: give agents an entire API in 1,000 tokens, Cloudflare blog (Matt Carey), 2026-02-20](https://blog.cloudflare.com/code-mode-mcp/) establishes the 2,500 endpoints, the two tools, the 1.17 million and 2 million baselines, the Dynamic Worker sandbox, the JavaScript input, and the Goose and Anthropic mentions I cite.
- [Code Mode, Cloudflare blog (Kenton Varda and Sunil Pai), 2025-09-26](https://blog.cloudflare.com/code-mode/) establishes the original TypeScript-API design, the V8-isolate sandbox with bindings, and the round-trip argument.
- [Cloudflare MCP servers docs, developers.cloudflare.com](https://developers.cloudflare.com/agents/model-context-protocol/cloudflare/servers-for-cloudflare/) establishes the token comparison table (2,594 tools at about 1,170,000, about 244,000 with required parameters only, and 2 tools at about 1,000).
- [Code Mode doesn't replace MCP, Goose blog, 2025-12-21](https://goose-docs.ai/blog/2025/12/21/code-mode-doesnt-replace-mcp) establishes that Code Mode runs on MCP, that Goose runs it as an MCP extension, and that the idea came from a Cloudflare post.
- [Programmatic tool calling, Claude Platform docs, Anthropic](https://platform.claude.com/docs/en/agents-and-tools/tool-use/programmatic-tool-calling) establishes the feature description (Claude calling tools from code in the code execution container) and the required tool version. I read only the first part of the page.
- Frames 001, 005, 010, 014, 018, 022 and 025 of the staged video, plus `metadata.json`, `transcript.txt`, `transcript.json` and the ffprobe output, establish the artifact facts and the on-screen text I quote.
