Skip to main content
Glama
feifeigood

code-sandbox-mcp

by feifeigood
README.md
# Code Sandbox MCP

MCP (Model Context Protocol) server for E2B code sandbox. This server provides tools to create, manage, and execute code in secure E2B sandboxes.

## Features

- **Create Sandbox**: Create new E2B sandboxes with customizable timeout and template
- **Kill Sandbox**: Terminate existing sandboxes by ID
- **Run Code**: Execute Python code in sandboxes using Jupyter Notebook syntax
- **Run Command**: Execute shell commands in sandboxes

## Installation

```bash
pip install code-sandbox-mcp
```

Or using uv:

```bash
uv pip install code-sandbox-mcp
```

## Usage

### Configuration

Add the following configuration to your MCP client settings JSON file (e.g., `~/.config/claude_desktop/claude_desktop_config.json` for Claude Desktop, or `.cursor/mcp.json` for Cursor):

```json
{
  "mcpServers": {
    "code-sandbox-mcp": {
      "command": "uv",
      "args": ["run", "code-sandbox-mcp"],
      "env": {
        "E2B_API_KEY": "your_api_key_here",
        "E2B_DOMAIN": "your_domain_here"
      }
    }
  }
}
```

Replace `your_api_key_here` and `your_domain_here` with your actual E2B credentials.

Restart your MCP client to load the configuration. The tools will be available in your MCP-enabled application!

## License

MIT

TDQS

A4/5.0

Scored across 4 tools

Disambiguation4/5

Each tool has a clear primary purpose, but run_command and run_code can implicitly create sandboxes, which overlaps with create_sandbox's role. Descriptions are clear enough to avoid confusion, but the optional sandbox_id in both creates some ambiguity about which tool to use for sandbox creation.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern: create_sandbox, kill_sandbox, run_command, run_code. This makes the API predictable and easy to navigate.

Tool Count4/5

Four tools is slightly on the small side but well-matched to the server's narrow scope of sandbox lifecycle management and code execution. It falls within the typical well-scoped range, though one or two additional tools (e.g., list_sandboxes) would be reasonable.

Completeness2/5

The tool set has a significant lifecycle gap: run_command and run_code can create sandboxes implicitly but do not return the sandbox ID, making those sandboxes impossible to kill or reuse. There is also no way to list active sandboxes or check their status, limiting operational visibility and control.

Maintenance

ActivityInactive
ResponsivenessNo issues