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.

7 天免费 · 无需信用卡 · EU 托管

问 E2B 任何事

通过 AnythingMCP 对 E2B 试一个真实提示 — Claude 调用工具并返回答案。在你的消息上按 Enter 即可在 Cloud 安装。

在 Cloud 上安装 E2B
E2B · 通过 MCP 实时
分享
Opus 4.7

Claude 是 AI,可能会出错。请核对回答。

2 分钟设置

  1. 1在 cloud.anythingmcp.com 开始免费试用。
  2. 2在连接器商店点击 E2B。提示时粘贴凭据。
  3. 3生成 MCP API 密钥,将 AI 客户端指向生成的 MCP URL。
立即安装 E2B

E2B 指南

面向主流 AI 客户端的逐步设置。

配置 E2B

直接来自连接器定义:在哪里获取凭据、需要哪些权限,以及该适配器调用的是哪个 API。 由连接器作者以英文提供。

E2B

This connector uses the E2B control-plane API (https://api.e2b.app): it manages the team's cloud sandboxes (small isolated Linux VMs that AI agents use to run code), reads their logs and resource metrics, and lists templates, builds and snapshots.

Paid calls: e2b_create_sandbox starts a sandbox and e2b_resume_sandbox restarts a paused one; a running sandbox is billed per second for its CPU and memory until it times out, is paused or is killed. e2b_set_sandbox_timeout extends that time. Confirm with the user before starting sandboxes or extending them, keep timeout short, and pause or let them expire when done. Reads cost nothing.

Setup (2 minutes)

  1. Sign in at https://e2b.dev/dashboard.
  2. Open Keys (https://e2b.dev/dashboard?tab=keys) and copy a team API key (it starts with e2b_).
  3. Paste it into E2B_API_KEY. It is sent in the X-API-Key header.
  4. Run e2b_list_sandboxes to check it.

Workflow

  • Templates: e2b_list_default_templates shows E2B's ready-made templates (e.g. base, code-interpreter-v1, desktop) with CPU, memory and disk; e2b_list_templates the team's own templates with aliases, build status and spawn counts; e2b_list_template_builds the builds of one template.
  • Start: e2b_create_sandbox with template_id (template id or alias, default base), a timeout in seconds (default 300), optional metadata (string key-value pairs to find it again), env_vars, auto_pause and allow_internet_access. The answer has the sandboxID and domain.
  • Inspect: e2b_list_sandboxes (filter by state running or paused, template, metadata such as user=abc&app=prod, started_after); e2b_get_sandbox for one sandbox's template, resources, start and end time, state and network settings; e2b_get_sandbox_logs for its system and process logs; e2b_get_sandbox_metrics for CPU, memory and disk use over time.
  • Lifecycle: e2b_set_sandbox_timeout sets a new end time counted from now (the plan caps it: 1 hour on Hobby, 24 hours on Pro); e2b_pause_sandbox freezes it with its memory and files (paused sandboxes are not billed for compute); e2b_resume_sandbox resumes a paused sandbox (or just extends a running one); e2b_list_snapshots lists saved snapshots.

Switched off at install: e2b_kill_sandbox; it cannot be undone (the sandbox and its files are gone), so an admin switches it on when the team needs it.

Running code inside a sandbox is not part of this connector. Commands, files and the code interpreter are served by the sandbox itself (its envd agent on https://<port>-<sandboxID>.e2b.app), not by this API: every sandbox has its own host and its own access token, process output is streamed, 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 point the agent at a tool that wraps them.

Reading answers: times are ISO 8601, UTC; metric timestamps and log cursor values are Unix (metrics start and end in seconds, log cursors in milliseconds). cpuCount is vCPUs, memoryMB and diskSizeMB megabytes. The sandbox access tokens are removed from answers.

Paging: e2b_list_sandboxes, e2b_list_templates, e2b_list_template_builds and e2b_list_snapshots return the next page token in _headers.x-next-token (the list itself is under data when the answer is a list); pass it as next_token until it is missing. e2b_list_sandboxes also returns _headers.x-total-running.

Errors: 400 bad parameter (e.g. a timeout over the plan's maximum); 401 invalid key; 403 the team may not use the template; 404 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, wait and do not loop; 500 and 503 E2B-side errors.

你的 AI 距离 E2B 仅两次点击。

安装连接器、粘贴凭据、向 AI 提问。7 天免费,无需信用卡。