Colab-Hub
Creates, executes, monitors, and tears down Google Colab Pro runtimes (CPU/T4/L4/A100) for asynchronous GPU jobs, including heartbeat watchdogs and idempotent delete_runtime cleanup.
Reads and writes job inputs, outputs, caches, models, and summaries under Drive:/Colab-Hub/, with atomic cache artifacts and per-job artifacts for persistent storage.
Provides an interactive control center via Telegram Bot API/webhooks, with live job cards, quick-run inbox actions, menu controls, stop-all-GPUs, and auth reminders.
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-Hub: Cloudflare–Colab Async MCP Orchestrator & Interactive Control Center
English | Bahasa Indonesia
Colab-Hub is a $0/month Remote Streamable HTTP MCP Server on Cloudflare Workers + SQLite Durable Objects that turns Google Colab Pro (CPU / T4 / L4 / A100) into an asynchronous, unattended GPU compute backend controlled directly from Gemini Chat, backed by Google Drive (Drive:/Colab-Hub/) for persistent storage/caching and Telegram as a real-time Interactive Control Center.
Live-Verified Architecture: End-to-end verified on Cloudflare Workers Free Plan (~179 KiB raw / ~42 KiB gzip, ~3 ms startup) driving live Google Colab Pro runtimes (
colaboratory.googleapis.com/mcp), Google Drive API v3, and Telegram webhooks.
Why Colab-Hub?
Conversational LLMs excel at reasoning and synthesis, but hit hard physical ceilings when tasks require:
Specialist CUDA GPU models: Arabic/RTL & manuscript OCR (
Surya,Marker,Kraken), long-form Arabic lecture transcription & diarization (Faster-Whisper+Demucs+Pyannote), classical Arabic computational linguistics (CAMeL Tools,CAMeLBERT-CA,Parselmouth/Praat,ByT5'Arudh), media restoration, and model fine-tuning.Datacenter bandwidth & system binaries:
yt-dlp,aria2c,XeLaTeX/Typst,DuckDB/Polars, and.apkgAnki generation.Multi-minute to multi-hour unattended pipelines without triggering MCP client timeouts or leaking Google Colab Pro Compute Units (CU).
Related MCP server: mcp-colab-gpu
Dual-Plane Architecture ("4 Homes")
flowchart TB
subgraph UX["Clients & Interactive UX"]
Gemini["Gemini Chat\nStreamable HTTP MCP\nPOST /mcp/:secret (<150ms writes)"]
TG["Telegram Control Center\nLive Job Cards · Separate /menu\nInbox Quick Run · Stop All GPUs"]
end
subgraph CP["Home 1: Control Plane — Cloudflare Workers Free Plan ($0/mo)"]
Router["Edge Router (src/router.ts)\nConstant-time Auth · OAuth CSRF"]
DO["JobOrchestratorDO (SQLite Singleton)\n8 Tables · Deterministic recomputeNextAlarm()\nMax 1 Provision/Tick · Token Broker (503/401)"]
Router --> DO
end
subgraph REPO["Home 2: Recipe Repo (GitHub)"]
GH["runner/colab_runner.py\nrecipes/*.py + constraints/*.txt\n(Add recipes with 0 Worker redeploy)"]
end
subgraph EXEC["Home 3: Compute Plane — Google Colab Pro VM (Ephemeral)"]
Colab["Official Colab MCP (colaboratory.googleapis.com/mcp)\n1. create_runtime (idempotent UUID)\n2. execute_code (UTF-8 Base64 bootstrap)\n3. Detached runner + 180s daemon heartbeat + uv venv\n4. delete_runtime (guaranteed async teardown)"]
end
subgraph STORE["Home 4: Storage Plane — Google Drive 5 TB (Drive:/Colab-Hub/)"]
Drive["inbox/ · outputs/<date>_<slug>_<id>/\ncache/ (atomic .tar.zst + appProperties.sha256)\ncorpora/ · models/ · custom_modules/"]
end
Gemini -->|JSON-RPC 2.0| Router
TG <-->|Webhook + Bot API| Router
DO <-->|JSON-RPC · 0ms CPU wait| Colab
Colab -->|HTTPS Raw / API Fetch| GH
Colab -->|Pure-SQLite Webhook + Token Broker| Router
Colab <-->|Direct Drive API v3 ~150-300 MB/s| Drive
DO -->|Range <=64KB Summary & <=1.5MB PNG| DriveProduction Engineering Highlights
Every invariant below is implemented in code, covered by automated tests (Vitest + node:sqlite and Python unittest), and verified against live Cloudflare & Google Colab production edge behavior:
Engineering Pillar | What Is Built & Verified | Code Reference |
Anti-Timeout MCP & Pure-SQLite Hooks |
| |
Anti-Zombie GPU Teardown & Pool Caps | Strict FIFO pool limits ( | |
Cost & Payload Blast-Radius Guards | High-cost requests ( | |
Mid-Job OAuth Rescue (7-Day Gmail Cycle) | Personal | |
Zero Secret Leaks Inside Ephemeral VMs | Per-job | runner/colab_runner.py, recipes/custom_script.py, SECURITY.md |
Battle-Tested Production Edge Fixes | Live deployment surfaced and permanently fixed: | src/auth/google.ts, src/colab/client.ts, runner/colab_runner.py |
Capabilities: Wave 1 (Live) vs. Wave 2 (Roadmap)
All 13 recipes are defined in src/recipes/registry.ts across 4 zones. Only Wave 1 recipes have runnable: true; attempting to submit a Wave 2 recipe from MCP or Telegram Quick Run is cleanly rejected until implemented.
Wave 1 — Live & Production-Verified (6 Recipes)
Zone | Recipe | Default Profile | Implemented Capabilities |
Zone 1: Media & Audio |
|
|
|
|
|
| |
Zone 2: Documents & OCR |
|
|
|
Zone 3: Arabic & Turats |
|
| Polite official Shamela MCP mode ( |
Zone 4: Setup & Escape Hatch |
|
| Day-0 initializer: verifies all 6 |
| Any | Sandboxed Python escape hatch ( |
Wave 2 — Schema-Defined Blueprint (7 Recipes, runnable: false)
Zone | Planned Recipe | Target Profile | Planned Scope |
Zone 1 |
|
|
|
Zone 2 |
|
| Print-ready Arabic RTL typesetting ( |
|
| Multi-GB CSV/Parquet analytics ( | |
Zone 3: Arabic Lab Benches |
|
| Bench A: |
|
| Bench B: | |
|
| Bench C: | |
Zone 4 |
|
|
|
Telegram Interactive Control Center Flow
Every job owns a dedicated live-updating card message (separate from the persistent /menu dashboard) so real-time progress edits never overwrite navigation menus:
sequenceDiagram
actor User
participant TG as Telegram Bot
participant DO as JobOrchestratorDO (SQLite)
participant Colab as Colab Pro VM
User->>TG: /inbox → Tap PDF → [Confirm Run]
TG->>DO: POST /api/telegram/webhook (atomic one-time token)
DO-->>TG: 200 OK + Enqueue job (<150ms) + alarm(+250ms)
DO->>Colab: alarm() → create_runtime + Base64 bootstrap
Colab->>DO: POST /webhook (started / progress / 180s heartbeat)
DO->>TG: editMessageText (Live Job Card + [Live Log] / [Stop])
Colab->>DO: POST /webhook (completed + summary_file_id) [0 subrequests]
DO->>Colab: Next alarm() → delete_runtime (guaranteed teardown)
DO->>TG: Final card ([Open Drive] / [View Summary]) + sendPhoto (<=1.5MB)Documentation Index
Document | Contents |
Threat model, secret isolation controls, CSRF/auth invariants, payload caps, and vulnerability reporting. | |
docs/SETUP.md (ID) | End-to-end deployment guide (GitHub, Google Cloud OAuth + Colab/Drive APIs, BotFather, |
docs/USAGE.md (ID) | Daily workflows, Gemini Chat prompts by Zone, CPU→GPU multi-stage pipelines, Telegram |
docs/MCP_API.md (ID) | Complete reference for all 8 anti-timeout MCP tools, Streamable HTTP JSON-RPC 2.0 compliance, and Worker HTTP/webhook routes. |
docs/RECIPES.md (ID) | Developer guide for |
Archived architectural specification post-adversarial audit (8-table DO SQLite schema, state machine, anti-zombie defenses, Free Plan budget). | |
Archived 9-task TDD implementation plan for Wave 1. | |
Full Indonesian overview. |
Quickstart & Local Verification
Prerequisites: Node.js >= 22.13.0 (built-in node:sqlite), Python >= 3.11, Cloudflare Free Plan account, Google account with Colab Pro + Drive, and a Telegram Bot.
# 1. Install dependencies & run the full TypeScript quality gate (typecheck + 46 Vitest tests + offline Wrangler bundle check)
npm ci
npm run check
# 2. Run the Python runner & Wave 1 recipe unit tests (12 tests)
python -m unittest discover -s tests/python -v
# 3. Deploy to Cloudflare Workers (see docs/SETUP.md for OAuth & Wrangler secrets)
npx wrangler login
npx wrangler deploy
# 4. Register Telegram webhook/commands & send your 1-click Google OAuth link to Telegram
curl -X POST "https://<WORKER-NAME>.<SUBDOMAIN>.workers.dev/admin/telegram/setup" \
-H "Authorization: Bearer <ADMIN_SECRET>"Connect Gemini Chat → Custom Streamable HTTP MCP using:
https://<WORKER-NAME>.<SUBDOMAIN>.workers.dev/mcp/<MCP_PATH_SECRET>(CLI / custom MCP clients can also use POST /mcp with Authorization: Bearer <MCP_PATH_SECRET>.)
License
Released under the MIT License. Third-party Python packages dynamically installed inside the user's ephemeral Colab VM at runtime (such as surya-ocr/marker-pdf, faster-whisper, or aria2c) are not bundled in this repository and remain subject to their respective upstream licenses.
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
Run and track ML experiments on your lab's own GPU machines from one conversation.
On-demand GPU nodes for agents: create nodes, run commands, and submit jobs, billed by the minute.
Let AI assistants post to your Telegram chats, groups and channels. Not affiliated with Telegram.
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables remote control of AI coding assistants (Claude Code/Codex) via Telegram, allowing you to manage long-running tasks, send commands, and receive notifications from anywhere. Supports unattended mode with smart polling for up to 7 days and multi-session management.830MIT
- AlicenseAqualityDmaintenanceEnables MCP-compatible AI assistants to run Python code on Google Colab GPU/TPU runtimes, supporting accelerators like T4, A100, H100, with background execution and Google Drive integration.103MIT
- AlicenseAqualityDmaintenanceMCP server that allocates Google Colab GPU runtimes (T4/L4) and executes Python code on them. Lets any MCP-compatible AI assistant run GPU-accelerated code without local GPU hardware.39MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables 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