Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Enables agents to control Google Colab notebooks through a secure, headless WebSocket architecture, allowing cell creation, editing, execution, and inspection without browser automation.

README.md

Headless Colab MCP Server

colab-mcp is a FastMCP server for controlling Google Colab notebooks through a secure, headless WebSocket architecture. Agents can create, edit, run, and inspect notebook cells without browser automation or UI scraping.

---

Features

  • Headless Operation — Run notebook operations through a secure WebSocket proxy
  • Zero Browser Management — No Chromium, browser profiles, or DOM scraping
  • ML-Ready Tooling — Workspace setup, dataset handling, and pipeline execution
  • Structured Results — Typed stdout, stderr, file paths, and error details
  • FastMCP Integration — Clean MCP server interface for tool composition

---

Architecture

The server uses two cooperating layers:

ColabSessionProxy

  • Starts a localhost WebSocket server
  • Generates a one-time connection URL with mcpProxyToken and mcpProxyPort
  • Waits for an authenticated Colab tab to attach

NotebookController

  • Exposes the stable MCP tool surface
  • Discovers proxy capabilities from the connected Colab frontend
  • Maps server-owned tools to proxy-backed cell operations
  • Falls back to direct runtime execution only when needed

---

Requirements

| Requirement | Version | |-------------|---------| | Python | 3.13+ | | uv | Latest | | Google Colab | Active browser session |

---

Installation

uv sync
uv run colab-mcp

---

Configuration

Add this to your MCP configuration:

{
  "mcpServers": {
    "colab-mcp-local": {
      "command": "uv",
      "args": ["run", "colab-mcp"],
      "cwd": "${workspaceFolder}",
      "timeout": 30000
    }
  }
}

---

API Reference

Core Notebook Tools

| Tool | Description | |------|-------------| | connect_colab(notebook_url?) | Initialize connection and retrieve proxy URL | | list_colab_cells() | List all cells in the notebook | | read_colab_cell(cell_id) | Read a specific cell | | write_colab_cell(code, cell_id?, mode?) | Write code to a cell | | run_colab_cell(cell_id?, wait?, timeout_seconds?) | Execute a cell | | run_colab_code(code, mode?, wait?, timeout_seconds?) | Write and execute code in one step | | get_colab_output(cell_id?) | Retrieve execution output | | save_colab_notebook() | Save the notebook | | run_runtime_code(code) | Execute code directly in the runtime |

ML Workflow Tools

| Tool | Description | |------|-------------| | setup_ml_workspace(packages) | Install packages and create standard data directories | | fetch_remote_dataset(download_url, extract_to) | Download and extract datasets | | execute_ml_pipeline(code_block) | Execute Python blocks with structured results |

---

Usage

  1. Start the MCP server.
  2. Call connect_colab to get a connect_url, proxy_token, and proxy_port.
  3. Paste the connect_url into an active Colab tab.
  4. Wait for the proxy connection to establish.
  5. Run notebook operations through the MCP tools.

Example

uv run colab-mcp
connect_colab()
setup_ml_workspace(["pandas", "scikit-learn"])
fetch_remote_dataset(url, "/content/data")
execute_ml_pipeline(training_code)
get_colab_output()

---

Development & Verification

PYTHONPATH=src python scripts/smoke_test.py
PYTHONPATH=src py -m pytest
cat RELEASE_CHECKLIST.md

Test coverage

  • Proxy capability discovery
  • Native Colab argument mapping
  • Cell ID extraction
  • ML tool routing through proxy
  • Execution result normalization

---

License

This project is licensed under the Apache License 2.0.

---

Acknowledgments

This headless WebSocket proxy architecture was inspired by the open-source work provided by the Google Colab team.

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Browser & Scraping servers.