Skip to main content
Glama

Install in T3 Code with one prompt (paste into any agent):

Install https://github.com/franklinblanco/colab-compute-mcp and configure it as an MCP server for my T3 Code agents (Claude Code, Codex, and Antigravity/Gemini) following its README.

Agents keep editing your local worktrees in stock T3 Code (no fork needed) and dispatch test/build commands to warm Google Colab VMs (CPU by default). Multiple agents share the same VM concurrently over one foreground SSH ControlMaster via a private 0600 Unix-socket daemon (~/.colab-compute-mcp/daemon.sock), each in an isolated non-root Linux account.

How it works

flowchart LR
  subgraph Local["Local machine (stock T3 Code · local worktrees)"]
    C1["Claude Code (stdio MCP)"]
    C2["Codex (stdio MCP)"]
    C3["Gemini / Antigravity (stdio MCP)"]
    D["Shared Pool Daemon (daemon.sock, 0600)"]
    C1 & C2 & C3 --> D
  end

  subgraph Colab["Google Colab VM (CPU default · GPU/TPU optional)"]
    M["1 Foreground SSH ControlMaster (zero HTTP 429)"]
    J1["Job A (uid 1001 · isolated build/test)"]
    J2["Job B (uid 1002 · isolated build/test)"]
    M --> J1
    M --> J2
  end

  D -- "tar workspace sync + stdin cmd/env" --> M
  J1 & J2 -- "stdout/stderr + validated artifacts" --> D

Related MCP server: colab-fleet

Installation

Requirements: macOS or Linux (or WSL 2 on Windows), Node.js 22+, pnpm, Git, tar, OpenSSH, and flock (Linux).

1. Install and sign in to the Google Colab CLI

uv tool install google-colab-cli   # or: pip install google-colab-cli
colab usage                        # one-time Google sign-in; prints your compute-unit balance

2. Clone and build this MCP server

git clone https://github.com/franklinblanco/colab-compute-mcp.git
cd colab-compute-mcp
pnpm install --frozen-lockfile
pnpm run build

3. Register colab-compute for your T3 Code agents

