
Colab Drive MCP
io.github.YummyTastyCode由 GitHub 帳號 YummyTastyCode 發布v0.1.3更新於 Oct 24, 2026
Synchronize Colab notebook files through Google Drive without executing notebook code.
概覽
將 Google Colab 相容的 .ipynb 筆記本檔案與 Google Drive 同步,讓助理在不執行程式碼的情況下檢查與編輯儲存格。
- 可以做什麼
- 提供本機筆記本工具,用來列出、讀取、建立與編輯 .ipynb 檔案及其儲存格;並提供 Drive 工具,用來列出、拉取、推送、複製與比較筆記本。它會比較本機內容與 Drive 的 MD5 檢查碼來回報同步狀態,並可傳回 Colab 連結。下載時也會正規化 Colab 特有的串流輸出中介資料。它從不執行筆記本程式碼,也不連線 Colab 執行環境。
- 適用情境
- 適用於助理需要在本機準備筆記本、在 Google Drive 之間移動、檢查已完成的輸出,或把編輯後的筆記本交還給使用者的情境。它不用於執行儲存格、讓 Colab 工作階段保持運作,或自動化 Colab 瀏覽器介面;請在 Colab、Jupyter 或 VS Code 中另外執行筆記本。
- 執行需求
- 透過 uvx 從 PyPI 套件 colab-drive-mcp 執行的本機 Python 程序。需要環境變數 COLAB_MCP_ROOT,即限定筆記本存取範圍的本機絕對目錄。Google Drive 需要啟用 Drive API 的 Google Cloud 專案、OAuth 桌面用戶端 JSON 與權杖;路徑可用 COLAB_MCP_GOOGLE_CREDENTIALS 與 COLAB_MCP_GOOGLE_TOKEN 設定。COLAB_MCP_DRIVE_ACCESS 選擇 file 或 full 模式。存取 Drive 需要網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Colab Drive MCP,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
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
.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.
- 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_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:
Or install from source:
Run the server:
Local tools can access only .ipynb files below COLAB_MCP_ROOT.
The server is published in the official MCP Registry as:
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:
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:
Changing access modes may require deleting token.json and calling
authorize_google_drive again.
Codex Configuration
VS Code Configuration
Add this server to the VS Code MCP configuration:
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
來源:README.md,提交 765e1b0
工具
0版本歷史
1- v0.1.3最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分