Skip to main content
Glama

Google Colab MCP Bridge

A persistent web application and agent execution bridge for Google Colab Model Context Protocol (MCP).


Why this exists

Normally, executing code through standard MCP scripts starts a new server process every run, causing Google Colab to open a brand-new browser tab on every single command.

gcolab_mcp_web_mcp solves this:

  • It runs a single persistent background daemon that pairs with your Google Colab tab once.

  • You can execute unlimited commands, scripts, machine learning workloads, or shell commands with zero new tabs opened.

  • Exposes both a sleek dark-mode Web Dashboard and a REST/JSON API for AI agents.


Related MCP server: colab-mcp

Quick Start

1. Launch the Application

You can now start it with any of these simple commands (no flags needed):

./start.sh

or

python3 run.py

or

uv run run.py

(Dependencies are declared inside run.py and are automatically handled on the fly).

2. Open the Dashboard

Navigate to http://localhost:8000 in your browser.

3. Connect Colab Once

  • Click "Connect Colab Tab" (or open the provided URL in your browser).

  • Your Colab tab will display: "Connected to local Colab MCP server".

  • The dashboard status indicator turns 🟢 Connected to Colab.


Features

  1. One-Click Cloud Code Execution:

    • Write Python or shell commands (e.g., !nvidia-smi, !pip install) and run them directly on Colab's cloud GPU.

    • Shortcut: Ctrl + Enter to execute.

  2. Real-time Terminal Output:

    • Live stdout, stderr, execution timer, copy output, and plot support.

  3. Notebook Cell Manager:

    • Inspect all existing cells in your Google Colab notebook, run specific cells, or delete cells directly from the dashboard.

  4. W3C WebMCP Standard Support (Browser Native):

    • Exposes browser tools via navigator.modelContext.registerTool:

      • execute_python_on_colab: Runs code remotely on the Colab kernel.

      • get_colab_notebook_cells: Fetches notebook cells.

      • check_colab_status: Checks connection state.

    • Annotated Declarative Form (toolname="executeColabCode").

    • Compliant HTTP headers (Permissions-Policy: tools=(self), Origin-Agent-Cluster: ?1).

    • Compatible with Chrome Canary (chrome://flags/#enable-webmcp-testing) and includes an automatic in-page polyfill and tester.

  5. AI Agent Integration API (REST):

    • External agents (or scripts) can send code to Colab via a simple HTTP request:

curl -X POST http://localhost:8000/api/execute \
  -H "Content-Type: application/json" \
  -d '{"code": "import torch; print(torch.cuda.is_available())"}'
import requests

response = requests.post("http://localhost:8000/api/execute", json={
    "code": "!nvidia-smi"
})
print(response.json()["output"])

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    A Model Context Protocol server that enables users to control and interact with Google Colab instances via a reverse proxy. It supports executing shell commands, running persistent Python code, and monitoring system resources like CPU, GPU, and RAM.
    -
  • A
    license
    B
    quality
    D
    maintenance
    Local-first MCP server for controlling Google Colab as a development, shell, file, and training runtime, with tools for notebook editing, GPU acceleration, and file transfer.
    59
    8
    Apache 2.0
  • A
    license
    A
    quality
    C
    maintenance
    Enables 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.
    10
    3
    MIT