Colab-MCP (unofficial) — Claude Code MCP server: setup guide
Colab-MCP (unofficial) is an MCP server for Claude Code that automates Google Colab runtimes. It delegates code execution to cloud GPU or TPU hardware directly from chat prompts.
Apache-2.0 ★ 5 updated 2026-10-16
claude mcp add --env COLAB_MCP_WORKDIR=<COLAB_MCP_WORKDIR> --env COLAB_MCP_DRIVE=<COLAB_MCP_DRIVE> --transport stdio colab-mcp-unofficial -- uvx colab-cli-mcpWhat Colab-MCP (unofficial) does
The server exposes Colab features to LLMs by wrapping Google's official google-colab-cli package. An agent can spin up or terminate instances, execute single commands, follow long-running background training jobs, and inspect or run .ipynb notebooks step by step.
Local paths stay confined to COLAB_MCP_WORKDIR, while environment variables pass directly to the remote kernel without showing raw values to the model. File syncing handles directory uploads and downloads while skipping .git folders and sensitive keys. Google Drive can be mounted inside the instance using an interactive confirmation step in the browser.
Setup requires macOS or Linux, the uv tool runner, and google-colab-cli. The user must sign in once via colab sessions before registering the server. All code runs under the user's personal Google credentials and consumes their Colab compute units.
What it helps with
- allocate a remote GPU runtime and verify its readiness
- execute local Jupyter notebook cells sequentially while keeping variables
- run background training tasks and tail remote output logs
- mount Google Drive inside a Colab session for dataset access
Example prompts for the agent
- Start a new Colab runtime with a T4 GPU and report its status
- Upload the source directory to Colab and launch
python -u train.pyas a job - Read
train.ipynb, add an evaluation cell, and run the whole notebook
How to install Colab-MCP (unofficial)
Platform CLI
claude mcp add --env COLAB_MCP_WORKDIR=<COLAB_MCP_WORKDIR> --env COLAB_MCP_DRIVE=<COLAB_MCP_DRIVE> --transport stdio colab-mcp-unofficial -- uvx colab-cli-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from colab-cli-mcp <command>
Platform CLI
codex mcp add colab-mcp-unofficial --env COLAB_MCP_WORKDIR=<COLAB_MCP_WORKDIR> --env COLAB_MCP_DRIVE=<COLAB_MCP_DRIVE> -- uvx colab-cli-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from colab-cli-mcp <command>
Config file
{
"mcpServers": {
"colab-mcp-unofficial": {
"command": "uvx",
"args": [
"colab-cli-mcp"
],
"env": {
"COLAB_MCP_WORKDIR": "<COLAB_MCP_WORKDIR>",
"COLAB_MCP_DRIVE": "<COLAB_MCP_DRIVE>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from colab-cli-mcp <command>
Config file
{
"servers": {
"colab-mcp-unofficial": {
"type": "stdio",
"command": "uvx",
"args": [
"colab-cli-mcp"
],
"env": {
"COLAB_MCP_WORKDIR": "<COLAB_MCP_WORKDIR>",
"COLAB_MCP_DRIVE": "<COLAB_MCP_DRIVE>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from colab-cli-mcp <command>
Platform CLI
gemini mcp add -e COLAB_MCP_WORKDIR=<COLAB_MCP_WORKDIR> -e COLAB_MCP_DRIVE=<COLAB_MCP_DRIVE> colab-mcp-unofficial uvx colab-cli-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from colab-cli-mcp <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Colab-MCP (unofficial)
How to install Colab-MCP (unofficial) in Claude Code?
Run claude mcp add colab-mcp -- uvx colab-cli-mcp in your terminal.
What does Colab-MCP (unofficial) do?
It gives AI assistants 42 tools to provision Colab runtimes, edit and execute notebooks, monitor background workloads, and transfer files.
What is required to run Colab-MCP (unofficial)?
You need a Linux or macOS machine, Astral uv, the official google-colab-cli, and an initial login via colab sessions.