Skip to main content
Glama
README.md
# E2B MCP Server

An MCP server that exposes the E2B Sandbox API as Model Context Protocol tools.

## Features

The server currently provides tools for:

- **Sandboxes** (`sandbox_create`, `sandbox_connect`, `sandbox_list`, `sandbox_kill`, `sandbox_pause`, `sandbox_set_timeout`, `sandbox_get_info`) — create/connect/list/kill/pause sandboxes and manage their timeout, via the E2B JS SDK (`Sandbox`).
- **Filesystem** (`files_read`, `files_write`, `files_list`, `files_make_dir`, `files_rename`, `files_remove`, `files_exists`, `files_get_info`) — read/write/list/move/remove/stat files via `Sandbox.files`.
- **Commands** (`commands_run`, `commands_connect`, `commands_list`, `commands_send_stdin`, `commands_close_stdin`, `commands_kill`) — run and manage commands via `Sandbox.commands`.
- **PTY** (`pty_create`, `pty_connect`, `pty_send_input`, `pty_resize`, `pty_kill`) — pseudo-terminal sessions via `Sandbox.pty`.

The server is stateless: it authenticates with `E2B_API_KEY` (env) and, for secure sandboxes, replays the `accessToken` returned by `sandbox_create` / `sandbox_connect` on every later call.

Deprecated E2B API endpoints and snapshot-related functionality have been removed from the project.

## Requirements

- Node.js 22 or later
- An E2B API key

## Installation

```bash
npm ci
```

## Configuration

Set your E2B API key in the environment:

```bash
export E2B_API_KEY="your-api-key"
```

## Usage

Start the server with:

```bash
npm start
```

The server is designed to be used as an MCP server over stdio. It can be connected to any MCP-compatible client that supports stdio servers.

## Docker

Build the image:

```bash
docker build -t e2b-mcp-server .
```

Run it:

```bash
docker run --rm -i \
  -e E2B_API_KEY="$E2B_API_KEY" \
  e2b-mcp-server
```

## Development

Check the JavaScript syntax for all source files:

```bash
for f in src/*.js; do node --check "$f"; done
```

Run the smoke test:

```bash
npm run smoke
```

## Project Structure

```text
src/
├── http.js
├── index.js
├── tools-common.js
├── tools-filesystem.js
├── tools-process.js
├── tools-sandboxes.js
└── tools-templates.js
```

## License

ISC

TDQS

C2.9/5.0

Scored across 23 tools

Disambiguation4/5

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.

Naming Consistency4/5

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.

Tool Count3/5

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.

Completeness4/5

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.

Maintenance

ActivityMaintained
ResponsivenessSyncing