Set it up
- 1
Turn on E2B in your AI
In Claude: open Settings → Connectors and add E2B. In ChatGPT: Settings → Apps & Connectors.
- 2
Add it to your app once
Copy the short config below into your app. It just tells your AI where to find E2B.
- 3
Just ask
Tell it what you want in plain words — no special commands.
For example, say
“Run a quick Python script in the E2B sandbox that prints the first 10 Fibonacci numbers”
Need the exact config? Show it +
Add to your client
{
"mcpServers": {
"e2b": {
"command": "npx",
"args": ["-y", "@e2b/mcp-server"],
"env": {
"E2B_API_KEY": "<your-e2b-api-key>"
}
}
}
}Paste into your client's MCP configuration file.
Quick skills
Copy one, paste it to your AI, watch it work.
Verified Code Execution
“Write a Python script to deduplicate this CSV, run it in the sandbox, and show me the result”
Data Analysis
“Take this sales CSV, run some exploratory analysis in pandas, and summarize the findings”
Sandboxed Testing
“Try installing a weird NPM package in the sandbox and see if it does anything suspicious”
Good to know
- · E2B is usage-based — sandboxes are billed by runtime
- · Each sandbox is ephemeral — state doesn't persist between runs unless you save it
- · Installing large dependencies each run is slow — consider prebuilt templates
When to use
- ✓ You want your AI to actually execute code to verify output, not just write it
- ✓ You're doing data analysis and want AI to run pandas/numpy on a sample
- ✓ You're building agents that need a safe scratch environment
- ✓ You want code to run without polluting your local machine
When not to use
- × You want to run code in your local environment — do that directly
- × You need to process gigabytes of data — sandboxes have resource limits
- × You want long-running services (sandboxes are ephemeral)
About
Imagine your AI being able to say 'let me actually run this Python code' and execute it in a safe cloud sandbox — then show you the result. This server connects your AI to E2B, a secure cloud environment where it can run code, test scripts, and use real tools without touching your machine.
The E2B MCP server enables AI assistants to execute code in secure, sandboxed cloud environments. Run Python, JavaScript, R, and other languages without local setup. Supports file operations, package installation, and persistent state within sessions.
Ideal for data analysis, scientific computing, and scenarios where you want AI to run and verify code before returning results.
Workflows That Use E2B MCP
Recommended recipe
Give Claude memory and real documentationPersistent memory across chats, live library docs, and structured reasoning — so answers stop drifting.
Works With
Also Consider
FAQ
What does E2B MCP do? +
Imagine your AI being able to say 'let me actually run this Python code' and execute it in a safe cloud sandbox — then show you the result. This server connects your AI to E2B, a secure cloud environment where it can run code, test scripts, and use real tools without touching your machine.
Do I need to know how to code? +
No. Turn it on in your AI's settings and ask in plain English — no terminal, no coding.
When should I use E2B MCP? +
Reach for it when you need to: You want your AI to actually execute code to verify output, not just write it; You're doing data analysis and want AI to run pandas/numpy on a sample; You're building agents that need a safe scratch environment; You want code to run without polluting your local machine.
When should I avoid E2B MCP? +
Skip it when: You want to run code in your local environment — do that directly; You need to process gigabytes of data — sandboxes have resource limits; You want long-running services (sandboxes are ephemeral).
How do I install E2B MCP? +
In Claude Code, run: claude mcp add e2b -e E2B_API_KEY=<your-key> -- npx -y @e2b/mcp-server. Copy-paste configs for Claude Desktop, Cursor, and Windsurf are at the top of this page.