Drive a Colab notebook from Claude Code
Claude Code reached Colab MCP, spun up a TPU, ran notebook cells, and cleaned up the runtime after approval.
- What they did
- The developer authenticated with a Colab token carrying the colaboratory scope from the Colab CLI login, then enabled the API in a quota project. Since Claude Code’s own OAuth path failed, they fed both credentials through a headersHelper script. A Python driver handled the notebook session by creating a TPU v5e-1 runtime, keeping one session active, pushing each cell through execute_code, and placing deletion inside a finally block.
- How it went
- The TPU v5e-1 came up in 4 seconds, and the 26-cell Gemma 4 notebook finished in 901 seconds without errors. The results matched the Colab CLI execution. The downside was that only text output came back, so HTML output was lost.
- Tips
- Watch the 300-second stream limit; longer cells should be broken apart before you run them or the kernel will be interrupted. A plain gcloud ADC token will not work unless it includes the colaboratory scope.
Try it yourself with Claude Code
Help me connect Claude Code to Google’s hosted Colab MCP endpoint. Guide me through any authentication I need, using my Colab token and quota project if needed. Then open [notebook name or link] on [runtime type], run the cells in sequence, and show me the output. Once it ends, tell me which runtime you started and ask for my approval before deleting it.
Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.
Get 3 agent uses like this every morning
With the day's top AI news. Free, and one click to unsubscribe.
Related agent uses
Link Dots to your Claude Code workflow
They wired Dots into a live Claude Code setup so it could pass updates between several coding lanes, but the connection needed tuning.
Turn a feature backlog into shippable code in batches
A solo developer used Claude Code to turn a planned feature list into markdown tasks, then had Claude implement each batch and pause for review.
Test an iOS app and collect bugs automatically
Use Claude Code to drive an iOS app through its accessibility tree, visit screens, and return a structured bug report.
Plan work in a PRD, then assign the build
A developer asks a stronger model for a plan, turns it into tasks, and routes implementation to lower-cost agents.
Use Claude Code to fork work into a fresh session
Fable opened another Claude Code Desktop session and placed a single task from its checklist into it.
Use Claude Code from a phone with a remote VM
They accessed Claude Code on an iPhone by pairing a Tailscale-only Vultr VM with Termius, mosh, and tmux.