How to design a production-ready AI agent that automates Google Colab workflows using Colab-MCP, MCP Tools, FastMCP, and Kernel Execution
import asyncio import json import io import contextlib import re from dataclasses import dataclass from typing import Callable, Awaitable import nest_asyncio nest_asyncio.apply() TOOL_DEFINITIONS = [ { “name”: “execute_code”, “description”: “Execute Python code in the Colab kernel. Returns stdout, results, or errors. State persists between calls.” “parameters”: { “type”: “object”, “properties”: { “code”: {“type”: “string”, “description”: … Read more