Colab MCP is an open-source Model Context Protocol (MCP) server that bridges the gap between local AI coding agents and a live Google Colab notebook running in your browser. Traditionally, AI agents have had no reliable way to interact with a running Colab session — reading cell outputs, modifying notebook content, or executing code in the cloud runtime. Colab MCP solves this by acting as a local intermediary: it starts a WebSocket server onDocumentation 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.
localhost, which the Colab frontend connects to, and then exposes the resulting notebook capabilities as MCP tools your agent can call directly.
How It Works
The architecture has three cooperating pieces:- Local MCP server — Built with FastMCP, the server starts on your machine and is registered with your MCP client just like any other server.
- WebSocket bridge — On startup, a
ColabWebSocketServerbinds to an ephemerallocalhostport and waits for the Colab browser tab to connect. The connection is secured with a one-time token embedded in the notebook URL. - Colab browser session — When your agent calls the
open_colab_browser_connectiontool, Colab MCP opens a scratch notebook in your default browser. Once that tab loads and handshakes with the local WebSocket server, notebook editing tools are injected dynamically into the MCP tool list.
Key Capabilities
- Dynamic tool injection — Notebook tools are not present at startup; they appear automatically the moment the Colab browser session connects, and disappear if it disconnects. This is powered by FastMCP’s
ToolInjectionMiddlewareand the MCPnotifications/tools/list_changednotification. - Single connection model — Only one Colab session may be connected at a time, preventing accidental cross-session interference.
- Secure token validation — Every WebSocket connection is authenticated with a
secrets.token_urlsafe(16)token, so only the intended Colab tab can connect. - Configurable logging — Server logs are written to a timestamped file in a temp directory by default, with a
--logflag to override the location.
Explore the Docs
Quickstart
Install Colab MCP, configure your client, and run your first agent command against a live Colab notebook in under 5 minutes.
Supported Clients
See which MCP clients are compatible and understand the requirements around local execution and tool-change notifications.
Architecture
Dive deeper into the WebSocket bridge, token authentication, and how FastMCP proxy and middleware fit together.
Tool Reference
Full reference for every MCP tool exposed by Colab MCP, including
open_colab_browser_connection and the injected notebook tools.Colab MCP requires an MCP client that supports the
notifications/tools/list_changed notification — this is how your agent learns that new notebook tools have become available after the browser connects. The server also binds exclusively to localhost, so your MCP client must be running locally on the same machine. Cloud-hosted or remote agents will not be able to reach the WebSocket server. See Supported Clients for a verified list.