Smart Colab Mcp — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Smart Colab Mcp (Agent Skill) and scored it 96/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 1 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 1 flagged
A bulleted imperative like {match} tells the agent to never reveal, disclose, or mention something to the user. Used adversarially it can instruct the agent to hide its tool calls or lie about what it did — stripping the transparency a user relies on to trust the agent.
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
This repository contains an experimental setup that connects Claude Desktop to a Google Colab runtime using a lightweight Flask server exposed via ngrok. The goal is to enable controlled, resource-aware remote execution of Python code on Colab (CPU/GPU) while orchestrating tasks locally via Claude Desktop.
This repository reflects the system as originally built, without later hardening or refactoring.
┌────────────────┐ ┌───────────────────┐
│ Claude Desktop │ │ Google Colab │
│ (Reasoning) │ │ (Compute) │
└───────┬────────┘ └─────────┬─────────┘
│ │
JSON-RPC (Stdio) Flask Server
│ │
┌───────▼────────┐ ┌─────────▼─────────┐
│ Local MCP Agent│◄────────►│ ngrok Tunnel │
│ (State/Config) │ HTTP │ (Public URL) │
└────────────────┘ └───────────────────┘How it works:
Important: Claude Desktop automatically launches MCP servers. The Colab notebook must be started manually to provide the ngrok endpoint.
/content to local machinesmart-colab-mcp/
├── agent/
│ └── mcp_smart_colab_v2.py # Local MCP bridge (reads from env vars)
├── colab/
│ └── smart_colab_executor.ipynb # Colab backend (Flask + ngrok)
├── config/
│ └── claude_desktop_config.example.json
├── requirements.txt
└── README.mdcolab/smart_colab_executor.ipynb in Google Colab !ngrok authtoken YOUR_TOKEN_HEREGet a free token at ngrok.com/dashboard
https://xxxx-xx-xx.ngrok-free.app)git clone https://github.com/G-karthick0501/Smart-colab-MCP.git
cd Smart-colab-MCP
pip install -r requirements.txtRequired packages:
mcp - Model Context Protocolrequests - HTTP clientflask - Web framework (Colab-side)pyngrok - ngrok Python wrapper (Colab-side)Location: %APPDATA%\Claude\claude_desktop_config.json (Windows)
Example configuration:
{
"mcpServers": {
"smart-colab": {
"command": "C:\\Path\\To\\Python.exe",
"args": ["C:\\Path\\To\\agent\\mcp_smart_colab_v2.py"],
"env": {
"COLAB_URL": "https://your-ngrok-url.ngrok-free.app",
"LOCAL_SAVE_DIR": "C:\\Path\\To\\results",
"CHECKPOINT_DIR": "C:\\Path\\To\\checkpoints"
}
}
}
}Important:
\\) in Windows pathsCOLAB_URL with your actual ngrok URL from Phase 1LOCAL_SAVE_DIR and CHECKPOINT_DIR folders beforehand| Tool | Description | Timeout |
|---|---|---|
check_colab_connection | Verify ngrok tunnel is active | 10s |
probe_colab_environment | Get GPU/RAM/packages info | 30s |
run_code_quick | Execute short Python snippets | 2 min |
run_code_long | Execute heavy tasks (training/downloads) | 10 min |
run_chunked_operation | Process loops in batches with resume support | 5 min/batch |
list_colab_files | List files in Colab /content directory | 30s |
download_from_colab | Download file to LOCAL_SAVE_DIR | 5 min |
cleanup_colab | Free RAM/GPU memory | 30s |
list_colab_variables | Show runtime variables and shapes | 15s |
get_checkpoint | Retrieve saved checkpoint data | Instant |
Windows:
tasklist /fi "imagename eq python.exe"Expected output:
Image Name PID Session Mem Usage
Claude.exe 1234 Console 450,000 K
python.exe 5678 Console 80,000 K ← Memory MCP (if configured)
python.exe 9012 Console 60,000 K ← Colab MCPcurl https://your-ngrok-url/healthExpected response:
{
"status": "ok",
"uptime_minutes": 15,
"memory_available_gb": 10.5,
"memory_used_pct": 15.2
}| Problem | Cause | Solution |
|---|---|---|
Connection refused | Colab notebook not running | Re-run notebook cells |
COLAB_URL not set | Missing env variable | Check Claude Desktop config |
| ngrok URL changed | Notebook restarted | Update config with new URL |
404 Not Found | Wrong endpoint path | Verify URL includes /health |
| Timeout on execution | Code takes >10 min | Use run_chunked_operation |
| Memory errors | Colab RAM full | Call cleanup_colab() |
| Files not found | Wrong Colab path | Check /content/ directory |
/execute endpoint runs any Python code without validationFor Users:
Not Implemented (Future Work):
threading.Lock)These are intentionally documented and tracked for future work:
host="0.0.0.0" for reliabilityPlanned improvements (tracked as GitHub Issues):
Security & Auth:
os.system, subprocess, etc.)Reliability:
threading.Lock)/shutdown endpoint for clean server terminationFeatures:
┌─────────────────┐
│ Claude Desktop │ Reads config.json
│ │ Spawns MCP servers as subprocesses
└────────┬────────┘
│
│ JSON-RPC via stdin/stdout
│
┌────────▼────────┐
│ MCP Server │ Python process on your PC
│ (mcp_smart_ │ Reads COLAB_URL from environment
│ colab_v2.py) │
└────────┬────────┘
│
│ HTTP POST/GET
│
┌────────▼────────┐
│ ngrok Tunnel │ Public HTTPS → Colab VM
└────────┬────────┘
│
┌────────▼────────┐
│ Flask Server │ Running in Colab notebook
│ (Colab Runtime) │ Executes Python via exec()
└─────────────────┘Example JSON-RPC message:
// Request from Claude
{
"jsonrpc": "2.0",
"method": "run_code_quick",
"params": {"code": "print(2 + 2)"},
"id": 1
}
// Response from MCP
{
"jsonrpc": "2.0",
"result": {
"success": true,
"stdout": "4\n",
"execution_time_sec": 0.12
},
"id": 1
}Key Points:
# Python
venv/
__pycache__/
*.pyc
*.pyo
# Local storage
results/
checkpoints/
memory_db/
memory_backups/
# IDE
.vscode/
.idea/
*.swp
*.swo
# Secrets
*.token
.envCurrent Status:
Why This Exists: This project was built to explore:
What Makes This Different:
Contributions welcome via Issues and Pull Requests!
Before submitting:
Good First Issues:
This code executes arbitrary Python remotely. It is not safe for multi-user or public deployment. Use only in trusted environments with trusted code.
The user is responsible for:
The authors provide:
Use at your own risk. Not recommended for production use.
MIT License - free to use with attribution
Maintained by: G-karthick0501 Repository: github.com/G-karthick0501/Smart-colab-MCP Last Updated: January 2026
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.