MCP server for synchronizing Colab notebook files through Google Drive; does not execute notebooks
Project description
Colab Drive MCP
An MCP server for safely inspecting, editing, and synchronizing
Google Colab-compatible .ipynb notebooks through Google Drive.
[!IMPORTANT] This is a notebook file synchronization server, not a notebook execution service. It transfers and edits
.ipynbfiles 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.
- 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.
Non-goals
- Starting, controlling, or monitoring a Google Colab runtime.
- 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_notebookcopy_drive_notebook,get_colab_url
pull_drive_notebook and push_local_notebook synchronize notebook files.
They never execute notebook code. get_colab_url returns a URL but does not
open a browser.
Install
Run directly from PyPI with uvx:
COLAB_MCP_ROOT="$HOME/notebooks" uvx --from 'colab-drive-mcp[drive]' colab-drive-mcp
Or 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-mcp
Local 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-mcp
Google 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=file
This 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=full
Changing 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-mcp
VS 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/pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file colab_drive_mcp-0.1.2.tar.gz.
File metadata
- Download URL: colab_drive_mcp-0.1.2.tar.gz
- Upload date:
- Size: 13.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bfe2fb9926a372cf3af2c386ce91d63aeb211916ad626200194995c0e6abb32
|
|
| MD5 |
4d6416293cfa302987f268fb3752ce4d
|
|
| BLAKE2b-256 |
dc6c0afcf1fac905be13bf33b04b928be16a9c670f0332e550c63a7cfdcbe0ee
|
Provenance
The following attestation bundles were made for colab_drive_mcp-0.1.2.tar.gz:
Publisher:
publish-pypi.yml on YummyTastyCode/colab-drive-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
colab_drive_mcp-0.1.2.tar.gz -
Subject digest:
9bfe2fb9926a372cf3af2c386ce91d63aeb211916ad626200194995c0e6abb32 - Sigstore transparency entry: 1755783234
- Sigstore integration time:
-
Permalink:
YummyTastyCode/colab-drive-mcp@cca7582ac79d8520e4eb03ed6111b9a74a822add -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/YummyTastyCode
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@cca7582ac79d8520e4eb03ed6111b9a74a822add -
Trigger Event:
release
-
Statement type:
File details
Details for the file colab_drive_mcp-0.1.2-py3-none-any.whl.
File metadata
- Download URL: colab_drive_mcp-0.1.2-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1e9e44040c8d711264c84ef6c304c91de33112ad6a51ec7563e0bda5ba7af23
|
|
| MD5 |
934990e18fc67c11191cbba26c1b60a1
|
|
| BLAKE2b-256 |
dea5810052a8fae32939c4bf8818cd0fa579c81be0efec227e9249ff8b3b61e9
|
Provenance
The following attestation bundles were made for colab_drive_mcp-0.1.2-py3-none-any.whl:
Publisher:
publish-pypi.yml on YummyTastyCode/colab-drive-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
colab_drive_mcp-0.1.2-py3-none-any.whl -
Subject digest:
c1e9e44040c8d711264c84ef6c304c91de33112ad6a51ec7563e0bda5ba7af23 - Sigstore transparency entry: 1755783243
- Sigstore integration time:
-
Permalink:
YummyTastyCode/colab-drive-mcp@cca7582ac79d8520e4eb03ed6111b9a74a822add -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/YummyTastyCode
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@cca7582ac79d8520e4eb03ed6111b9a74a822add -
Trigger Event:
release
-
Statement type: