E2B MCP Server
This server exposes MCP tools for managing E2B sandboxes, their filesystems, processes, and templates over HTTP, using an E2B API key per request.
Sandboxes: list, create from template, connect/resume, pause, delete, set/refresh timeout, and fetch logs.
Filesystem: list/make/move/remove directories or files, stat paths, read files, and upload/write files.
Processes: run commands with args/env/timeout, list running processes, send signals/stdin, close stdin, and resize PTYs.
Templates: fetch template details/builds and resolve a template by alias.
Auth: accepts E2B API key via
Authorization: Bearer,X-E2B-Api-Key, or?e2b_api_key=query parameter.Note: the schema includes sandbox create/delete, which conflicts with the README statement that the bridge does not create or delete sandboxes.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@E2B MCP Server Create a sandbox and run `python3 --version` in it."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
E2B Sandbox MCP on Convex
Stateless MCP-over-HTTP bridge for controlling existing E2B sandboxes from a Convex deployment.
The server runs as a Convex HTTP Action at /mcp. E2B SDK calls run in a Convex Node.js Action so command execution and filesystem access can use the official e2b package directly.
Runtime
Convex
1.46.0E2B JavaScript SDK
2.51.0Convex Node.js runtime pinned to Node
22inconvex.jsonTypeScript only; there is no Anvil/Appwrite/PubNub runtime or Python dependency
Related MCP server: code-sandbox-mcp
Tool flow
get_sandbox_id is the discovery tool and must be called before any other tool. It returns the ID of the first sandbox visible to the supplied E2B API key.
Every other tool requires sandbox_id as a mandatory argument. The server also validates this at runtime, so a tool call without sandbox_id fails with an instruction to call get_sandbox_id first.
Available tools:
get_sandbox_idpauseexecsearch_codeprojects_listproject_createfiles_listfiles_readfiles_writefiles_stat
Compatibility aliases are retained for sandbox_pause, sandbox_exec, sandbox_files_list, sandbox_files_read, sandbox_files_write, and sandbox_files_stat.
The bridge does not create or delete E2B sandboxes.
Authentication
Each request supplies its own E2B API key. Supported forms, in priority order:
Authorization: Bearer e2b_...X-E2B-Api-Key: e2b_...?e2b_api_key=e2b_...(or compatibility alias?api_key=...)
Keys are passed directly to the E2B SDK and are not persisted by Convex.
Deploy
npm install
npx convex login
npx convex devAfter linking the directory to a Convex project, deploy production functions with:
npx convex deployThe MCP URL is:
https://<deployment>.convex.site/mcpFor MCP clients that cannot set headers:
https://<deployment>.convex.site/mcp?e2b_api_key=e2b_...Development checks
npm test
npm run checkThe contract tests ensure get_sandbox_id is the discovery tool and that every other exposed tool requires sandbox_id.
Available Tools
23 toolse2b_close_stdinB
Close stdin (send EOF) for a non-PTY process running in a sandbox, selected by pid or tag.
Inputs: sandboxId (required), pid, tag, port, +2 more.
e2b_connect_sandboxB
Connect to a sandbox. If paused, resumes it and returns fresh sandbox details.
Inputs: timeout (required), sandboxId (required).
e2b_create_sandboxD
Create a sandbox from a template.
Inputs: templateId (required), secure, envVars, timeout, +5 more.
e2b_delete_sandboxC
Kill/delete a sandbox permanently.
Inputs: sandboxId (required).
e2b_get_sandbox_logsC
Get structured logs for a sandbox (v2 endpoint), with pagination/filtering.
Inputs: sandboxId (required), level, limit, cursor, +2 more.
e2b_get_templateD
Get a template and its builds.
Inputs: templateId (required), limit, nextToken.
e2b_get_template_by_aliasB
Check whether a template with the given alias/name exists and get its id.
Inputs: alias (required).
e2b_list_dirC
List the contents of a directory in a sandbox.
Inputs: path (required), sandboxId (required), port, depth, +2 more.
e2b_list_processesB
List running processes started via envd in a sandbox.
Inputs: sandboxId (required), port, username, accessToken.
e2b_list_sandboxes_v2C
List sandboxes (v2).
Inputs: metadata.
e2b_make_dirC
Create a directory in a sandbox (including parent directories).
Inputs: path (required), sandboxId (required), port, username, +1 more.
e2b_moveB
Move or rename a file/directory in a sandbox.
Inputs: source (required), sandboxId (required), destination (required), port, +2 more.
e2b_pause_sandboxB
Pause a running sandbox so it can be resumed later.
Inputs: sandboxId (required), memory.
e2b_read_fileC
Read a file from a sandbox. Returns its content as UTF-8 text or base64.
Inputs: path (required), sandboxId (required), port, encoding, +2 more.
e2b_refresh_sandboxB
Refresh a sandbox, extending its time to live.
Inputs: sandboxId (required), duration.
e2b_removeC
Remove a file or directory in a sandbox.
Inputs: path (required), sandboxId (required), port, username, +1 more.
e2b_resize_ptyB
Resize the PTY of a running process (cols/rows), selected by pid or tag. Note: shape inferred from process.PTY.Size; verify against E2B docs (api-reference/process/update) if it errors.
Inputs: cols (required), rows (required), sandboxId (required), pid, +4 more.
e2b_run_commandB
Run a command in a sandbox and wait (up to timeoutMs) for it to finish, returning collected stdout/stderr/exit status. Uses the streaming process.Process/Start RPC under the hood.
Inputs: cmd (required), sandboxId (required), cwd, args, +5 more.
e2b_send_signalA
Send SIGTERM or SIGKILL to a process running in a sandbox, selected by pid or tag.
Inputs: signal (required), sandboxId (required), pid, tag, +3 more.
e2b_send_stdinA
Send input to the stdin of a running process, selected by pid or tag. Note: field names are inferred from the related Start/SendSignal schemas; if this errors, check the E2B docs for the exact process.Process/SendInput request shape.
Inputs: input (required), sandboxId (required), pid, tag, +3 more.
e2b_set_sandbox_timeoutA
Set the sandbox timeout: it will expire N seconds from now. Overwrites any previous TTL.
Inputs: timeout (required), sandboxId (required).
e2b_statB
Get metadata (type, size, permissions, owner, mtime...) about a file or directory in a sandbox.
Inputs: path (required), sandboxId (required), port, username, +1 more.
e2b_upload_fileA
Upload/write a file into a sandbox, creating parent directories as needed. Overwrites if it already exists.
Inputs: path (required), content (required), sandboxId (required), port, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 23 tools
Most tools clearly target distinct resources and actions, but a few overlap: refresh_sandbox and set_sandbox_timeout both adjust TTL, and get_template vs get_template_by_alias are similar. Overall, the purposes are still largely separable.
All tools share the e2b_ prefix and snake_case verb_noun structure, making the set predictable. Minor deviations include list_sandboxes_v2 vs get_sandbox_logs, and make_dir vs create_sandbox, but these do not seriously harm usability.
23 tools is on the heavy side and spans sandboxes, templates, filesystems, and process control. The count is defensible given the breadth, but it starts to feel large for an agent to scan.
Sandbox lifecycle, filesystem, and process interaction are well covered. The main gap is template management: only get operations exist, with no create/update/delete template tools, though this may be intentionally outside the server's scope.
Related MCP Connectors
Secure Linux sandboxes for AI agents, as MCP tools.
Start and manage Reason cloud coding agents, projects and sessions from any MCP client.
Hosted MCP for Celesto cloud computers: create, exec, ports, start/stop/delete.
MCP gateway and cloud hosting for MCP servers, agents and apps like RAG, managed from your agent.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceProvides remote filesystem operations, git repository management, and process execution capabilities for AI agents through the Model Context Protocol.-
- AlicenseAqualityDmaintenanceMCP server for E2B code sandbox, enabling creation, management, and execution of code in secure sandboxes using Python and shell commands.41MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol server that enables AI assistants to create, control, and interact with virtual desktop environments through E2B's secure cloud sandboxes.614 npm4MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with E2b's tools and services through a standardized MCP interface, allowing AI agents to use E2b capabilities.MIT