Liz Zhang

Cookbook

Measure what an MCP server costs in tokens

Every MCP tool definition takes up context before your agent does any work. This prints the cost of any server you can start with npx.

Needs: Node.js. No API key.

Run

git clone https://github.com/zhang-liz/mcp-token-benchmark.git
cd mcp-token-benchmark && npm install
node benchmark.mjs "filesystem" npx -y @modelcontextprotocol/server-filesystem /tmp

You get

{"label":"filesystem","toolCount":14,"totalTokens":1695,
 "perTool":[{"name":"read_file","tokens":109,"chars":464}, ...]}

Read how to design a lighter serverSee the code ↗

Rebuild my agent memory report

agent-memory-bench logs every API call, tool call, and answer. This command rebuilds the cost and accuracy tables and the charts from those logged runs, so you can check my results yourself.

Needs: Python and uv. No API key. No database.

Run

git clone https://github.com/zhang-liz/agent-memory-bench.git
cd agent-memory-bench && uv sync
uv run amb analyze --out results/main

You get

wrote results/main/report/report.md

Setup             Accuracy   Total cost per task
Full history      100%       $2.379
Graph (FalkorDB)  100%       $1.411

Read the talk recapSee the code ↗

Walk through the Marvel graph story

This is the demo from my Hack for Humanity talk: five questions about the Marvel universe, asked with no graph and then with the graph. Add ?backup=1 to play my recorded answers with no database and no API key.

Needs: Node.js 20 or newer.

Run

git clone https://github.com/zhang-liz/marvel-universe-graph.git
cd marvel-universe-graph/marvel-web
cp .env.example .env.local
npm install && npm run dev -- -p 3100
# Then open http://localhost:3100/?backup=1

Step 1 of 5

Who has wielded all six Infinity Stones?

No graph:  Thanos and Tony Stark.
Graph:     Hulk, Thanos and Iron Man.

Play it here firstSee the code ↗

Build a voice agent that calls new leads

OpenLine calls a new Google Sheet lead in seconds, qualifies them, and writes the transcript back to the sheet. The tutorial walks through every file.

Needs: Python, uv, ngrok, and accounts with Twilio, AssemblyAI, Anthropic, Cartesia, and Google Cloud.

Run

git clone https://github.com/zhang-liz/OpenLine.git
cd OpenLine && uv sync
cp .env.example .env    # Add your keys
uv run python main.py

You get

A running voice agent at about $0.05 to $0.06 per minute.
New row in your sheet, then a phone call, then the transcript in that row.

Follow the full tutorialSee the code ↗

Triage a batch of AI video takes

dailies finds the dead takes in a folder and shows why it rejected each one. Then it writes one HTML report for the morning.

Needs: Python 3.9 or newer and ffmpeg. No API key for these checks.

Run

pip install video-dailies
dailies review ./takes
dailies report ./takes -o report.html

You get

reviewed 4 takes, killed 1
  review   #1  take-001.mp4
  review   #2  take-002.mp4
  review   #3  take-003.mp4
  kill     #4  take-004.mp4   black for 2.0s of 2.0s; frozen for 2.0s of 2.0s

See the code ↗