Google releases colab-mcp: how agents automate Colab notebooks in production
Google has released colab-mcp, an open-source MCP server for Google Colab that gives AI agents direct access to notebooks and the runtime. The walkthrough shows how to build an agent loop with FastMCP, a WebSocket proxy and direct code execution, then harden it for production with retries, timeouts, cell dependencies and detailed execution reporting. That makes Colab more than an interface: it becomes a programmable environment for automating data analysis and experiments.
AI-processed from MarkTechPost; edited by Hamidun News
Google has released colab-mcp, an open server that lets AI agents control Google Colab notebooks over MCP and execute code in the runtime without manual work in the interface.
How colab-mcp works
colab-mcp is an MCP server for Google Colab that turns a browser notebook into a programmable working environment. An agent can do more than read the notebook's structure: it can add cells, run code and receive results back as ordinary tool calls.
The walkthrough shows how this setup is assembled, from a basic tool registry to a full server built on FastMCP, so developers understand not only the API but also the internals of tool registration, JSON Schema and asynchronous dispatching.
The authors start with a minimal MCPToolRegistry written by hand in Python. The example shows how a function becomes a tool, how a parameter schema is built from type hints, and how a client calls a tool by name with arguments. This approach is useful beyond Colab: it explains the basic MCP model without framework magic and clarifies what FastMCP does under the hood when an agent is shown a list of available actions.
The authors put particular emphasis on Google's two-mode architecture. In Session Proxy Mode, the agent works through a WebSocket bridge between the local MCP client and Colab open in the browser. In Runtime Mode, it connects directly to the kernel and runs Python code without any visual actions in the interface. The split matters: the first mode suits interactive work with a notebook, the second suits headless scenarios that need direct execution of computations and stable code execution on the runtime side.
Five steps to an agent
The hands-on part is split into five self-contained blocks that lead from a demo to production patterns. First, the author builds a minimal MCP registry by hand and registers tools such as execute_code, add_code_cell, add_text_cell and get_cells. The same approach is then moved to FastMCP, which hosts a more realistic server with a set of proxy and runtime tools. The result is not an abstract architecture but a sequential path: understand the protocol first, then replace the homemade parts with working infrastructure.
Next, the tutorial shows what a live link between an agent and Colab looks like. The example starts a secured WebSocket server with a token, emulates a browser client connecting, and checks that JSON-RPC calls pass between the frontend and the MCP client. It then builds a runtime engine with persistent state, lazy initialization and Jupyter-style output handling. The agent sees not just the fact that code ran, but a structured result, errors and intermediate data it can use for the next step.
The next level is a complete agent loop. The agent receives a task in natural language, picks the right tool, executes code, analyzes the result and, if needed, takes another step. According to the authors, this is the pattern used in real setups with Claude Code and Gemini CLI. As a result, Colab stops being a separate tab for manual work and becomes a compute backend that an LLM can control as part of a broader workflow.
- Basic MCP registry and schema generation
- Move to FastMCP and a more realistic server
- Session Proxy Mode with WebSocket, token and JSON-RPC
- Runtime Mode with direct code execution and kernel state
- Full agent loop with tool selection and result analysis
Reliability and launch
The most practical part is production orchestration on top of the runtime. The article presents RobustNotebookOrchestrator, which adds automatic retries with exponential backoff, timeouts via asyncio.wait_for and dependent cell execution. If one cell fails, downstream steps can be skipped, while individual blocks can be forced to run if needed. This approach helps with long notebooks, GPU jobs and pipelines where an error in the middle should not unpredictably break the whole process, but should be properly isolated and logged.
The demo runs a notebook of seven cells: several succeed, one deliberately raises a NameError, one is skipped automatically because of a dependency, and another runs despite the earlier failure. The system then prints a structured report for each cell, with status, duration and retry count. This is no longer a toy demo but a template for real research and engineering scenarios where observability, error control and predictable execution matter.
The author also shows a quick path to launch without heavy integration: install uv, add colab-mcp to the MCP config, open Colab in the browser and give the agent a natural-language command, for example to build a notebook for data analysis. Popular local clients such as Claude Code, Gemini CLI and Windsurf are supported, and for custom agents the tutorial shows a connection template via API with tool descriptions and a tool_use handling loop. This lowers the barrier to entry: you can connect a ready-made client first and write your own agent harness later.
What this means
colab-mcp moves Google Colab from a manual notebook toward a programmable environment for AI agents. For developers, it is a direct path to automating data analysis, experiments and model training without writing separate UI automation and without constantly switching between chat, code and browser.
If the tool takes hold in the MCP ecosystem, Colab could become one of the most convenient compute backends for agent scenarios.
- Dec 2, 202650 AI Models Beat 62 Teams at 'Zakovat': 48.3% Correct Answers vs 39.8%
- Dec 2, 2026OpenAI Opens Dots Agent to ChatGPT Plus Subscribers With 10,000+ Plugins
- Dec 2, 2026T-Decision-1 with 9B Parameters Beats Copernicus-57B on Russian: 71.6 vs. 71.2 Points
- Dec 2, 2026A Python Prompt Test in Under 150 Lines Catches Edits That Silently Break AI Answers
Key Questions Answered
How colab-mcp works?
colab-mcp is an MCP server for Google Colab that turns a browser notebook into a programmable working environment. An agent can do more than read the notebook's structure: it can add cells, run code and receive results back as ordinary tool calls. The walkthrough shows how this setup is assembled, from a basic tool registry to a full server built on FastMCP, so developers understand not only the API but also the internals of tool registration, JSON Schema and asynchronous dispatching.
What are the key details on Five steps to an agent?
The hands-on part is split into five self-contained blocks that lead from a demo to production patterns. First, the author builds a minimal MCP registry by hand and registers tools such as execute_code, add_code_cell, add_text_cell and get_cells. The same approach is then moved to FastMCP, which hosts a more realistic server with a set of proxy and runtime tools.
What are the key details on Reliability and launch?
The most practical part is production orchestration on top of the runtime. The article presents RobustNotebookOrchestrator, which adds automatic retries with exponential backoff, timeouts via asyncio.wait_for and dependent cell execution. If one cell fails, downstream steps can be skipped, while individual blocks can be forced to run if needed.
Free 2-Day Vibecoding & AI Agents Intensive
Day 1: the autonomous Hermes + DeepSeek AI agent — vibecoding and development on par with Claude Code / Codex / Gemini. Led by Jemal Hamidun, Head of AI at Alpina Digital and academic supervisor at MIPT. Right after you register with our bot Nika: the recording + 11 materials from the previous intensive.
Daily 60-sec AI Voice Brief + Weekly Production AI Agent Playbook
Listen to a 60-second AI news brief every morning and get a weekly hands-on playbook for shipping AI agents to production — tools, MCP servers and patterns that work. Curated by Jemal Hamidun, Head of AI at Alpina Digital.
