colab-drive-mcp
Prepares and edits notebooks compatible with Google Colab, normalizing Colab-specific metadata during downloads, and providing a URL to open notebooks in Colab.
Synchronizes, inspects, and edits .ipynb notebooks stored in Google Drive, including listing, uploading, downloading, and comparing local and remote copies.
Manages Jupyter notebook (.ipynb) files locally, including adding, updating, deleting cells, and clearing 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-drive-mcp list my notebooks in Drive"
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 Drive MCP
An MCP server for safely inspecting, editing, and synchronizing
Google Colab-compatible .ipynb notebooks through Google Drive.
This is a notebook file synchronization server, not a notebook execution
service. It transfers and edits .ipynb files through Google Drive. It
does not connect to Colab runtimes, execute cells, click Run all, keep
sessions alive, automate the Colab browser UI, or bypass Colab limits.
Use this MCP when an AI agent needs to prepare a notebook locally, synchronize it with Drive, inspect completed outputs, or return an edited notebook to the user. Open and execute the synchronized notebook separately in Colab, Jupyter, VS Code, or another notebook runtime.
Features
Inspect and edit notebook cells without loading the entire notebook.
Create, search, copy, upload, and download notebooks.
Report live upload and download progress to MCP clients that request it.
Compare local and Drive notebook copies using Drive metadata and content MD5.
Keep local file access inside a configured root directory.
Normalize Colab-specific stream output metadata during downloads.
Diagnose Google Drive setup without unexpectedly opening a browser.
Return actionable errors for missing credentials, expired authorization, permissions, missing files, and rate limits.
Related MCP server: colab-mcp
Non-goals
Starting, controlling, or monitoring a Google Colab runtime.
Detecting whether a Colab runtime is connected, busy, or executing a file.
Executing notebook cells locally or remotely.
Browser automation, automatic
Run all, or unattended Colab sessions.Circumventing Colab quotas, idle timeouts, access controls, or usage policies.
Deploying or running the project contained inside a notebook.
AI Contract
The MCP initialization response includes server-wide instructions that define this project as file synchronization only. Tool descriptions repeat the same boundary where it matters.
manifest.0 provides the same purpose, capabilities, and
non-goals as a typed Zero language contract for agents and repository tooling.
Tools
Setup
get_google_drive_status: diagnose dependencies, credentials, token, and scope.authorize_google_drive: explicitly open the Google OAuth browser flow.
Local notebooks
list_local_notebooks,get_local_notebook,create_local_notebookadd_local_cell,update_local_cell,delete_local_cellsearch_local_cells,clear_local_outputs
Google Drive
list_drive_notebooks,pull_drive_notebook,push_local_notebookget_notebook_sync_status,copy_drive_notebook,get_colab_url
pull_drive_notebook and push_local_notebook synchronize notebook files.
They send MCP progress notifications when the client supplies a progress token,
but clients decide whether and how to display those notifications. They never
execute notebook code. get_colab_url returns a URL but does not open a browser.
get_notebook_sync_status compares the local notebook's upload representation
with Drive's MD5 checksum and returns in_sync, differs, remote_only, or
unknown. It also returns Drive metadata such as modification time and version.
It cannot determine whether Colab is currently executing the notebook because
Google Drive does not expose Colab runtime activity.
Install
Run directly from PyPI with uvx:
COLAB_MCP_ROOT="$HOME/notebooks" uvx --from 'colab-drive-mcp[drive]' colab-drive-mcpOr install from source:
git clone https://github.com/YummyTastyCode/colab-drive-mcp.git
cd colab-drive-mcp
python3 -m venv .venv
.venv/bin/pip install -e '.[drive]'Run the server:
COLAB_MCP_ROOT="$HOME/notebooks" .venv/bin/colab-drive-mcpLocal tools can access only .ipynb files below COLAB_MCP_ROOT.
The server is published in the official MCP Registry as:
io.github.YummyTastyCode/colab-drive-mcpGoogle Drive Setup
First call get_google_drive_status. It does not open a browser or modify
files. Its response explains the next required step.
To enable Drive:
Create a Google Cloud project.
Enable the Google Drive API.
Configure the OAuth consent screen and add your account as a test user.
Create an OAuth Client ID with application type Desktop app.
Download the JSON to
~/.config/colab-mcp/credentials.json.Call
authorize_google_driveand complete the Google sign-in flow.
The resulting token is stored at ~/.config/colab-mcp/token.json.
Override these locations with:
COLAB_MCP_GOOGLE_CREDENTIALSCOLAB_MCP_GOOGLE_TOKEN
Never commit OAuth credentials or tokens.
Drive Access Modes
The default mode is file, using Google's narrower drive.file scope:
COLAB_MCP_DRIVE_ACCESS=fileThis mode can access files created or explicitly opened by this OAuth app. It cannot reliably list all existing notebooks in a user's Drive.
To find and update existing Drive notebooks, explicitly enable full access:
COLAB_MCP_DRIVE_ACCESS=fullChanging access modes may require deleting token.json and calling
authorize_google_drive again.
Codex Configuration
codex mcp add colab-drive \
--env COLAB_MCP_ROOT="$HOME/notebooks" \
--env COLAB_MCP_DRIVE_ACCESS=file \
-- /absolute/path/to/colab-drive-mcp/.venv/bin/colab-drive-mcpVS Code Configuration
Add this server to the VS Code MCP configuration:
{
"servers": {
"colab-drive": {
"type": "stdio",
"command": "/absolute/path/to/colab-drive-mcp/.venv/bin/colab-drive-mcp",
"env": {
"COLAB_MCP_ROOT": "/absolute/path/to/notebooks",
"COLAB_MCP_DRIVE_ACCESS": "file"
}
}
}
}Colab Compatibility
Google Colab may add a metadata property to stream outputs. That property is
invalid under the standard nbformat v4 schema. During Drive downloads, this
server removes only that incompatible property. Stream text and all other
outputs are preserved.
Security
OAuth tokens stay on the local machine.
Local tools are restricted to
COLAB_MCP_ROOT.Authorization requires an explicit
authorize_google_drivecall.Use
fileaccess unless full Drive discovery is required.Review actions before overwriting an existing Drive file.
This project is not affiliated with or endorsed by Google.
Development
.venv/bin/pip install -e '.[drive,test]'
.venv/bin/pytestAvailable Tools
16 toolsadd_local_cellC
Add a cell to a local notebook.
Inputs: path (required), cell_type (required), source (required), index.
authorize_google_driveA
Open an explicit Google OAuth flow and save the resulting local token.
Inputs: no named parameters.
clear_local_outputsC
Clear outputs and execution counts from a local notebook.
Inputs: path (required).
copy_drive_notebookC
Copy a notebook file in Google Drive without executing it.
Inputs: file_id (required), name (required).
create_local_notebookC
Create a new Colab-compatible local notebook.
Inputs: path (required), title, kernel_name.
delete_local_cellC
Delete a cell from a local notebook.
Inputs: path (required), index (required).
get_colab_urlB
Return a Colab URL for a Drive notebook; this does not open a browser.
Inputs: file_id (required). Returns: result
get_google_drive_statusA
Check Google Drive setup and authorization without opening a browser.
Inputs: no named parameters.
get_local_notebookC
Read a local notebook summary and its cells.
Inputs: path (required), include_source, max_source_chars.
get_notebook_sync_statusC
Compare Drive and local notebook state; cannot detect Colab runtime activity.
Inputs: file_id (required), local_path.
list_drive_notebooksB
List synchronized notebook files visible through the configured Drive access.
Inputs: query, limit. Returns: result
list_local_notebooksC
List local .ipynb notebooks under COLAB_MCP_ROOT.
Inputs: query, limit. Returns: result
pull_drive_notebookC
Synchronize a Drive notebook file into COLAB_MCP_ROOT without executing it.
Inputs: file_id (required), local_path (required).
push_local_notebookC
Synchronize a local notebook file to Drive without executing it.
Inputs: local_path (required), drive_name, file_id.
search_local_cellsC
Search cell sources in a local notebook.
Inputs: path (required), query (required), case_sensitive. Returns: result
update_local_cellC
Replace a cell's source and optionally its type.
Inputs: path (required), index (required), source (required), cell_type.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Each tool targets a distinct action (e.g., add/delete/update cells, push/pull notebooks, authorization) with no overlapping functionality. Descriptions clearly differentiate between local and Drive operations.
All tools follow a consistent verb_noun pattern in snake_case (e.g., add_local_cell, list_drive_notebooks), making the API predictable and easy for agents to navigate.
16 tools are well-scoped for managing local notebooks and Drive synchronization. The count covers core operations without unnecessary bloat.
The set covers local notebook management (CRUD cells, create notebook) and Drive sync (push, pull, copy, list). Minor gaps like missing delete_drive_notebook are acceptable given the focus on sync workflows.
Maintenance
Related MCP Connectors
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
An MCP server for deep research or task groups
An MCP server that used to create notes
A MCP server built for developers enabling Git based project management with project and personal…
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that bridges local AI agents to Google Colab notebooks, enabling execution of Python code and interaction with notebook states directly from the agent.1Apache 2.0
- AlicenseBqualityDmaintenanceLocal-first MCP server for controlling Google Colab as a development, shell, file, and training runtime, with tools for notebook editing, GPU acceleration, and file transfer.599Apache 2.0
- FlicenseNot gradedqualityCmaintenanceA local MCP server for reading, writing, and executing Jupyter notebooks using jupyter_client for direct kernel communication.-
- Apache 2.0