Connector guide6-minute read13 MCP tools7 languages

E2B to MCP: Manage Cloud Sandboxes, Logs, Metrics, Templates and Snapshots in any AI Agent

Manage the E2B cloud sandboxes of your team with your AI: list, start, inspect, pause, resume and extend sandboxes, read their logs and CPU, memory and disk metrics, and browse the team's templates, builds and snapshots.

HCBy HelpCode teamUpdated 6 min read Open-source on GitHub

No credit card · 7-day trial · Self-host alternative available

E2B

E2B

Manage E2B cloud sandboxes for AI agents: list, start, inspect, pause, resume and extend sandboxes, read their logs and CPU, memory and disk metrics, and browse the team's templates, builds and snapshots.

tools

13

Region

INTL

Category

Infrastructure

Authentication

API Key

Required env vars

E2B_API_KEY
Install in one click on Cloud

7-day free trial · No credit card

  • 7-day free trial
    No credit card required
  • GDPR & SOC 2 ready
    EU data residency, audit logs
  • Open-source on GitHub
    Open source · AGPL-3.0
  • Works with ChatGPT, Claude, Gemini
    Any MCP-compatible client

Skip the install. Get this working in under 2 minutes.

Start a free trial on cloud.anythingmcp.com, add the E2B in one click, then point your AI client (Claude, ChatGPT, Copilot or Cursor) at the generated MCP endpoint. No Docker, no git clone, zero engineering experience required.

Start free trial

Summary

Manage the E2B cloud sandboxes of your team with your AI: list, start, inspect, pause, resume and extend sandboxes, read their logs and CPU, memory and disk metrics, and browse the team's templates, builds and snapshots.

Try asking

Example prompts for E2B

Click any prompt to copy it. Paste into Claude, ChatGPT, Cursor, Gemini, Copilot or OpenClaw to run it against this connector.

E2B · live via MCP
Share
Opus 4.7

Claude is AI and can make mistakes. Please double-check responses.

💡 No install? Use cloud.anythingmcp.com directly. Sign in, click Connectors → E2B, paste your credentials, mint an MCP API key and you're done. No Docker, no git clone, no local server.

E2B

Manage the E2B cloud sandboxes of your team with your AI: list, start, inspect, pause, resume and extend sandboxes, read their logs and CPU, memory and disk metrics, and browse the team's templates, builds and snapshots.

Setup

Setting up takes about 2 minutes. You need an E2B account; running sandboxes are billed per second to the team (the Hobby plan starts with free credits).

  1. Sign in at https://e2b.dev/dashboard and open Keys (https://e2b.dev/dashboard?tab=keys).
  2. Copy a team API key. It starts with e2b_; a personal access token (sk_e2b_...) does not work here.
  3. Paste it into E2B_API_KEY. The connector sends it in the X-API-Key header, and it acts for the whole team.
  4. Install the connector and run e2b_list_sandboxes to check it.

Which tools cost money: e2b_create_sandbox starts a sandbox and e2b_resume_sandbox resumes a paused one. A running sandbox is billed per second for its CPU and memory until it times out, is paused or is killed, and e2b_set_sandbox_timeout keeps it billed for longer when it moves the end time out. The AI asks you before starting, resuming or extending a sandbox, keeps timeout short and pauses sandboxes or lets them expire when the work is done. The read tools are free, and a paused sandbox is not billed for compute.

Templates: e2b_list_default_templates shows E2B's ready-made templates such as base, code-interpreter-v1 and desktop with CPU, memory, disk and envd version; e2b_list_templates lists the team's own templates with aliases, build status and spawn counts; e2b_list_template_builds lists the builds of one template.

Starting a sandbox: e2b_create_sandbox takes template_id (id or alias, default base), timeout in seconds (default 300) and optionally metadata (string key-value pairs to find it again), env_vars, auto_pause (pause at the timeout instead of ending) and allow_internet_access. The answer has the sandboxID and domain. The AI does not put secrets into env_vars that you have not approved.

Inspecting: e2b_list_sandboxes filters by state (running or paused), template, metadata such as user=abc&app=prod and started_after; e2b_get_sandbox shows template, resources, start and end time, state and network settings; e2b_get_sandbox_logs reads system and process logs, filtered by minimum level or a case-sensitive search text; e2b_get_sandbox_metrics shows CPU, memory and disk use over time.

Lifecycle: e2b_set_sandbox_timeout sets a new end time counted from now and replaces the old one, so a shorter value ends the sandbox sooner. e2b_pause_sandbox freezes a sandbox with its files and, by default, its memory (memory: false keeps only the file system, and resuming then reboots it); e2b_resume_sandbox resumes it or extends a running one; e2b_list_snapshots lists the saved snapshots.

Switched off at install: e2b_kill_sandbox. It cannot be undone (processes, memory and files are gone), so a workspace admin turns it on when the team needs it.

