Skip to main content

Colab Drive MCP

CI Release PyPI License: MIT

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 .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.

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_notebook
  • add_local_cell, update_local_cell, delete_local_cell
  • search_local_cells, clear_local_outputs

Google Drive

  • list_drive_notebooks, pull_drive_notebook, push_local_notebook
  • get_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-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:

  1. Create a Google Cloud project.
  2. Enable the Google Drive API.
  3. Configure the OAuth consent screen and add your account as a test user.
  4. Create an OAuth Client ID with application type Desktop app.
  5. Download the JSON to ~/.config/colab-mcp/credentials.json.
  6. Call authorize_google_drive and complete the Google sign-in flow.

The resulting token is stored at ~/.config/colab-mcp/token.json.

Override these locations with:

  • COLAB_MCP_GOOGLE_CREDENTIALS
  • COLAB_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_drive call.
  • Use file access 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

Metadata

Release files for colab-drive-mcp 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for colab-drive-mcp 0.1.3
File Size Uploaded Provenance
colab_drive_mcp-0.1.3.tar.gz 15.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for colab-drive-mcp 0.1.3
File Interpreter ABI Platform
colab_drive_mcp-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 28.2 kB

Release files / colab_drive_mcp-0.1.3.tar.gz

Download URL colab_drive_mcp-0.1.3.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5109528a5a5071e8d2021e1aa793f435d1304511092b9390938e3bb5d2a72878
BLAKE2b-256 checksum
How to use checksums
533ec13cb536721df38abe1f0a36e32301658c194f8bb484c4de34fe4e50954b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.

Transparency log

Release files / colab_drive_mcp-0.1.3-py3-none-any.whl

Download URL colab_drive_mcp-0.1.3-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e0648e45ed396e05e1be7042809174a0395a8276dc9fbc160629e0ebd946b64
BLAKE2b-256 checksum
How to use checksums
6d102274f8b9bd63868f0eeae903759209363b9d408d567c9a39fa4b3a57afa9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.

Transparency log

Security for colab-drive-mcp 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for colab_drive_mcp-0.1.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page