Google Opens Colab's GPU and TPU Power to AI Agents Without a Browser
Google Colab now exposes a REST API and a hosted MCP endpoint, letting agents provision GPU and TPU runtimes and run Python headlessly.
Takeaways
- Google launched a Colab REST API and hosted MCP endpoint at colaboratory.googleapis.com/mcp for agent control.
- Agents can provision, inspect, and delete CPU, GPU, and TPU runtimes programmatically via CreateRuntime, GetRuntime, ListRuntimes, DeleteRuntime.
- The MCP server adds execute_code and create_session tools for stateful Python execution on Colab compute.
- Accelerator tiers like H100 and TPU v6e are gated by Colab Pro and Pro+ subscriptions.
- Setup requires enabling the Colab API, OAuth 2.0 credentials, and pointing an MCP-compatible agent at the endpoint.
- Works with Claude Code, Gemini CLI, Cursor, and other MCP clients without keeping a notebook tab open.
Google has released a public REST API and a hosted Model Context Protocol endpoint for Colab, according to the company’s announcement. Together, the interfaces let applications provision runtimes, discover eligible hardware, execute Python and release resources programmatically.
Agents running through Claude Code, Gemini CLI or a custom MCP client can now request a Colab accelerator, run a workload and delete the runtime without keeping a notebook open in a browser. The APIs turn Colab’s managed CPU, GPU and TPU capacity into a callable service for development tools and automated workflows.
Colab sheds the open tab
Colab has traditionally paired its managed runtime with a browser-based notebook. Google previously released an open-source MCP server that ran locally and controlled a notebook open in the browser. The hosted server at https://colaboratory.googleapis.com/mcp accepts requests directly, removing that browser dependency from automated workflows.
The two new interfaces address different integration patterns:
| Interface | Capabilities | Typical use |
|---|---|---|
| REST API | Runtime lifecycle, hardware discovery, subscription details and Jupyter connection information | Applications that need direct control over Colab resources |
| Hosted MCP | REST operations exposed as tools, plus sessions and Python execution | AI agents and development tools that already support MCP |
The controls behind each call
The REST API exposes the core operations required to manage a runtime:
- Lifecycle:
CreateRuntime,GetRuntime,ListRuntimesandDeleteRuntime - Hardware discovery:
ListRuntimeSpecsreturns eligible CPU, GPU and TPU configurations - Subscription lookup:
GetSubscriptionreports the account’s Colab tier - Editor connectivity: connection details allow Jupyter-compatible clients, including the official VS Code Colab extension, to attach to a runtime
Hardware eligibility still follows the user’s Colab subscription. Depending on the tier and current availability, the returned specifications can include accelerators such as an H100 GPU or TPU v6e.
The hosted MCP server exposes the REST operations as agent tools, with simplified inputs for some calls. It also adds execute_code for running Python and create_session for preserving interpreter state across related calls. That combination lets an agent create a runtime, establish a session, execute several dependent steps and clean up through one protocol.
Wire up an agent
A working integration requires a Google Cloud project, OAuth credentials and an MCP-capable client. The setup sequence is:
- Enable the Colab API in the relevant Google Cloud project.
- Create OAuth 2.0 client credentials and request the
https://www.googleapis.com/auth/colaboratoryscope. - Associate requests with a quota project.
- Inspect REST methods through the APIs Explorer or API reference.
- Register
https://colaboratory.googleapis.com/mcpin the agent or development tool. - Call
tools/listwithout a token to confirm that the MCP endpoint is reachable, then authenticate calls that access account resources.
A community Claude Code walkthrough demonstrates the full flow: obtaining a scoped token, setting a quota project, registering the endpoint with an authorization-header helper, creating a TPU v5e-1 runtime, executing a notebook and deleting the runtime. A securely stored OAuth refresh token can reconnect later processes after the initial consent flow, which helps on Linux systems without a persistent browser session.
Where headless Colab fits
Programmatic lifecycle and execution support Colab workloads that previously required browser coordination. Practical uses include:
- Agent offloading: coding agents can send training, fine-tuning or inference jobs to an eligible accelerator.
- Notebook automation: a workflow can create a runtime, execute a parameterized notebook, save its outputs and release the runtime.
- Remote development: local editors can use a kernel hosted on Colab hardware.
- Shared agent infrastructure: multiple agents can dispatch compute tasks through a common MCP tool.
The hosted endpoint also reduces integration work for MCP-based systems. Tool discovery, structured arguments and session handling follow the same protocol those systems use for other external capabilities.
Limits that shape the design
- Access depends on tier and supply. Free accounts cannot request accelerators reserved for paid plans, and an eligible accelerator may still be unavailable.
- Existing Colab quotas still apply. Automated jobs consume the same account resources and compute allocation as interactive sessions.
- Cleanup needs explicit handling. Clients should delete runtimes after success or failure, preferably through a guaranteed cleanup path.
- Executed code carries risk. Agents can run arbitrary Python inside the runtime, so credentials should use minimal scopes and generated code should be treated as untrusted input.
- The endpoint controls Colab resources only. Workflows that need broader Google Cloud infrastructure require the corresponding Google Cloud APIs.
- The Colab CLI remains available. Existing CLI-based agent workflows can continue unchanged; MCP mainly benefits clients already organized around tool servers.
For teams building MCP-based agents, Colab now requires endpoint configuration, authentication and lifecycle handling instead of a browser automation layer or a custom runtime bridge. Accelerated Colab compute can participate in an agent workflow as a standard tool call, subject to the account’s usual availability and quota constraints.