Featured Developer Tools
code-executionsandboxpythonsecurity

Summary

Run AI-generated code safely in an isolated cloud sandbox, with results returned as data rather than text.

Features

  • Run code in an isolated cloud sandbox
  • Stateful sessions across multiple executions
  • Returns charts, tables, and files as structured results

Installation

Set up this MCP server in your favorite AI agent — copy a ready-made configuration below.

Any MCP-compatible agent

Most agents (Claude, Cursor, Windsurf, VS Code, and more) read a standard mcpServers configuration.

  1. Open your agent's MCP configuration file.
  2. Merge the snippet below into it, filling in the environment variables with your own values.
  3. Restart the agent — the "E2B" tools will be available.
{
  "mcpServers": {
    "e2b-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@e2b/mcp-server"
      ],
      "env": {
        "E2B_API_KEY": "your-api-key"
      }
    }
  }
}

Description

The E2B MCP server gives an assistant a real computer to run code on — isolated, disposable, and started in well under a second.

What it enables

  • Code execution in a sandboxed cloud VM with a Python runtime and internet access
  • Stateful sessions. Variables and imports persist between executions, so an assistant can build up an analysis step by step the way a person would in a notebook.
  • Rich results. Charts come back as images, DataFrames as structured tables — not as text descriptions of what the output would have looked like.
  • File handling for uploading data and retrieving generated artefacts

Why the isolation matters

Any assistant that writes code will eventually want to run it, and running model-generated code on your own machine is a category of risk not worth taking. The sandbox contains mistakes and prompt injection alike, and it is destroyed when the task ends.

Common uses

Data analysis over an uploaded file, verifying that generated code actually works before handing it over, mathematical computation, and any task where executing is more reliable than reasoning.

Requires an E2B API key; runs with npx @e2b/mcp-server. Free tier available.

Related MCP Servers

Browse all MCP servers →