Running code is not part of this connector: commands, files and the code interpreter are served by each sandbox itself (its envd agent on https://<port>-<sandboxID>.e2b.app) with its own access token, and the team API key must not be sent into a sandbox where generated code runs. Use the E2B SDKs (e2b, @e2b/code-interpreter) for that, or a tool that wraps them. Sandbox access tokens are removed from the answers.

Data formats: times are ISO 8601, UTC; metrics start and end are Unix seconds and log cursor values Unix milliseconds. cpuCount is vCPUs, memoryMB and diskSizeMB are megabytes.

Paging: e2b_list_sandboxes, e2b_list_templates, e2b_list_template_builds and e2b_list_snapshots take limit (default 50, at most 100) and return the next page token in _headers.x-next-token, with the list itself under data; the AI passes it as next_token until it is missing. e2b_list_sandboxes also returns _headers.x-total-running. e2b_get_sandbox_logs returns up to 1,000 lines (default 100) from a cursor, forward or backward.

Limits: the team has a limit of concurrent sandboxes. timeout is capped by the plan: 1 hour on Hobby, 24 hours on Pro.

Common errors: 400 means a bad parameter (for example a timeout over the plan's maximum); 401 a wrong key, or an access token instead of a team API key; 403 the team may not use the template; 404 an unknown sandbox or template (a sandbox that timed out is gone); 409 the sandbox is already paused or being paused; 429 too many concurrent sandboxes or requests (the AI waits instead of retrying in a loop); 500 and 503 are E2B problems.

The connector does not run code, commands or file operations inside sandboxes and does not build templates.

Prerequisites: E2B_API_KEY

Install the connector locally

curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d

Open http://localhost:3000/connectors/store, pick E2B and paste in the env vars listed under Prerequisites.

Available tools

ToolWhat it does
e2b_list_sandboxesList the E2B sandboxes of the team, newest first: sandbox id, template, alias, state (running or paused), start and end time, CPU, memory…
e2b_get_sandboxRead one E2B sandbox: template and alias, state, start and end time, CPU, memory and disk, envd version, domain, internet access, network…
e2b_create_sandboxStart a new E2B sandbox from a template
e2b_set_sandbox_timeoutSet when an E2B sandbox ends: timeout seconds counted from now, replacing the previous end time (a shorter value ends it sooner)
e2b_pause_sandboxPause a running E2B sandbox, saving its files and, by default, its memory, so it can be resumed later with e2b_resume_sandbox
e2b_resume_sandboxResume a paused E2B sandbox (or extend a running one) and return its details
e2b_kill_sandboxKill an E2B sandbox immediately
e2b_get_sandbox_logsRead the logs of one E2B sandbox (system and process output) with timestamp, level and message; filter by minimum level or a search string
e2b_get_sandbox_metricsRead the resource use of one E2B sandbox over time: CPU count and usage percent, memory and disk used and total, per timestamp
e2b_list_templatesList the team's E2B templates: template id, aliases and names, build id and status, CPU, memory and disk, public flag, spawn count, last…
e2b_list_template_buildsList the builds of one E2B template with build id, status, CPU, memory, disk, envd version and dates
e2b_list_default_templatesList E2B's ready-made default templates (such as base, code-interpreter-v1 and desktop) with their aliases, CPU, memory, disk and envd…
e2b_list_snapshotsList the team's E2B sandbox snapshots with id, name, the sandbox they came from and dates; filter by sandbox or name

Example prompts

  • "Which E2B sandboxes are running right now, which template does each use, and when does each one end?"
  • "Start a code-interpreter-v1 sandbox for 10 minutes with the metadata user=demo and give me its sandbox id."
  • "Show me the error logs of sandbox ixk2b9z0."
  • "How much CPU and memory has sandbox ixk2b9z0 used since it started?"
  • "Pause every running sandbox with the metadata app=staging."

Next steps

Was this guide helpful?

Your E2B agent is one click away.

Install the connector, paste the key, prompt your AI client. Free for 7 days, no credit card.

Related guides

Connectors

How to Connect E2B to ChatGPT via MCP

Manage the E2B cloud sandboxes of your team with your AI: list, start, inspect, pause, resume and extend sandboxes, read their logs and CPU, memory and disk metrics, and browse the team's templates, builds and snapshots.

Connectors

How to Connect E2B to Claude via MCP

Manage the E2B cloud sandboxes of your team with your AI: list, start, inspect, pause, resume and extend sandboxes, read their logs and CPU, memory and disk metrics, and browse the team's templates, builds and snapshots.

Connectors

How to Connect E2B to Cursor via MCP

Manage the E2B cloud sandboxes of your team with your AI: list, start, inspect, pause, resume and extend sandboxes, read their logs and CPU, memory and disk metrics, and browse the team's templates, builds and snapshots.

Connectors

How to Connect E2B to Gemini via MCP

Manage the E2B cloud sandboxes of your team with your AI: list, start, inspect, pause, resume and extend sandboxes, read their logs and CPU, memory and disk metrics, and browse the team's templates, builds and snapshots.

Connectors

How to Connect E2B to Meta Muse via MCP

Manage the E2B cloud sandboxes of your team with your AI: list, start, inspect, pause, resume and extend sandboxes, read their logs and CPU, memory and disk metrics, and browse the team's templates, builds and snapshots.

Connectors

How to Connect E2B to Microsoft Copilot via MCP

Manage the E2B cloud sandboxes of your team with your AI: list, start, inspect, pause, resume and extend sandboxes, read their logs and CPU, memory and disk metrics, and browse the team's templates, builds and snapshots.