E2B Code Sandbox
E2B Code Sandbox is an MCP server from E2B, the company that rents cloud sandboxes for running untrusted code. The server hands your agent exactly one tool, run_code, which executes a Python snippet inside a fresh E2B sandbox and returns whatever it printed. Everything else E2B sells sits behind its SDK, not here.
How we started it
npx -y @e2b/mcp-serverUse it if you want an agent to run Python somewhere that is not your laptop, and you accept that this particular package is on its way out. We started it and it booted clean, listing one tool whose whole tools/list payload is 289 bytes (~72 tokens, chars/4 estimate, measured 2026-08-19). The argument against is printed by npm itself during install: the registry warns that @e2b/mcp-server@0.2.3 is no longer supported, and the running process still identifies itself as e2b-mcp-server 0.1.0. A deprecated dependency in the middle of your code-execution path is a maintenance bill you will eventually pay.
Use it if
Skip it if
The bill for your context window
| Tool | Est. tokens | Described? | Required params |
|---|---|---|---|
| run_code | ~72 | yes (78 chars) | 1 |
This is the cheapest server in the batch by a wide margin. One tool, a 78-character description, one required parameter, and a tools/list weighing 289 bytes or about 72 tokens on the chars/4 estimate. Set that against Notion, the heaviest server we measured in the same batch, whose two dozen tools cost more than two hundred times as much before the agent has done anything. So the usual question of which tools carry the weight does not apply here: run_code carries all of it and it barely registers. If you are assembling a crowded toolbelt, this one costs almost nothing to keep loaded.
Setup reality
Run it as npx -y @e2b/mcp-server over stdio. The harness ran it with a clean env and no secrets, and it still initialized and answered tools/list, so the boot itself does not gate on credentials; scraped env hints came back empty. That is not the same as being usable. E2B's README asks for an E2B_API_KEY, and without one the sandbox call will fail at execution time rather than at startup, which is the more annoying place to find out. Get a key from E2B first, put it in your client's env block, and expect npm to print the deprecation warning on every fresh install.
Questions people ask
Does the E2B MCP server need an API key to start?
Not to start. We booted it under a clean env with no secrets and it completed initialize and tools/list. Actually executing code needs an E2B account key, per the README, and that failure shows up on the first run_code call instead of at launch.
Is @e2b/mcp-server deprecated?
npm prints a deprecation notice during install saying version 0.2.3 is no longer supported. The server still runs and reports itself as e2b-mcp-server 0.1.0 on protocol 2025-06-18. Treat it as working but unmaintained, and keep an eye on E2B's own SDK as the supported path.
How many tools does it expose?
One: run_code, with a single required parameter. There is no file handling, no session management, and no shell. If your agent needs to keep state across steps, you will be rebuilding that yourself around a stateless call.
Why did it take so long to boot?
Our measured init was 10578 ms, and most of that is npx resolving and downloading the package on a cold cache rather than the server doing work. Pin and pre-install it locally and the launch cost mostly disappears.
Other code execution servers we started
| Server | Vendor | Boots | Context tax |
|---|---|---|---|
| Desktop Commander | community | ✓ | ~15,226 tokens |
How this page is made: the server is spawned as an unprivileged user with a clean environment and no credentials, then asked for its tools, resources and prompts over stdio. Token figures are estimates at four characters per token, not a tokenizer count. One run, one machine. Corrections: contact the desk.