E2B MCP server for AI agents

Live

API KEY

SANDBOXES

Developer Tools

E2B gives your agent control of E2B sandboxes: start, pause, fork, and kill sandboxes, read their logs and metrics, manage templates, snapshots, and volumes, and store secrets.

  • Per-user credentials: each call uses the actual user's API key, never a shared bot.
  • Encrypted per-tenant vault: AES-256, resolved at request time, never in LLM context.
  • Scoped before every call: pre-call scope check, 90-day SIEM-exportable audit chain.
E2B
agent · Acme Q3
Run
Which sandboxes are running right now in our E2B project?
S
e2b_list_sandboxes
96ms
Sandbox agent
7 sandboxes are running. 5 use the code-interpreter template and 2 started more than an hour ago.
Sources: E2B project, 7 sandboxes
e2b
7 sandboxes
18:29
Message Claude...

Tools your sandbox agent reaches for on E2B, scoped per user.

CALL ANY TOOL
38 tools for E2B sandboxes: create, connect, pause, fork, and kill sandboxes, read logs, events, and metrics, and manage templates, tags, snapshots, volumes, and secrets.
e2b_assign_template_tags
Assign template tags
Assign one or more tags to a build of an E2B template. Returns tags (the assigned tags) and buildID. Use this to label a build, for example as production. Use e2b_delete_template_tags to remove tags.
Parameters
Name
Type
Required
Description
tags
array
Required
Tags to assign to the target build. Example: ["production", "v2"]
target
string
Required
The template build to tag, written as template-name:existing-tag. Example: my-template:latest
e2b_connect_sandbox
Connect sandbox
e2b_create_sandbox
Create sandbox
e2b_create_secret
Create secret
e2b_create_snapshot
Create snapshot
e2b_delete_secret
Delete secret
e2b_delete_template
Delete template
e2b_delete_template_tags
Delete template tags
e2b_fork_sandbox
Fork sandbox
e2b_get_sandbox
Get sandbox
e2b_get_sandbox_logs
Get sandbox logs
e2b_get_sandbox_metrics
Get sandbox metrics
e2b_get_secret
Get secret
e2b_get_team_max_metric
Get team max metric
e2b_get_template
Get template
e2b_get_template_build_logs
Get template build logs
e2b_get_template_build_status
Get template build status
e2b_get_template_by_alias
Get template by alias
e2b_kill_sandbox
Kill sandbox
e2b_list_events
List events
e2b_list_sandbox_events
List sandbox events
e2b_list_sandbox_metrics
List sandbox metrics
e2b_list_sandboxes
List sandboxes
e2b_list_snapshots
List snapshots
e2b_list_template_tags
List template tags
e2b_list_templates
List templates
e2b_pause_sandbox
Pause sandbox
e2b_set_sandbox_timeout
Set sandbox timeout
e2b_update_sandbox_network
Update sandbox network
e2b_update_secret
Update secret

For more tools, view docs.

Build your Agent
Same auth pattern across LangChain, OpenAI, Anthropic, and Google ADK.
Python · LlamaIndex
import { ScalekitClient } from "@scalekit-sdk/node";
import { createReactAgent } from "@langchain/langgraph/prebuilt";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

// E2B tools scoped to this user
const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["e2b"], toolNames: [
    "e2b_create_sandbox",
    "e2b_list_sandboxes",
    "e2b_get_sandbox_logs"] },
  pageSize: 100,
});

const agent = createReactAgent({ llm, tools });
await agent.invoke({ messages: [{ role: "user", content: "List the sandboxes running in our E2B project" }] });
import OpenAI from "openai";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const openai = new OpenAI();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["e2b"] }, pageSize: 100,
});

const res = await openai.chat.completions.create({
  model: "gpt-5",
  messages: [{ role: "user", content: "List the sandboxes running in our E2B project" }],
  tools,
});

// Execute the tool call with the user's vaulted E2B API key
await sk.tools.executeTool(res.choices[0].message.tool_calls[0], "user_123");
import Anthropic from "@anthropic-ai/sdk";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const anthropic = new Anthropic();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["e2b"] }, pageSize: 100,
});

const msg = await anthropic.messages.create({
  model: "claude-sonnet-5",
  max_tokens: 1024,
  messages: [{ role: "user", content: "List the sandboxes running in our E2B project" }],
  tools,
});

// Tool call runs with the user's vaulted E2B API key
await sk.tools.executeTool(msg.content, "user_123");
import { Agent } from "@google/adk/agents";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["e2b"] }, pageSize: 100,
});

const agent = new Agent({
  name: "sandbox_agent",
  model: "gemini-2.5-pro",
  instruction: "E2B tools scoped to this user",
  tools,
});

