The valuable lesson from what Cloudflare claims is that if you want to make an LLM perform as you expect you have to build considering their strengths and weaknesses.
You can see the same behavior if you try to ask an LLM to code in an API that is not commonly used.
When it comes to MCP tooling I followed a different path but with similar assumptions.
There are tools that LLMs have been Rled to death to use. So I’m modeling my tools after them.
Specifically, I try to have a “glob” tool, used to let the LLM figure out structure. A search and a read tool and use regexp as much as possible for passing parameters.
It has been working well, at least in terms of the model knowing how to invoke and use the tools.
I have to say though that each model is different. I see differences between Claude code and Codex when I use the MCP for development, at least on how good they are in retrieving the information they need.
Maybe I should try to run some benchmarking and compare more formally
I find it interesting how this project uses all three major JavaScript runtimes in a single project. Bun for the code itself, Deno for sandboxing and Node for running the MCP server. Says something about the ecosystem.
Than the equivalent... but with `method: "POST"` boilerplate, etc? Or is it literally the chaining of tools that's missing from—and fundamentally faulty in—MCP client implementations?
So this is a first pass to capture the workflow part (mix code and MCP calls).
The fetch code isn't any better than the tool code I agree, but typescript code is more common so I'd guess this would be too?
But anyway I think the real power comes with the type-safety part that I left out this morning (working on it now). From what I understand Cloudflare is essentially generating an SDK for the LLM to write code against.
Instead of writing that fetch call. The LLM would generate
Correct, this is like giving the LLM full specs on your GraphQL endpoint, and telling it have fun, get only what you need.
Except it can use Typescript to manipulate the data mid stream.
So in reality this is MCP Middleware + MCP Orchestration + Tool Call Efficiency.
It will save tokens as well due to only returning what it needs, but more so just think of going from 10 consecutive tool calls, to 1 call that gives you everything you need and nothing you don't, with 1/10th the time taken to accomplish.
This is a terrible idea masquerading as innovation. Cloudflare wants you to believe LLMs write TypeScript better than they make tool calls, but they're really just creating another dependency on their infrastructure.
1. Tool calls are intentionally simple; adding a code generation layer introduces needless complexity and failure points.
2. Cloudflare already acts as a man-in-the-middle for ~20% of the Internet with limited transparency about government data requests
3. This is clearly designed to drive adoption of their Worker platform and create lock-in for AI agent developers
Similar to their x402 payment scheme that reinvents HTTP 402 under their control, the community has already built alternatives (see the Aperture implementation from Lightning) that don't require surrendering more of your stack to Cloudflare.
Remember what's happening here: a company with unprecedented visibility into web traffic wants even more control over how AI agents interact with the internet. Even if you don't believe that AI will eventually self govern itself, this is a horrible idea to limit individual's ability to automate portions of their access to the web.
In which case your likely wrong, people do want it, and AI will be very good at orchestrating simple patterns.
CF definitely has a vested interest.. The problem for them now that I see is that THEY DIDN"T ACTUALLY LAUNCH IT... but did describe what it is/does in complete detail.
Now there are gonna be dozens of non CF locked clones, just like the one OP linked.
I was just reflecting on this blog post after reading it this morning. What do you think on code mode after implementing it? At this point would not be better to just have a sandboxed api environment with customizable api/tools endpoints? basically an RL environment :)
Yeah the main value is definitely the code execution layer. You could easily generate a type-safe client from your REST, GraphQL, TRPC layer, expose it to the Deno layer and list the types as a resource or something. No need to involve MCP at all. You're basically just defining a stdlib for the LLM.
If you run `deno check` before executing the code you'd get the type-safety loop (working on this now)
Later I want to see what'd happen if you give the LLM a repo of sorts to store useful snippets and functions with comments for later use. So the LLM itself would save workflows, be able to import them into the Deno environment and chain those together.
It definitely needs a prompt that tells it to use the MCP server but I can see it being pretty powerful.
I only did simple tests like get Reddit posts, their comments, find the weather on those days, stick them in duckdb, and run some social media metric queries.
I could see that same test being: "find me leads, filter by keywords, run against some parquet file stored somewhere using duckdb, craft an email for my boss."
I'm kind of ranting but I think this a pretty exciting approach.
Edit: GraphQL style codegen layer but for all your APIs seems like a pretty obvious middle layer for this, maybe next weekend.
I came here looking for partial solutions to fill gaps in our own attempts at CodeMode service. However I'll give you some hope ;)
> Later I want to see what'd happen if you give the LLM a repo of sorts to store useful snippets and functions with comments for later use. So the LLM itself would save workflows, be able to import them into the Deno environment and chain those together.
OMG this is the first thing you should do. We have similar now and its freaking amazing. Just discussing yesterday how I can't remember it going off the rails since implementing automem last week even.
Best thing it does, fully recaps all your daily accomplishments, across all platforms (Claude Code, Claude Desktop, ChatGPT, Cursor).
Called Automem by a friend of my (Jack Arturo), currently closed-source, though I'm sure you could reverse engineer it enough.
- its a hosted stack of FalkorDB + QDrant
- has endpoints for creating/retrieving memories
- embeds stuff using ChatGPT models
- Uses Graph nodes for relating memories together
- Has a dream/sleeping phase which degrades long term memory relevant, finds and tracks patterns and more.
- Has an MCP which connects any AI directly to memory
- Automated hooks which record memory queues on commit, deploy, learning moments
- Automated storing of all queued memories on chat end.
- A lot more magic under the hood too.
So in reality you get a near biological memory, useful by any MCP agent. To be fair Jack has about a 2 month head start on the rest of us with this idea haha.
--
The setup were building will be an always running setup, so it also has a scheduling runtime in Node that uses MD files to create automatable workflows, some uses agents, some just run bash. They can call mcps, tools, run commands, log output, use automem etc, all in human readable text.
PS Keep up the great work on your codemode service, got some great ideas from yours to incorporate to ours that should resolve the one or 2 issues we had outstanding. Will share if I get it working, https://github.com/danieliser/code-mode if it gets any where
The valuable lesson from what Cloudflare claims is that if you want to make an LLM perform as you expect you have to build considering their strengths and weaknesses.
You can see the same behavior if you try to ask an LLM to code in an API that is not commonly used.
When it comes to MCP tooling I followed a different path but with similar assumptions.
There are tools that LLMs have been Rled to death to use. So I’m modeling my tools after them.
Specifically, I try to have a “glob” tool, used to let the LLM figure out structure. A search and a read tool and use regexp as much as possible for passing parameters.
You can see an early version of this pattern here: https://github.com/typedef-ai/fenic/blob/main/examples/mcp/d...
It has been working well, at least in terms of the model knowing how to invoke and use the tools.
I have to say though that each model is different. I see differences between Claude code and Codex when I use the MCP for development, at least on how good they are in retrieving the information they need.
Maybe I should try to run some benchmarking and compare more formally
I find it interesting how this project uses all three major JavaScript runtimes in a single project. Bun for the code itself, Deno for sandboxing and Node for running the MCP server. Says something about the ecosystem.
Says something about my coding haha.
Yeah since it's using Deno it'd be cool just use Deno throughout. Definitely gotta clean up the code quite a bit.
Why Deno over Bun? Forgive my naivety, I was a backend dev for years and am only now familiarizing myself with the JS/TS ecosystem
> LLMs are much better at writing code than at tool calling.
Wait, really? This is harder to get right:
``` { "jsonrpc": "2.0", "id": 102, "method": "tools/call", "params": { "name": "book_flight", "arguments": { "origin": "SFO", "destination": "JFK", "departureDate": "2025-10-15", "returnDate": "2025-10-18", "passengers": 2, "cabinClass": "business" } } } ```
Than the equivalent... but with `method: "POST"` boilerplate, etc? Or is it literally the chaining of tools that's missing from—and fundamentally faulty in—MCP client implementations?
So this is a first pass to capture the workflow part (mix code and MCP calls).
The fetch code isn't any better than the tool code I agree, but typescript code is more common so I'd guess this would be too?
But anyway I think the real power comes with the type-safety part that I left out this morning (working on it now). From what I understand Cloudflare is essentially generating an SDK for the LLM to write code against.
Instead of writing that fetch call. The LLM would generate
``` const redditResults = await redditMCP_getTopPosts(subreddit); const insertMutation = await duckdb_Insert("SQL STUFF", redditResults.map(...)); const results = await duckDb_Query(args: duckDb_QueryArgs); return resultsInSomeNiceFormat; ```
Where the method names come from the MCP server tools, and the argument types are autogenerated from the MCP schemas themselves.
No idea if this is a valuable workflow or not personally. I just thought it was cool and wanted to tinker with it.
Correct, this is like giving the LLM full specs on your GraphQL endpoint, and telling it have fun, get only what you need.
Except it can use Typescript to manipulate the data mid stream.
So in reality this is MCP Middleware + MCP Orchestration + Tool Call Efficiency.
It will save tokens as well due to only returning what it needs, but more so just think of going from 10 consecutive tool calls, to 1 call that gives you everything you need and nothing you don't, with 1/10th the time taken to accomplish.
This is a terrible idea masquerading as innovation. Cloudflare wants you to believe LLMs write TypeScript better than they make tool calls, but they're really just creating another dependency on their infrastructure.
1. Tool calls are intentionally simple; adding a code generation layer introduces needless complexity and failure points.
2. Cloudflare already acts as a man-in-the-middle for ~20% of the Internet with limited transparency about government data requests
3. This is clearly designed to drive adoption of their Worker platform and create lock-in for AI agent developers
Similar to their x402 payment scheme that reinvents HTTP 402 under their control, the community has already built alternatives (see the Aperture implementation from Lightning) that don't require surrendering more of your stack to Cloudflare.
Remember what's happening here: a company with unprecedented visibility into web traffic wants even more control over how AI agents interact with the internet. Even if you don't believe that AI will eventually self govern itself, this is a horrible idea to limit individual's ability to automate portions of their access to the web.
No thanks.
Whilst I agree that Cloudflare have a vested interest here, there have been other proposers of this concept such as huggingface.
https://huggingface.co/blog/smolagents
Is this not just GraphQL for MCP/Tools?
In which case your likely wrong, people do want it, and AI will be very good at orchestrating simple patterns.
CF definitely has a vested interest.. The problem for them now that I see is that THEY DIDN"T ACTUALLY LAUNCH IT... but did describe what it is/does in complete detail.
Now there are gonna be dozens of non CF locked clones, just like the one OP linked.
I was just reflecting on this blog post after reading it this morning. What do you think on code mode after implementing it? At this point would not be better to just have a sandboxed api environment with customizable api/tools endpoints? basically an RL environment :)
Yeah the main value is definitely the code execution layer. You could easily generate a type-safe client from your REST, GraphQL, TRPC layer, expose it to the Deno layer and list the types as a resource or something. No need to involve MCP at all. You're basically just defining a stdlib for the LLM.
If you run `deno check` before executing the code you'd get the type-safety loop (working on this now)
Later I want to see what'd happen if you give the LLM a repo of sorts to store useful snippets and functions with comments for later use. So the LLM itself would save workflows, be able to import them into the Deno environment and chain those together.
It definitely needs a prompt that tells it to use the MCP server but I can see it being pretty powerful.
I only did simple tests like get Reddit posts, their comments, find the weather on those days, stick them in duckdb, and run some social media metric queries.
I could see that same test being: "find me leads, filter by keywords, run against some parquet file stored somewhere using duckdb, craft an email for my boss."
I'm kind of ranting but I think this a pretty exciting approach.
Edit: GraphQL style codegen layer but for all your APIs seems like a pretty obvious middle layer for this, maybe next weekend.
I came here looking for partial solutions to fill gaps in our own attempts at CodeMode service. However I'll give you some hope ;)
> Later I want to see what'd happen if you give the LLM a repo of sorts to store useful snippets and functions with comments for later use. So the LLM itself would save workflows, be able to import them into the Deno environment and chain those together.
OMG this is the first thing you should do. We have similar now and its freaking amazing. Just discussing yesterday how I can't remember it going off the rails since implementing automem last week even.
Best thing it does, fully recaps all your daily accomplishments, across all platforms (Claude Code, Claude Desktop, ChatGPT, Cursor).
https://i.postimg.cc/Z0tYGKvf/Screenshot-2025-09-28-at-3-15-... https://i.postimg.cc/SQX6bTzV/Screenshot-2025-09-28-at-3-16-...
Called Automem by a friend of my (Jack Arturo), currently closed-source, though I'm sure you could reverse engineer it enough.
- its a hosted stack of FalkorDB + QDrant - has endpoints for creating/retrieving memories - embeds stuff using ChatGPT models - Uses Graph nodes for relating memories together - Has a dream/sleeping phase which degrades long term memory relevant, finds and tracks patterns and more. - Has an MCP which connects any AI directly to memory - Automated hooks which record memory queues on commit, deploy, learning moments - Automated storing of all queued memories on chat end. - A lot more magic under the hood too.
So in reality you get a near biological memory, useful by any MCP agent. To be fair Jack has about a 2 month head start on the rest of us with this idea haha.
--
The setup were building will be an always running setup, so it also has a scheduling runtime in Node that uses MD files to create automatable workflows, some uses agents, some just run bash. They can call mcps, tools, run commands, log output, use automem etc, all in human readable text.
https://i.postimg.cc/Y246Bnmx/Screenshot-2025-09-28-at-3-11-... https://i.postimg.cc/ThM2zY5Z/Screenshot-2025-09-28-at-3-17-... https://i.postimg.cc/vT6H26T7/Screenshot-2025-09-28-at-3-17-...
PS Keep up the great work on your codemode service, got some great ideas from yours to incorporate to ours that should resolve the one or 2 issues we had outstanding. Will share if I get it working, https://github.com/danieliser/code-mode if it gets any where
Can you expand on the RL thing?
Just because an agent “lives” in the environment, doesn’t make it RL. It needs a reward function, or even better something like Gym.
or did he mean Real Life environment which is how i read it, with access to real APIs and tools etc.
does this approach actually work? is it more reliable than plain mcp calls?
Think of GraphQL, this gives the AI all the structure via Typescript of the MCP / API / Tools, lets it orchestrate its own response.
So once it has the API shape in memory, it could make dozens of tool calls in a single call.
It isn't about token saving, its about time/efficiency of tool usage/response time accumulation.
Instead of 20 separate tool calls one after the other, you get one larger, orchestrated one that only returns exactly what it needed.