Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/googlecolab/colab-mcp/llms.txt

Use this file to discover all available pages before exploring further.

This guide explains how to connect Claude Code — Anthropic’s AI coding tool — to a live Google Colab session using Colab MCP. After completing the setup, Claude can open a Colab notebook in your browser, read and write cells, and execute Python code on your behalf — all from within a Claude Code conversation.
1

Install uv

Colab MCP is launched via uvx, which is part of the uv toolchain. Install it with pip:
pip install uv
2

Configure Claude Code

Add Colab MCP to Claude Code’s MCP configuration file. Add the following mcpServers entry:
{
  "mcpServers": {
    "colab-mcp": {
      "command": "uvx",
      "args": ["git+https://github.com/googlecolab/colab-mcp"],
      "timeout": 30000
    }
  }
}
3

Start Claude Code

Launch Claude Code in your terminal or IDE. Claude Code will initialize and connect to the MCP servers defined in your configuration, including Colab MCP.
4

Open a Colab connection

Ask Claude to open a Colab browser connection. For example:
“Open a Colab browser connection”
Claude will call the open_colab_browser_connection tool. This starts a local WebSocket server, generates a secure token, and opens a Colab scratch notebook (empty.ipynb) in your default browser. The tool then waits up to 60 seconds for the browser tab to establish the connection.
Claude Code reports progress during the 60-second connection wait using three incremental steps: 1/3 (“The user is not connected to the Colab UI”), 2/3 (“Waiting for user to connect in Colab - will wait for 60s”), and 3/3 (either “The Colab UI is successfully connected!” or a timeout notice). If you see these messages, the process is working as expected.
5

Confirm in browser

Switch to your browser and wait for the Colab notebook to finish loading. Once the notebook connects to the local WebSocket server, Claude will report a successful connection at step 3/3. Notebook editing tools will then become available in the conversation.
Claude Code supports the notifications/tools/list_changed MCP notification, which is required for Colab MCP to work correctly. This notification signals to Claude Code that new tools (the notebook editing tools) have become available after the browser connection is established. If your MCP client does not support this notification, the notebook tools will not appear. See Troubleshooting for details.
6

Edit and run notebooks

With the connection established, Claude has access to the full set of notebook-specific tools. You can ask Claude to:
  • Execute Python code in the connected Colab notebook
  • Read the output of notebook cells
  • Write new cells or modify existing content
For example:
“Run a cell that installs pandas and prints its version”
“Show me the output of all cells in the notebook”

Build docs developers (and LLMs) love