await agent.run("List the sandboxes running in our E2B project");
Try these prompts
Copy any prompt into your agent. Each maps directly to a E2B tool. Click to copy, paste into your agent, done.
Sandboxes
Copy the prompt
Copied
Start a sandbox from the code-interpreter template with a 10 minute timeout.
Copy the prompt
Copied
Pause sandbox ixq3 so it stops billing.
Copy the prompt
Copied
Fork sandbox ixq3 into 2 new sandboxes.
Logs and metrics
Copy the prompt
Copied
Show error logs from sandbox ixq3.
Copy the prompt
Copied
What was our peak concurrent sandbox count yesterday?
Copy the prompt
Copied
List lifecycle events for all sandboxes in the last hour.
Templates and storage
Copy the prompt
Copied
List our templates and their build status.
Copy the prompt
Copied
Tag the latest build of the data-agent template as production.
Copy the prompt
Copied
Create a volume called shared-datasets.
SEE HOW AUTH WORKS
Each user connects their own E2B API key once, and Scalekit sends it with every call. Keys stay vaulted, every call is scope checked, and every action is logged.
1
Authorize
Your user connects
E2B
once. We tie it to their identity and the meetings they approved — no shared bot account, no org-wide access
Who:
user ‘A’
when:
Once per user
access:
Limited to user
2
Store
Their
E2B
token lives in a vault scoped to them. User A's meetings are never reachable by an agent acting for user B, even on the same connection
vault:
encrypted
scope:
per-user
tokens:
auto-refreshed
3
Resolve
When your agent calls a
E2B
tool, we fetch the right token server-side. It never touches your agent, never appears in the LLM context, never shows up in your logs
speed:
~40ms
check:
before every call
seen by:
nobody
4
Audit
Every
E2B
tool call is logged — who triggered it, which meeting was fetched, what came back. 90 days of history, tied to the user who authorized it
history:
90 days
export:
SIEM-ready
logged:
every call
Test other agents
See the same per-user auth pattern across other developer tools and AI connectors.
Engineering Teams
DevOps assistant agent
Polls GitHub for failing checks and stale PRs, opens Linear issues for the ones that need work, and posts a daily digest to Slack. It acts as the engineer, not a shared service account.
Test other agents
See the same per-user auth pattern across other developer tools and AI connectors.
ENGINEERING
DevOps assistant agent
Poll GitHub for failing checks and stale pull requests, open Linear issues for the ones that need work, and digest to Slack.
Why Scalekit
Secure your agent's access. Connectors ship in minutes
01.
Shared tokens break per-user analytics
A shared E2B API key looks fine in a demo. In production every sandbox start looks like one service account, and you cannot tell which user triggered it. Scalekit resolves the credential of the actual user who triggered the agent, never a shared bot.
// shared key
audit → bot_service_account

// scalekit
audit → user_abc ✓
02.
Authentication is not authorization
03.
Multi-tenancy is architectural
04.
E2B today. Ten connectors tomorrow.
“Our agents act across Salesforce, Gong, Google Drive, and more, on behalf of every customer. Scalekit behind the scenes meant we can keep adding tools without ever rebuilding how credentials or tool calling work.”
Venu Madhav Kattagoni
Head of Engineering / Von
FAQs
Frequently Asked Questions
Does the agent access E2B as the user or through a shared API key?
As the user. Each user connects their own E2B API key once, and Scalekit sends it with every call. Sandboxes the agent starts, pauses, or kills are attributed to that user in your audit trail, not a shared service account.
Where is the E2B API key stored?
In Scalekit's managed AES-256 token vault, namespaced per tenant. To rotate it, the user reconnects with a new API key. Revocation is a single dashboard action. Credentials never appear in prompts, logs, or LLM context.
Can I limit what the agent does in E2B?
Yes. Filter by tool name in listScopedTools to expose only what you want, for example sandbox and log tools without e2b_kill_sandbox and e2b_delete_volume, which discard sandbox state and stored data. Scalekit also enforces scope checks before every API call.
What happens when a user revokes E2B access?
The connection is invalidated on the next tool call. Subsequent requests for that user fail closed with a clear error. Other users in the tenant remain unaffected. The event is logged for audit.
Can the agent read the values of E2B secrets?
No. e2b_list_secrets and e2b_get_secret return names, versions, and metadata, never the secret value. Sandboxes use secrets through network rules without seeing them, and e2b_update_secret rotates a value by storing a new version.
Start in your coding agent
Up and running in one command
Install the Scalekit skill in your editor of choice. Connector, auth, tools, prompt, all wired up
Claude Code REPL
/plugin marketplace add scalekit-inc/claude-code-authstack
/plugin install agentkit@scalekit-auth-stack
Cursor Code REPL
# ~/.cursor/mcp.json
{
""mcpServers"": {
""e2b"": {
""url"": ""https://mcp.scalekit.com/e2b"",
""headers"": { ""Authorization"": ""Bearer $SCALEKIT_TOKEN"" }
}
}
}
Codex Code REPL
# ~/.codex/config.toml
[mcp_servers.e2b]
url = ""https://mcp.scalekit.com/e2b""
auth_env = ""SCALEKIT_TOKEN""
Copilot Code REPL
# .vscode/mcp.json
{
""servers"": {
""e2b"": {
""url"": ""https://mcp.scalekit.com/e2b"",
""type"": ""http""
}
}
}