colab-forge MCP Server
Provisions and controls ephemeral Google Colab Pro/Pro+ GPU VMs over private OpenSSH tunnels, runs training and GenAI workloads, and auto-shuts down runtimes to conserve Compute Units.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
colab-forge
Turn your Google Colab Pro/Pro+ GPUs into a local-first OpenAI-compatible API, 17-tool MCP server, LoRA training rig, React 19 Web Studio, and native menu-bar tray app with zero local CUDA setup and guaranteed auto-shutdown.
Everything runs on 127.0.0.1:7860 over private OpenSSH tunnels (colab ssh --proxy-mode) to ephemeral Colab VMs running Python 3.13, PyTorch 2.14, and CUDA 13.0. No browser tabs to babysit, no public ngrok URLs, and no forgotten A100 burning through your Compute Units overnight.
Links: Live Landing Page · GitHub Repo · Getting Started · Built-in & Custom Recipes · MCP & AI Agents · Architecture · Desktop Tray App
Why colab-forge?
If you already pay for Google Colab Pro or Pro+, you have access to T4, L4, A100, G4 (96 GiB Blackwell), and H100 GPUs that boot in 4 to 11 seconds. Using them from notebooks works fine for exploration, but falls apart the moment you want to kick off a LoRA run from your terminal, point the OpenAI SDK at an open-weights model, or let Claude Code generate an image or transcribe a recording.
Without colab-forge | With colab-forge |
Copy-paste code into browser cells and pray the tab doesn't disconnect | Run |
Stand up separate scripts, ngrok tunnels, and ad-hoc FastAPI servers per model | Point any OpenAI SDK or |
Remember to manually disconnect runtimes before closing your laptop | Two-layer idle watchdog (local daemon + in-VM fail-safe), macOS |
Burn Compute Units on a malformed JSONL file 4 minutes into setup | Zero-CU streaming dataset pre-flight validator rejects broken |
Wire up MCP servers by hand in every coding client |
|
Related MCP server: Colab-MCP
What You Can Do in 60 Seconds
Start the loopback daemon once (colab-forge start --open), then drive your Colab GPUs from the CLI, any OpenAI client, Web Studio, or your AI coding agent:
# Fine-tune Qwen2.5-0.5B with 4-bit QLoRA on the bundled 20-row chat dataset (auto-stops VM on exit)
colab-forge train lora \
--model Qwen/Qwen2.5-0.5B-Instruct \
--dataset examples/sample_sft.jsonl \
--gpu T4 \
--steps 5
# Run any local PyTorch script on a T4 and pull /content/output back to ./runs/<job_id>/output/
colab-forge train script examples/tiny_train.py --gpu T4
# Lazy-boot multimodal GenAI workers on demand (archived automatically under ./outputs/)
colab-forge generate image "Minimalist studio photo of a mechanical keyboard" --out keyboard.png
colab-forge generate speech "Hello from Colab Forge." --voice af_heart --out hello.wav
colab-forge generate transcribe hello.wav --language en
colab-forge generate chat "Explain LoRA in two sentences." --stream
colab-forge generate music "Warm analog synthwave bassline" --duration 8 --out synth.wav
colab-forge generate video "Slow pan over a neon Tokyo alley" --frames 25 --steps 20 --out tokyo.mp4
colab-forge generate vision keyboard.png --prompt "Describe the lighting and layout"
colab-forge generate embed "Local-first GPU orchestration on Google Colab"Because colab-forge exposes /v1/* on loopback, existing OpenAI SDK code works by swapping only baseURL:
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "http://127.0.0.1:7860/v1",
apiKey: process.env.COLAB_FORGE_AUTH_TOKEN || "local",
});
const res = await client.chat.completions.create({
model: "Qwen/Qwen2.5-7B-Instruct",
messages: [{ role: "user", content: "Summarize QLoRA in two sentences." }],
});Quickstart
1. Prerequisites
Node.js >= 22 and pnpm
google-colab-cliinstalled and logged into your Google account:uv tool install google-colab-cli colab login
2. Install, Build & Check Your Environment
pnpm install
pnpm build
node dist/src/cli.js doctordoctor verifies Node >= 22, the colab binary, OAuth status, your live Compute Unit balance, and the managed Ed25519 SSH key (~/.config/colab-forge/id_ed25519).
3. Start the Local Daemon & Web Studio
node dist/src/cli.js start --openThe daemon binds strictly to 127.0.0.1:7860:
Web Studio:
http://127.0.0.1:7860MCP Endpoint:
http://127.0.0.1:7860/mcpOpenAI Base URL:
http://127.0.0.1:7860/v1
Pass --idle <sec> or --idle-timeout <sec> (for example, colab-forge start --idle-timeout 120) to override the default 600-second idle auto-stop window. Want to explore Web Studio and the CLI without spending a single Compute Unit? Start with COLAB_FORGE_PROVIDER=mock.
Environment Variables
Variable | Effect |
| Optional Bearer token required on |
| Override local output, training run, and state storage directories (falls back to the OS app-data directory when |
| Run against the built-in zero-CU |
| Explicit opt-in required before allowing |
| Explicit opt-in required to weaken CostGuard policy bounds or set |
See docs/getting-started.md for the full walkthrough, Secrets Vault setup (HF_TOKEN, WANDB_API_KEY), and CostGuard defaults.
Built-in Recipes (10)
Run colab-forge recipes to inspect all 10 built-in recipes plus any custom YAML recipes under ~/.config/colab-forge/recipes/, complete with GPU fallback chains and live CU/hr estimates.
Recipe ID | Kind | Capability | Default GPU Chain | Min VRAM | Endpoints / Output | Python 3.13 / PyTorch 2.14 / CUDA 13.0 Hardening |
|
|
|
| 15 GB |
| Zero-CU streaming pre-flight validation; SM >= 8 |
|
|
|
| 12 GB |
| Streams local script/project ( |
|
|
|
| 15 GB |
| Runs |
|
|
|
| 8 GB |
| Kokoro-82M ( |
|
|
|
| 4 GB |
| Decodes and resamples audio to 16 kHz mono float32 numpy; startup |
|
|
|
| 12 GB |
| Uses vLLM OpenAI server (with optional |
|
|
|
| 10 GB |
| Meta MusicGen ( |
|
|
|
| 16 GB |
| Diffusers text-to-video MP4 generation (Wan2.1 / CogVideoX / LTX-Video) with CPU offload and VRAM optimization |
|
|
|
| 12 GB |
| Qwen2.5-VL multimodal image analysis ( |
|
|
|
| 4 GB |
| OpenAI-compatible dense vector embeddings ( |
Deep dive and curated model list (plus custom Hugging Face causal LM IDs): docs/recipes.md.
Live Verification Results
Core recipes, real idle auto-teardown, Web Studio, and the 17-tool Streamable HTTP MCP surface were tested end-to-end against live Google Colab GPUs (google-colab-cli v0.8.0, Python 3.13, PyTorch 2.14, CUDA 13.0):
Total Compute Units Consumed:
0.16 CU(999.82 CU → 999.66 CU, well under the2.0 CUtest budget)Zero-Leak Cleanup Verified After Every Test:
Usage rate: 0.00/hr,Active assignments: 0, zero lingering Colab sessions
# | Live Test | Result | Verified Outcome |
1 | LoRA Training ( | PASS | 4-bit QLoRA ( |
2 | Voice TTS ( | PASS | Synthesized valid 93,644-byte |
3 | Audio Transcription ( | PASS | Transcribed Test 2's 1.95s WAV via GPU |
4 | Image Generation ( | PASS | Auto-fell back to |
5 | LLM Serving ( | PASS | Served |
6 | Daemon + Web Studio + MCP (17 Tools) + Tray Smoke Check | PASS ( | Verified |
Empirical Colab Runtime & Compute Unit Table
Measured live against Google Colab Pro/Pro+ (google-colab-cli + OpenSSH proxy):
Runtime | Boot Time | Live Burn Rate | Verified Hardware |
|
CPU | ~5s |
| Standard CPU, 12 GiB RAM | — |
T4 | ~10s |
| Tesla T4 (15.4 GiB VRAM), 12 GiB RAM | 235.6 GB free |
L4 | ~11s |
| NVIDIA L4 (23.0 GiB VRAM), 52 GiB RAM | 235.6 GB free |
A100 | ~4s |
| A100-SXM4 (40.9 GiB VRAM), 83 GiB RAM | 236 GB free |
G4 | (capacity-dependent) |
| RTX PRO 6000 Blackwell (96 GiB VRAM), 176 GiB RAM | 236 GB |
H100 | (capacity-dependent) |
| NVIDIA H100 (80 GiB VRAM), 176 GiB RAM | 236 GB |
Desktop Tray App (macOS & Linux, Tauri v2)
app/ packages the colab-forge daemon, compiled React 19 Web Studio (web/dist/), and a SHA-256-verified Node.js 22 LTS sidecar into a native Tauri v2 menu-bar / system-tray app:
Live 5s CU Status Badge: Polls
GET /api/tray-summaryevery 5 seconds (Idle · 999.7 CU (0.00/hr)orActive · 1 GPU · 2.33 CU/hr · 8m left).Native Web Studio Window: Opens or focuses a
1340×860window (min960×640, remembers window bounds). Closing the window keeps the tray app and daemon alive in the background.Instant Stop All GPUs Kill Switch: Calls
POST /api/sessions/stop-alldirectly from the menu bar to terminate active Colab VMs and SSH tunnels immediately.One-Click Client Wiring & Autostart: Copies
http://127.0.0.1:<port>/mcp, toggles Claude Code / Cursor / Codex / Claude Desktop in Connect a client ▸, and manages OS login autostart (tauri-plugin-autostart).Graceful
SIGTERMShutdown: Quitting sendsSIGTERMto the sidecar daemon and waits for active Colab GPUs and SSH tunnels to terminate cleanly before exit.
# Build TS + Web Studio + Tauri v2 bundle (embeds latest dist/ and web/dist/)
pnpm build && pnpm app:build
# Launch on macOS
open "app/src-tauri/target/release/bundle/macos/Colab Forge.app"On Linux, pnpm app:build produces .deb and .AppImage bundles under app/src-tauri/target/release/bundle/. See app/README.md for Rust/system prerequisites and dev mode (cd app && npm run dev).
Connect AI Coding Clients (17 MCP Tools)
colab-forge connect injects the Streamable HTTP MCP server entry (http://127.0.0.1:7860/mcp) into your client's config file, preserves existing servers, and writes an atomic 0600 .bak backup before touching disk:
# Preview changes without modifying disk
colab-forge connect claude-code --dry-run
# Configure your client
colab-forge connect claude-code
colab-forge connect cursor
colab-forge connect codex
colab-forge connect claude-desktop
# Remove cleanly later
colab-forge connect cursor --removeTo keep the daemon running in the background without the desktop app, install the CLI OS service (macOS LaunchAgent or Linux systemd --user):
colab-forge service install
colab-forge service status
colab-forge service uninstallThe repository also ships a cost-aware Agent Skill at plugin/skills/colab-forge/SKILL.md that teaches agents to check colab_status first, pick the smallest GPU tier that fits VRAM, batch warm inference calls, and shut down sessions when done. Full 17-tool reference and OpenAI SDK examples: docs/mcp-and-agents.md.
Custom Recipes & Zero-CU Dataset Pre-Flight
Copy examples/custom-recipe.yaml into ~/.config/colab-forge/recipes/*.yaml to register your own GPU service or batch training job without writing TypeScript. Template variables ({{sessionName}}, {{gpu}}, {{vramGb}}, {{remotePort}}, {{idleTimeoutSec}}, {{remoteWorkDir}}, {{remoteOutputDir}}, {{params.<name>}}) interpolate automatically, and validated parameters are also exported as base64 JSON in COLAB_FORGE_PARAMS_JSON for injection-safe Python access.
mkdir -p ~/.config/colab-forge/recipes
cp examples/custom-recipe.yaml ~/.config/colab-forge/recipes/custom-embeddings.yaml
colab-forge recipesFor programmatic recipes with custom Zod schemas, upload specs, or progress parsers, import from the zero-side-effect colab-forge/recipe export (defineRecipe, PreflightValidationError, z, GPU_TIERS, DEFAULT_REMOTE_PORT).
Before provisioning any GPU for LoRA training, train-sft-lora and POST /api/preflight/dataset stream-validate local .jsonl/.json/.csv files (text, messages, instruction/output, prompt/completion, or custom textField) and fail fast with HTTP 400 (PREFLIGHT_FAILED) on missing files or malformed lines at 0 CU.
CLI Reference
Command | Description |
| Verify Node >= 22, |
| Start loopback daemon (Web Studio, MCP server, OpenAI gateway) with optional idle-timeout override |
| Show live CU balance, burn rate, active GPUs, orphans, countdowns, and recent jobs |
| List all 10 built-in recipes and custom |
| Run QLoRA/LoRA fine-tuning with pre-flight validation, live streaming metrics, checkpoint sync, and auto-stop |
| Upload and run any local Python training script/project with |
| Warm up a service recipe ( |
| Run multimodal GenAI inference via the local |
| Inspect or cancel training jobs ( |
| Open (or print with |
| Stop one or all active Colab GPU sessions (and orphan VMs in offline fallback) |
| Safely inject or remove the |
| Manage macOS LaunchAgent / Linux |
Documentation Index
Guide | What's Inside |
Zero-to-first-GPU walkthrough: | |
Detailed breakdown of all 10 built-in recipes, curated live-verified LLM models, custom YAML recipes, and the | |
Wiring up Claude Code, Cursor, Codex, and Claude Desktop, OpenAI SDK drop-in examples, full 17-tool MCP catalog, Bearer auth, and cost-aware agent patterns | |
System diagram, SSH-first multiplexing rationale, security controls, two-layer idle watchdog, and the complete HTTP / SSE / OpenAI gateway contract | |
Building, running, and troubleshooting the native Tauri v2 menu-bar app for macOS and Linux | |
Interactive Recipe Workbench, GPU/CU burn estimator, and tray demo (source in | |
Source code, issues, and release history |
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
214 tools for AI agents over one MCP endpoint: image, video, audio, 3D, data, storage, mail, GPUs.
Persistent cloud workspaces for AI agents: run commands, edit files, use git and a browser.
Linux VMs for AI agents: create VMs, run commands, edit files and open preview URLs.
AI cloud for agents: launch GPUs, run jobs that stop their own billing, schedule runs.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to autonomously manage Google Colab GPU sessions, submit and monitor training jobs, and debug/fix issues via an encrypted tunnel without requiring a browser tab.MIT
- AlicenseBqualityBmaintenanceEnables 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.424Apache 2.0
- AlicenseBqualityBmaintenanceEnables AI assistants to run and manage machine-learning training on Kaggle, Google Colab, and Hugging Face GPUs. Supports background runs, status and metrics, plots, checkpoints, Kaggle submissions, and Hugging Face Hub operations.58MIT
- AlicenseNot gradedqualityBmaintenanceConnects AI coding assistants to consumer Google Colab so they can run Python code, execute full .ipynb notebooks, and capture plots and outputs on CPU, GPU (T4/L4/A100/H100), or TPU runtimes. It handles Google authentication, runtime provisioning and re-attachment, keep-alive heartbeats, and Jupyter kernel messaging without manual browser interaction.Apache 2.0