Code execution sandboxes APIs and MCP servers for AI agents
Isolated cloud environments where an agent can run code, shells and whole dev environments safely.
10 code execution sandboxes APIs an AI agent can call: auth method and header, official MCP server (6), free tier (5), docs links. Machine-readable JSON included. Agents: fetch catalog/code-execution-sandbox.json instead of parsing this page. Last checked 2026-09-24.
Ratings and usage (★) fetched: .
| Service | What an agent can do | Auth | MCP server | Free tier | Details (with sources) | Notes | Proof (ratings, usage) |
|---|---|---|---|---|---|---|---|
| Cloudflare Sandbox SDK | Deploy a Cloudflare Worker embedding this SDK to run untrusted code in per-request container sandboxes. | API keyCloudflare API token to deploy the Worker; the sandbox itself is reached through your own deployed Worker route | official | requires Workers Paid plan ($5/mo) for Containers; no free tier for container-backed sandboxes | Base URL: https://api.cloudflare.com/client/v4 Free plan: none ↗ Rate limits: Worker subrequests per request: 50 on Free, 1,000 on Paid (HTTP transport); RPC transport avoids extra subrequests ↗ MCP tools: 7: container_initialize, container_ping, container_file_write, container_files_list, container_file_read, container_file_delete … ↗ | Not a hosted API called directly with a key - you deploy your own Worker using the SDK on Cloudflare Containers/Durable Objects. The official Container MCP is a generic sandbox, not a Sandbox SDK wrapper. | — |
| CodeSandbox SDK | Programmatically create, resume, and control cloud VM sandboxes to run and preview AI-written code. | API keyCSB_API_KEY env var, passed to the CodeSandbox() SDK constructor | — | Free plan: 400 VM credits/mo (~40 Nano-VM hrs), up to 10 concurrent VMs | Base URL: https://api.codesandbox.io | Also powers Together AI's white-labeled 'Code Sandbox' product; unofficial community MCP wrappers exist but none vendor-maintained. | — |
| Daytona | Create elastic remote sandboxes via SDK/API to run AI-generated code with sub-second startup. | API keyAuthorization: Bearer <DAYTONA_API_KEY> | official | Trial: $200 free compute credit one-time on signup, no credit card required; first 5 GiB storage free; startup program up to $50k credits | Base URL: https://app.daytona.io/api Free plan: $200 free compute; first 5 GiB storage free, one-time, no card ↗ Rate limits: Tier 1: 10,000 general requests/min, 300 sandbox creations/min, 10,000 lifecycle ops/min; higher tiers up to 50,000/600/50,000 ↗ Example call: create a sandbox: POST https://app.daytona.io/api/sandbox ↗ Unit price: billed per second: $0.0504 per vCPU-hour, $0.0162 per GiB RAM-hour, $0.000108 per GiB disk-hour (first 5 GiB free) ↗ | Billed per second; supports sandbox snapshots and preview URLs for web apps. Official MCP server runs locally via the Daytona CLI (daytona mcp start); no hosted endpoint. | — |
| E2B | Spin up isolated Firecracker cloud sandboxes via SDK/REST to execute AI-generated code and return results. | API keyE2B_API_KEY env var / X-API-Key: <key> header (Bearer works only together with an X-Team-ID header) | official | Trial: one-time $100 usage credit on signup (Hobby, no card); up to 1 h per sandbox, 20 concurrent; then pay-as-you-go | Base URL: https://api.e2b.app Free plan: One-time $100 in usage credits; up to 1 hour per sandbox session, 20 concurrent sandboxes, one-time, no card ↗ Rate limits: Hobby: 1 sandbox creation/sec, 20 concurrent sandboxes, max 1 hour continuous runtime ↗ Example call: create a sandbox: POST https://api.e2b.app/v2/sandboxes ↗ Unit price: Per running second: $0.000014 per vCPU + $0.0000045 per GiB RAM (default 2 vCPU = $0.000028/s CPU) ↗ | Sandboxes auto-expire after a configurable timeout (default ~5 min); used by many agent frameworks (OpenHands, etc.). The e2b-dev/mcp-server repo was archived and deprecated on 2026-04-16. | GitHub 394★ e2b-dev/mcp-server |
| Judge0 | Submit source code and stdin via REST to compile/run it in 60+ languages and poll for the result. | API keyX-Auth-Token header (self-hosted, if enabled) or X-RapidAPI-Key (RapidAPI-hosted); can run with none if self-hosted unauthenticated | — | Paid only on Judge0 Cloud (Pro EUR 27/mo for 2,000 submissions/day and up); self-host free & open-source (GPLv3) | Base URL: https://ce.judge0.com Rate limits: Cloud plans: Pro 2,000, Ultra 5,000, Mega 10,000 submissions/day; extra submissions EUR 0.001 each ↗ Async jobs: POST /submissions returns a token; poll GET /submissions/{token} (wait=true for sync where enabled) ↗ | Built for compile-run-compare judging (like competitive programming), not long-lived interactive agent sandboxes; self-hosting recommended for production agent use. | — |
| Modal | Programmatically launch serverless sandboxes, optionally with GPUs, to execute untrusted or agent code. | API keyMODAL_TOKEN_ID + MODAL_TOKEN_SECRET (generated via `modal token new`) | community | Starter plan: $0 base + $30/mo free credits | Free plan: $30/month free compute on Starter ($0 base) ↗ Rate limits: Starter: 100 containers + 10 GPU concurrency ↗ Unit price: Sandboxes: CPU $0.00003942 per core-second, memory $0.00000667 per GiB-second; GPUs e.g. T4 $0.000164/s, H100 $0.001097/s ↗ MCP tools: 11: launch_sandbox, terminate_sandbox, list_sandboxes, execute_command, push_file_to_sandbox, pull_file_from_sandbox … ↗ | Sandbox compute billed separately from regular function compute (~$0.14/vCPU-hr); Python SDK is most mature/complete. | GitHub 1★ milkymap/mcp4modal_sandbox |
| Piston | Call a free public REST API to compile and run code in 70+ languages inside isolated containers. | API keyauthorization token for the public emkc.org instance, granted by EngineerMan (Discord) only for non-commercial educational projects; none when self-hosted | — | Free: self-host (open source); public emkc.org API no longer open since 2026-02-15, token only for non-commercial educational projects | Base URL: https://emkc.org/api/v2/piston | Public emkc.org instance closed to open use on 2026-02-15; self-host via Docker for agent workloads. Widely used by Discord/Slack bots. | GitHub 2,823★ engineer-man/piston |
| Riza | Call a REST API to execute untrusted Python/JS/Ruby/PHP code in sandboxes that start in under 10ms. | API keyAuthorization: Bearer <RIZA_API_KEY> | official | Free tier: Hobby plan free forever, 100,000 requests/month, 30 s execution limit; then usage-based pricing | Base URL: https://api.riza.io Free plan: 100,000 requests/month (Hobby, free forever), 30 s execution limit, no card ↗ Rate limits: Hobby: 100,000 requests/month, 30 s max execution, 128 MB memory per invocation ↗ Example call: execute untrusted Python code in a sandbox: POST https://api.riza.io/v1/execute ↗ MCP tools: 6: create_tool, fetch_tool, execute_tool, edit_tool, list_tools, execute_code ↗ | Also supports saving reusable 'tools' (functions) via a Tools API for repeated agent calls. | — |
| Runloop | Create, snapshot, suspend/resume, and run commands in Linux Devboxes via API/SDK for agent coding tasks. | API keyAuthorization: Bearer <RUNLOOP_API_KEY> (auto-loaded from RUNLOOP_API_KEY env var) | official | $50 free credits on signup, then usage-based ($0.108/CPU-hr, $0.0252/GB-hr) | Base URL: https://api.runloop.ai Free plan: $50 in credits; trial limits 3 running devboxes, 5 blueprints, 10 snapshots, one-time, no card ↗ Example call: create a devbox: POST https://api.runloop.ai/v1/devboxes ↗ Unit price: Devbox: $0.108 per CPU-hour + $0.0252 per GB-hour memory; blueprint build $0.252/hour ↗ | Official local MCP server @runloop/api-client-mcp (npx, RUNLOOP_API_KEY) exposes the Runloop API; the 'MCP Hub' feature lets Devboxes connect outward to other MCP servers. | — |
| Vercel Sandbox | Boot ephemeral Firecracker microVMs via SDK/REST to run agent- or AI-generated code and shell commands. | API key / OAuthVERCEL_OIDC_TOKEN (recommended, auto on Vercel) or VERCEL_TOKEN Bearer + team/project IDs | official | usage included on Hobby plan, otherwise usage-based on Pro/Enterprise | Base URL: https://api.vercel.com Free plan: Hobby: 5 h Active CPU, 420 GB-h memory, 5,000 creations, 20 GB data transfer; paused when exceeded, per month ↗ Rate limits: Hobby: 10 concurrent sandboxes, 45 min max session, 20-40 vCPUs/min allocation, 1,000 control-plane req/min; Pro: 10,000 concurrent, 24 h ↗ Example call: create a sandbox microVM: POST https://api.vercel.com/v4/sandboxes?teamId={teamId} ↗ Unit price: Pro: $0.60 per 1M sandbox creations + $0.128 per active CPU hour + $0.0212 per GB-hour of memory (iad1); Hobby includes 5,000 creations and 5 CPU hours/month ↗ | Pricing = active CPU + provisioned memory + per Sandbox.create() call + data transfer; 64 GB ephemeral NVMe per sandbox (SDK 3.0.0+ and custom images). | — |
Other categories
- Web search
- Web scraping and browser automation
- Knowledge and research data
- Image generation and editing
- Video generation and editing
- Speech and audio
- Music generation
- 3D generation and assets
- Architecture, CAD and BIM
- Diagrams and software architecture
- Design and UI
- Documents, OCR and presentations
- Translation and language
- Developer platforms and DevOps
- Cloud and hosting
- Databases
- Vector search, memory and RAG
- Email, team chat and notifications
- SMS and messaging apps
- Voice agents and telephony
- Productivity and workspace
- CRM, support and marketing
- Social media
- Maps, geolocation and weather
- Finance, payments and market data
- E-commerce
- Automation and integration platforms
- Model APIs and inference