Skip to content

Instantly share code, notes, and snippets.

View tuannvm's full-sized avatar
🇺🇲

Tommy Nguyen tuannvm

🇺🇲
View GitHub Profile
@tuannvm
tuannvm / Code Mode: the better way to use MCP.md
Last active September 26, 2025 22:07
Code Mode: the better way to use MCP.md

https://blog.cloudflare.com/code-mode/

Cloudflare’s blog post “Code Mode: the better way to use MCP,” authored by Kenton Varda and Sunil Pai, introduces a new approach to using the Model Context Protocol (MCP) that significantly improves AI agent performance. Traditional MCP usage involves directly exposing tools to large language models (LLMs), but this method faces limitations due to LLMs’ limited familiarity with tool-call tokens, resulting in difficulty with complex or numerous tools.

The new Code Mode approach converts MCP tools into a TypeScript API and instructs the LLM to write code that calls the API. This provides several advantages:

  1. Improved Tool Handling: LLMs handle more tools and complex interactions better because they are extensively trained on real-world TypeScript code rather than synthetic tool-calling data.
  2. Efficient Multi-Call Execution: Code Mode allows LLMs to chain multiple tool calls without looping every result back through the neural network, reducing token
@tuannvm
tuannvm / cd.md
Last active October 9, 2022 00:34
#argo #cd #rollout #workflow #event
@tuannvm
tuannvm / main.go
Created July 14, 2021 09:04
#go #http #server #debug #troubleshoot
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"github.com/gorilla/mux"
)
@tuannvm
tuannvm / facts.md
Last active June 13, 2021 05:48
#ebpf #bpf
@tuannvm
tuannvm / user_data.yaml
Last active January 7, 2021 12:27
#do #digitalocean #vpn #outline
Content-Type: multipart/mixed; boundary="//"
MIME-Version: 1.0
--//
Content-Type: text/cloud-config; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="cloud-config.txt"
#cloud-config
@tuannvm
tuannvm / openbox.xml
Last active March 17, 2020 01:44
#raspberry #desktop
<?xml version="1.0" encoding="UTF-8"?>
<!-- Do not edit this file, it will be overwritten on install.
Copy the file to $HOME/.config/openbox/ instead. -->
<openbox_config xmlns="http://openbox.org/3.4/rc" xmlns:xi="http://www.w3.org/2001/XInclude">
<resistance>
<strength>10</strength>
<screen_edge_strength>20</screen_edge_strength>
</resistance>
<focus>
<focusNew>yes</focusNew>
@tuannvm
tuannvm / note.md
Created June 20, 2019 03:51
#gitlab #note
  • Need to disable shared runner for new repository
@tuannvm
tuannvm / note.md
Last active June 22, 2019 14:04
#servicemesh #istio

Isitio evaluation

Setting Request Timeouts

One more thing to note about timeouts in Istio is that in addition to overriding them in route rules, as you did in this task, they can also be overridden on a per-request basis if the application adds an x-envoy-upstream-rq-timeout-ms header on outbound requests. In the header, the timeout is specified in milliseconds instead of seconds.

Doesn't work in istio-enabled GKE, as right after we try to modify ingressgateway GKE will try to revert that :(