colab-mcp
Bridges a local agent to a Google Colab session in the browser, enabling code execution and retrieval of notebook outputs.
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 Run a cell in my Colab notebook that prints the Python version."
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
An MCP server for bridging your local agent to a Colab session in the browser.
Supported Clients
This MCP server requires client support for notifications/tools/list_changed and for the client to be running locally on your device.
Popular clients that fit these criteria include:
Gemini CLI
Claude Code
Windsurf
Setup
Install
uv(pip install uv)Configure for usage (eg for mcp.json style services):
...
"mcpServers": {
"colab-mcp": {
"command": "uvx",
"args": ["git+https://github.com/googlecolab/colab-mcp"],
"timeout": 30000
}
}
...(If you have a non-standard default package index (Googlers), you may also need to add --index https://pypi.org/simple)
Issues & Discussions
We are using GitHub discussions as the place for issue discussion and feature requests. As discussions mature into action items, we will add those items as issues. This helps us ensure that issues in the issue tracker are well-understood, deduplicated, and actionable. For these reasons, please do NOT open issues directly.
Contributing
We unfortunately don't have the bandwidth to support review of external contributions, and we don't want user PRs to languish, so we aren't accepting any external contributions right now.
If you have a great idea or pain point, we would love to hear about it on our discussions page - the preferred place for issue discussion and feature requests.
Internal - For Colab Developers
Prerequisites
uvis required (pip install uv)Configure git hooks to run repo presubmits
git config core.hooksPath .githooksGemini CLI setup
...
"mcpServers": {
"colab-mcp": {
"command": "uv",
"args": ["run", "colab-mcp"],
"cwd": "/path/to/github/colab-mcp",
"timeout": 30000
}
}
...Available Tools
3 toolsget_colab_connection_infoA
Returns this server's connection token, port and a ready-to-use connect URL for manually connecting a Colab notebook (eg via the Colab command palette) when opening a browser directly is not possible
Inputs: no named parameters. Returns: object
open_colab_browser_connectionA
Opens a connection to a Google Colab browser session and unlocks notebook editing tools. Optionally pass notebook_url to connect to an existing notebook instead of a new scratch notebook. Returns a boolean representing whether the connection attempt succeeded
Inputs: notebook_url. Returns: result
reconnect_colab_sessionA
Re-opens the most recently used Colab notebook with the persisted session token and port, resuming the connection after this MCP server has restarted. Returns a boolean representing whether the reconnection succeeded
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: opening a new connection, retrieving connection metadata, and reconnecting a previous session. No overlap exists, as the actions are complementary and easily distinguishable.
All tool names follow a consistent verb_noun pattern (open, get, reconnect) with snake_case, maintaining a uniform and predictable structure throughout the set.
With only 3 tools, the server is tightly scoped to connection management, and each tool is essential for that purpose. This is well within the ideal range for a focused server.
The surface covers the core connection workflow (open, info, reconnect) but lacks an explicit close/disconnect tool. However, this is a minor gap that does not break the primary use case of establishing and resuming connections.
Maintenance
Related MCP Connectors
Let AI agents use any website you're logged in to. Sessions stay encrypted on your machine.
Connect AI agents to the Totem network for communication and work coordination.
Connect AI agents to Replynodes over the Model Context Protocol.
Work on your own computers from Claude or ChatGPT: run commands, edit and search files.
Related MCP Servers
AlicenseAqualityDmaintenanceBridges a local agent to a Colab session in the browser, enabling seamless interaction with Colab from local clients.11,488Apache 2.0- AlicenseDqualityDmaintenanceEnables 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
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to autonomously manage Google Colab GPU sessions, submit and monitor training jobs, and debug/fix issues via an encrypted tunnel without requiring a browser tab.MIT
- 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