Back to Servers

E2B Code Interpreter

Official

by E2B

Run arbitrary code directly from Claude or any MCP-compatible AI assistant inside secure, isolated cloud sandboxes that spin up in under 200 milliseconds. The E2B MCP Server connects your AI workflow to E2B's Firecracker-powered microVMs, giving the model full access to a Linux environment where it can execute Python, JavaScript, and other languages, install packages via pip or npm, read and write files, and return results including generated charts and data visualizations. The server exposes approximately 15 tools covering three areas: sandbox lifecycle management (creating and destroying sandboxes on demand), code execution (running scripts in fresh or persistent contexts where variables carry over between calls), and file operations (reading, downloading, and watching files inside the sandbox). Each sandbox is a lightweight virtual machine with its own filesystem, network stack, and process space, so the AI agent can install system libraries, start servers, and run untrusted code without any risk to your local development environment. E2B's infrastructure is built specifically for AI agent workloads. Sandboxes are billed per second at roughly $0.05 per hour for a single vCPU, and new accounts receive a $100 free usage credit with no credit card required. The Hobby tier supports sessions up to one hour and 20 concurrent sandboxes, while the Pro tier extends sessions to 24 hours with configurable CPU and RAM. The server is available as both a JavaScript/TypeScript package and a Python package, and can be installed directly via npx or through the Smithery CLI for quick Claude Desktop integration.

developmentcode-interpretersandboxai-agentscode-executioncloud-sandboxpythonjavascriptfirecracker

Installation

npx @e2b/mcp-server

Key Features

  • Execute Python, JavaScript, and other languages in isolated Firecracker microVMs that start in under 200ms
  • Persistent code contexts where variables and state carry over between sequential execution calls
  • File operations including reading, downloading, and watching directories inside the sandbox filesystem
  • Sandbox lifecycle management with on-demand creation and teardown to control costs
  • Automatic chart and visualization extraction from matplotlib and other plotting libraries as base64 images
  • Package installation support via pip, npm, apt, and other system package managers inside the sandbox

Use Cases

  • A data analyst asks Claude to load a CSV dataset, calculate correlations, and generate a scatter plot — Claude creates an E2B sandbox, runs the pandas and matplotlib code, and returns the chart as a downloadable image without touching the local machine.
  • A developer debugging a complex algorithm pastes their code into Claude and asks it to run with different inputs — Claude executes each variation in a persistent sandbox context, compares outputs, and identifies the edge case causing failures.
  • A teacher building a coding tutorial has Claude run Monte Carlo simulations with thousands of iterations to estimate pi, demonstrating statistical convergence with live-generated visualizations at each step.
  • A security researcher needs to test a suspicious script found in a repository — Claude executes the code inside an isolated E2B sandbox where it cannot access the host filesystem or network, then reports what the script actually does.
  • A product team prototyping a web scraper asks Claude to write and test the scraper end-to-end — Claude installs requests and BeautifulSoup in the sandbox, runs the scraper against a target URL, and returns parsed results for review.

FAQ

Server Stats

GitHub Stars
382
Updated
3/14/2026
NPM Package
@e2b/mcp-server

Category

Related Resources

Weekly AI Digest