Show HN: I built an MCP server using Cloudflare's code mode pattern (github.com)
Read this article by Cloudflare this morning https://blog.cloudflare.com/code-mode/ the main argument being that LLMs are much better at writing typescript code than tool calls because they've seen typescript code many more times.
HN Discussion: https://news.ycombinator.com/item?id=45399204 https://news.ycombinator.com/item?id=45386248
Deno provides a great sandbox environment for Typescript code execution because of its permissions system which made it easy to spin up code that only has access to fetch and network calls.
Stick an MCP proxy on top of that and you've got "CodeMode" (code intermixed with MCP tool calls) for more advanced workflow orchestration.
https://github.com/jx-codes/codemode-mcp
There's a lot of things that can be improved here. Like a virtual file system for the agent to actually build up its solution instead of being forced to one shot the solution but the bones are there.
12 comments
[ 3.4 ms ] story [ 42.6 ms ] threadOne thing I ran into is that since the RPC calls are independent Deno processes, you can't keep say DuckDB or SQLite open.
But since it's just typescript on Deno. I can just use a regular server process instead of MCP, expose it through the TS RPC files I define, and the LLM will have access to it.
https://github.com/jx-codes/mcp-rpc https://news.ycombinator.com/item?id=45420133
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.
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?
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
https://lucumr.pocoo.org/2025/8/18/code-mcps/
For those of you interested, I wrote out and built an more RPC typescript centric approach to avoid using other MCP servers at all. Would appreciate some thoughts!
https://news.ycombinator.com/item?id=45420133
[1] Not all, some use different formats, e.g. GLM uses plain text with special tokens to denote param names and values.