Use the absolute paths to node (e.g. which node) and dist/cli.js:

  • Claude Code (~/.claude.json under "mcpServers"):

    "colab-compute": {
      "type": "stdio",
      "command": "/path/to/node",
      "args": ["/path/to/colab-compute-mcp/dist/cli.js"]
    }
  • Codex (~/.codex/config.toml):

    [mcp_servers.colab-compute]
    command = "/path/to/node"
    args = ["/path/to/colab-compute-mcp/dist/cli.js"]
  • Gemini / Antigravity (~/.gemini/config/mcp_config.json, plus ~/.t3/userdata/providers/antigravity/*/config/mcp_config.json when running inside T3 Code):

    {
      "mcpServers": {
        "colab-compute": {
          "command": "/path/to/node",
          "args": ["/path/to/colab-compute-mcp/dist/cli.js"]
        }
      }
    }

Start a new thread and ask your agent to check colab_pool_status.

Windows: Native Windows is not supported (google-colab-cli is Linux/macOS only and Windows OpenSSH lacks ControlMaster). Run inside WSL 2; Windows MCP clients can launch it via "command": "wsl.exe", "args": ["--", "node", "/path/in/wsl/colab-compute-mcp/dist/cli.js"].

Google AI Pro & Ultra compute estimates

Paid Google AI plans include monthly Colab Compute Units (CU) automatically on the same Google account (Pro: 200 CU/mo, Ultra: up to 2,000 CU/mo; units expire after 90 days and fall back to free-tier quotas at 0 with no overage billing).

Approximate runtime hours per monthly grant (rates fluctuate slightly with demand; check live rates via colab_pool_status or colab usage):

Hardware profile

Typical specs

Approx. CU/hr

Google AI Pro (200 CU)

Google AI Ultra (2,000 CU)

cpu (default)

2 vCPU, ~13 GB RAM

~0.07

~2,850 hrs

~28,500 hrs

cpu-high-mem

8 vCPU, ~52 GB RAM

~0.14

~1,400 hrs

~14,200 hrs

gpu-t4

15 GB VRAM

~1.1 – 1.8

~110 – 180 hrs

~1,100 – 1,800 hrs

gpu-l4

22 GB VRAM

~1.5 – 4.8

~40 – 130 hrs

~415 – 1,300 hrs

gpu-g4 (Pro+/Ultra)

96 GB VRAM (RTX PRO 6000)

~8.9

—

~225 hrs

gpu-a100

40–80 GB VRAM

~7 – 15

~13 – 28 hrs

~130 – 285 hrs

gpu-h100 (Pro+/Ultra)

80 GB VRAM

~18

—

~110 hrs

tpu-v5e1 / tpu-v6e1

16–32 GB HBM

~1.8 / ~4.1

~110 / ~48 hrs

~1,100 / ~485 hrs

For everyday builds and test suites, cpu and cpu-high-mem barely dent your monthly balance, and idle VMs auto-stop after 10 minutes.

MCP tools

Tool

Purpose

colab_run_job

Run a build/test command on a pooled Colab VM (hardware defaults to cpu, syncWorkspace: true, mode: "wait" or "async"). Syncs local .gitignore-aware files (including uncommitted edits) and optionally copies back artifactPaths.

colab_job_status

Read status, exit code, stdout/stderr (up to 64 KiB each), and artifacts for a job from the current session.

colab_cancel_job

Cancel a queued or running job and free its VM slot immediately.

colab_pool_status

Show active VMs, slot usage, queued jobs, and Colab compute-unit balance.

colab_pool_stop

Stop idle VMs (or force: true for VMs whose active jobs belong to the current session).

Configuration & security

Environment variable

Default

Notes

COLAB_MCP_MAX_VMS

2

Maximum concurrent Colab VMs in the pool

COLAB_MCP_IDLE_TIMEOUT_SECONDS

600

Idle VM auto-stop timeout (10 min)

COLAB_MCP_MAX_JOBS_PER_CPU_VM

2

Concurrent jobs per cpu VM

COLAB_MCP_MAX_JOBS_PER_HIGH_MEM_VM

4

Concurrent jobs per cpu-high-mem VM

COLAB_MCP_STATE_DIR

~/.colab-compute-mcp

Private socket, SSH key, and session state

  • Each job runs under a disposable non-root Linux account in /content/t3-jobs/<jobId> with commands and env sent over SSH stdin (never argv).

  • Workspace uploads exclude .git and .t3 (and node_modules/target/dist/.venv outside Git); downloaded artifacts reject symlinks, hard links, and path traversal.

  • Pool reconciles orphaned VMs on startup and stops all pool-owned VMs on SIGTERM/SIGINT.

Verify

pnpm test          # unit tests (fake transport)
pnpm run test:live # live 2-client concurrent test on your Colab account (expects 0 active sessions)

License: MIT — remote supervisor and pool architecture adapted from T3 Code.

Available Tools

5 tools
colab_cancel_jobA
DestructiveIdempotent

Cancel one of this client's queued or running Colab jobs.

Inputs: jobId (required).

colab_job_statusB
Read-only

Get one of this client's Colab jobs, including its state, exit code, log tails, and artifacts.

Inputs: jobId (required).

colab_pool_statusA
Read-only

List shared Colab VMs, available slots, queued jobs, and the compute-unit balance.

Inputs: no named parameters.

colab_pool_stopA
DestructiveIdempotent

Stop idle VMs, optionally by session name. Force can also cancel this client's jobs on selected VMs.

Inputs: force, sessionName.

colab_run_jobA

Build or test on a shared Colab VM. Defaults to CPU, syncing an absolute local workspace, and waiting up to 300 seconds. Async returns a job ID. cwd and artifactPaths are workspace-relative.

Inputs: command (required), cwd, env, mode, +5 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 5 tools

    Disambiguation4/5

    The tools mostly target distinct concepts: pool status/stopping versus job run/status/cancel. There is some overlap because colab_pool_stop can force-cancel this client's jobs on selected VMs, which touches the same operation space as colab_cancel_job, but the descriptions make the intended boundaries reasonably clear.

    Naming Consistency4/5

    All names use a consistent colab_ prefix and snake_case, which is readable and predictable. However, the patterns mix resource_action (pool_status, pool_stop, job_status) with action_resource (run_job, cancel_job), so it is not a single uniform verb_noun convention throughout.

    Tool Count5/5

    Five tools is well-scoped for a Colab compute server: pool visibility/management and job execution lifecycle are covered without excessive surface area. Each tool earns its place and there is no obvious padding.

    Completeness4/5

    The set covers the core lifecycle: inspect pool, stop idle VMs, run jobs, check job status, and cancel jobs. Minor gaps exist, such as no explicit tool to list all of the client's jobs or manage artifacts beyond status reporting, but agents can work around these using returned job IDs and status details.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Enables AI agents to drive Google Colab end to end through Google's official Colab CLI: creating and stopping GPU/TPU runtimes, executing code, editing local notebooks cell by cell, launching long background jobs, and uploading or downloading files and folders. Optionally adds opt-in Google Drive tools for signing in, managing project folders, and creating, editing or trashing notebooks, plus mounting Drive on the VM for large datasets.
      42
      61 PyPI
      5
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI coding agents to rent disposable cloud dev environments with a terminal, real browser, repo checkout, git gateway, and live view, so they can build, test, run dev servers, inspect pages, and push branches while keeping keys off the VM.
      1
      Apache 2.0