
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 分