Colab MCP
Connects an agent to Google Colab in a browser tab, allowing it to open or attach to an existing Colab notebook and interact with the notebook through MCP tools and resources after browser authentication.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Colab MCP open a scratch Colab notebook and run a quick test cell"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Colab MCP
A local stdio MCP server that connects an agent to a Colab browser tab.
Python 3.13+; the only runtime dependency is websockets==17.4.
Run from the checkout without installing the project or creating a virtual environment:
# Skip this if websockets is already installed.
python -m pip install --only-binary=:all: websockets==17.4
cd src
python -m colab_mcpThe server waits for MCP messages on stdin. Normally your MCP client launches it. For Codex, use this configuration with your actual checkout path and Python executable:
[mcp_servers.colab]
command = "python"
args = ["-m", "colab_mcp"]
cwd = 'D:\path\to\colab-mcp\src'
tool_timeout_sec = 120Call open_colab_browser_connection to open a scratch notebook. Its optional
notebook_url argument opens an existing HTTPS Colab notebook. Sign in and accept
Colab's connection prompt in the browser. Notebook tools appear after connection;
the MCP client must handle notifications/tools/list_changed. Keep the tab open.
If the browser cannot open or connection times out, the tool returns a manual URL.
src/minimcp contains the independent, standard-library-only protocol code:
JSON-RPC, initialization, notifications, cancellation, and stdio. It supports MCP
2025-11-25, 2025-06-18, and 2024-11-05; it does not implement HTTP/OAuth or task
extensions. src/colab_mcp handles browser authentication and forwards tools,
resources, prompts, progress, and supported client callbacks.
Logs go to stderr, or to a directory supplied with --log. The WebSocket listener
binds to 127.0.0.1, accepts one tab, and checks its token and Colab origin.
Run checks from the repository root with python -m pytest. Tests need only pytest
and websockets; they do not open a real browser or contact Google.
Building an installable wheel uses Hatchling, declared in pyproject.toml.
Running from src does not load or require that build backend.
Available Tools
11 toolscall_notebook_toolA
Call a tool provided by the connected Colab browser. First use list_notebook_tools to get its exact name and argument schema.
Inputs: name (required), arguments (required).
cancel_transferB
Cancel a file transfer and remove its incomplete temporary files where the connection is still available.
Inputs: transfer_id (required).
connect_colab_tabA
Move this MCP connection to an existing Colab tab from list_colab_tabs. The Chrome companion transfers the token automatically without reloading the target notebook. Does not change its runtime or execute cells. Finish or cancel file transfers first.
Inputs: tab_id (required).
download_fileADestructive
Download a Colab file to the local machine, creating parent directories as needed. Supports arbitrary file types. Requires the Chrome companion and a connected runtime. Returns a transfer_id immediately; use transfer_status to check progress. File bytes do not enter the conversation. Only one transfer runs at a time. Existing files require overwrite=true.
Inputs: colab_path (required), local_path (required), overwrite.
list_colab_tabsARead-only
List open Colab tabs using the optional Chrome companion. Returns tab IDs, titles, URLs, and which tab is connected. Open a Colab connection first.
Inputs: no named parameters.
list_notebook_toolsARead-only
List the connected Colab browser's tools and their input schemas. Call after open_colab_browser_connection, then use call_notebook_tool. If nextCursor is returned, pass it as cursor to read the next page.
Inputs: cursor.
open_colab_browser_connectionA
Connect to a Colab notebook in the browser and unlock its notebook tools. When disconnected, opens a scratch notebook or the supplied notebook_url. Waits up to 60 seconds for a connection. The optional Chrome companion accepts the matching MCP connection prompt automatically.
Inputs: notebook_url. Returns: result
runtime_actionADestructive
Manage this notebook's runtime using the optional Chrome companion. Returns immediately; check runtime_status for completion or errors. Connect uses the notebook's selected runtime. Disconnect detaches the tab; delete releases its runtime and loses its files and memory. Restart clears kernel memory. Configure changes runtime settings and may replace a running runtime. GPU/TPU and high-memory availability depend on the user's account. The user handles any Colab permission or confirmation dialogs.
Inputs: action (required), accelerator, high_memory, accelerator_model.
runtime_statusARead-only
Report whether the optional Chrome companion is connected, the current Colab runtime state and settings, and the last runtime operation. Use this to check completion after runtime_action.
Inputs: no named parameters.
transfer_statusARead-only
Get progress, completion, or error details for a file transfer. The last 20 transfers are retained.
Inputs: transfer_id (required).
upload_fileADestructive
Upload a local file to Colab, creating parent directories as needed. Supports arbitrary file types. Requires the Chrome companion and a connected runtime. Returns a transfer_id immediately; use transfer_status to check progress. File bytes do not enter the conversation. Only one transfer runs at a time. Existing files require overwrite=true.
Inputs: colab_path (required), local_path (required), overwrite.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Most tools have clearly distinct roles, and the async status/cancel companions make transfer and runtime workflows easy to separate. The main overlap is around connection setup: open_colab_browser_connection, connect_colab_tab, and runtime_action's connect option all use similar 'connect' language, so an agent may need to read descriptions carefully.
All tool names use snake_case and are mostly verb_noun patterns such as upload_file, list_colab_tabs, and call_notebook_tool. runtime_status, runtime_action, and transfer_status use noun+status/action instead, but this is a minor and readable deviation.
Eleven tools is well-scoped for a Colab bridge: runtime control, file transfer, tab connection, and notebook-tool proxying each get a small, purposeful set. No tool appears redundant or included merely to pad the count.
The surface covers connection setup, runtime control, bidirectional file transfer with progress/cancel, and dynamic notebook tool discovery/invocation. Minor gaps remain, such as no explicit remote file listing/deletion or browser-connection close tool, though these may be handled through notebook tools or runtime disconnect.
Maintenance
Related MCP Connectors
Read a project's prompts, logs and agents, and send new work to the agent on your own machines.
Connect ChatGPT, Claude, Cursor or VS Code to your Windows PC: files, terminal, browser, apps.
Persistent cloud workspaces for AI agents: run commands, edit files, use git and a browser.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Related MCP Servers
AlicenseAqualityDmaintenanceBridges a local agent to a Colab session in the browser, enabling seamless interaction with Colab from local clients.11,457Apache 2.0- AlicenseDqualityBmaintenanceEnables agents to control Google Colab notebooks through a secure, headless WebSocket architecture, allowing cell creation, editing, execution, and inspection without browser automation.133Apache 2.0
- AlicenseAqualityDmaintenanceBridges a local AI agent to a Colab session in the browser, enabling code execution and file operations through the Model Context Protocol.29Apache 2.0
- AlicenseAqualityCmaintenanceEnables local agents to connect to and interact with Google Colab sessions running in the browser.3Apache 2.0