Execute Python code on Google Colab GPU runtimes (T4/L4) from any MCP client
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"io-github-pdwi2020-mcp-server-colab-exec": {
"command": "<see-readme>",
"args": []
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
MCP server that allocates Google Colab GPU runtimes (T4/L4) and executes Python code on them. Lets any MCP-compatible AI assistant — Claude Code, Claude Desktop, Gemini CLI, Cline, and others — run GPU-accelerated code (CUDA, PyTorch, TensorFlow) without local GPU hardware.
No automated test available for this server. Check the GitHub README for setup instructions.
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
No package registry to scan.
Click any tool to inspect its schema.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in cloud
MCP Server for GCP environment for interacting with various Observability APIs.
Yunxiao MCP Server provides AI assistants with the ability to interact with the Yunxiao platform. It provides a set of tools that interact with Yunxiao's API, allowing AI assistants to manage Codeup repository, Project, Pipeline, Packages etc.
MCP server for Datto SaaS Protection — M365/GWS backups, restores, seats.
IAM Policy Autopilot is an open source static code analysis tool that helps you quickly create baseline AWS IAM policies that you can refine as your application evolves. This tool is available as a command-line utility and MCP server for use within AI coding assistants for quickly building IAM policies.
MCP Security Weekly
Get CVE alerts and security updates for io.github.pdwi2020/mcp-server-colab-exec and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
MCP server that allocates Google Colab GPU runtimes (T4/L4) and executes Python code on them. Lets any MCP-compatible AI assistant — Claude Code, Claude Desktop, Gemini CLI, Cline, and others — run GPU-accelerated code (CUDA, PyTorch, TensorFlow) without local GPU hardware.
~/.config/colab-exec/token.json for subsequent runs.pip install mcp-server-colab-exec
Or run directly with uvx:
uvx mcp-server-colab-exec
Add to your project's .mcp.json or ~/.claude/.mcp.json:
{
"mcpServers": {
"colab-exec": {
"command": "mcp-server-colab-exec"
}
}
}
Or via the CLI:
claude mcp add colab-exec mcp-server-colab-exec
Add to claude_desktop_config.json:
{
"mcpServers": {
"colab-exec": {
"command": "mcp-server-colab-exec"
}
}
}
gemini mcp add colab-exec -- mcp-server-colab-exec
colab_executeExecute inline Python code on a Colab GPU runtime.
| Parameter | Type | Default | Description |
|---|---|---|---|
code | string | — | Python code to execute (required) |
accelerator | string | "T4" | GPU type: "T4" (free) or "L4" (premium) |
timeout | int | 300 | Max execution time in seconds |
Returns JSON with per-cell output, errors, and stderr.
colab_execute_fileExecute a local .py file on a Colab GPU runtime.
| Parameter | Type | Default | Description |
|---|---|---|---|
file_path | string | — | Path to a local .py file (required) |
accelerator | string | "T4" | GPU type: "T4" (free) or "L4" (premium) |
timeout | int | 300 | Max execution time in seconds |
Security policy: file_path must be a .py file inside the current workspace (cwd).
colab_execute_notebookExecute code and collect all generated artifacts (images, CSVs, models, etc.).
| Parameter | Type | Default | Description |
|---|---|---|---|
code | string | — | Python code to execute (required) |
output_dir | string | — | Local directory for downloaded artifacts (required) |
accelerator | string | "T4" | GPU type: "T4" (free) or "L4" (premium) |
timeout | int | 300 | Max execution time in seconds |
Artifacts are downloaded as a zip and extracted into output_dir.
Zip members are validated before extraction to prevent path traversal and special-file writes.
Check GPU availability:
colab_execute(code="import torch; print(torch.cuda.is_available()); print(torch.cuda.get_device_name(0))")
Run nvidia-smi:
colab_execute(code="import subprocess; print(subprocess.run(['nvidia-smi'], capture_output=True, text=True).stdout)")
Train a model and download weights:
colab_execute_notebook(
code="import torch; model = torch.nn.Linear(10, 1); torch.save(model.state_dict(), '/tmp/model.pt')",
output_dir="./outputs"
)
On first use, the server opens a browser window for Google OAuth2 consent. The access token and refresh token are cached at ~/.config/colab-exec/token.json. Subsequent runs use the cached token and refresh it automatically.
The OAuth2 client credentials are the same ones used by the official Google Colab VS Code