asif-nvc/e2b-sandbox-mcp

šŸ‘Øā€šŸ’» Code Execution🟢 Verified Active
0 Views
0 Installs

šŸ“‡ ā˜ļø šŸŽ 🪟 🐧 - Connect Claude Code with E2B cloud sandboxes — 29 tools for creating isolated Linux VMs, cloning repos, running commands, managing files, and performing git operations without touching the local machine.

Quick Install

One-Click IDE Configuration
claude_desktop_config.json
{
  "mcpServers": {
    "asif-nvc-e2b-sandbox-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "asif-nvc-e2b-sandbox-mcp"
      ]
    }
  }
}
Or

Using an AI coding agent (Claude Code, Cursor, etc.)? Copy a ready-made prompt that tells it to fetch the setup instructions and install this server for you.

Documentation Overview

E2B Sandbox MCP Server

npm version license

An MCP (Model Context Protocol) server that connects Claude Code with E2B cloud sandboxes, giving you isolated Linux VMs to work on any GitHub repository without touching your local machine.

What It Does

This server provides Claude Code with 29 tools to create cloud sandboxes, clone repos, run commands, manage files, and perform git operations — all in a secure, disposable Linux environment.

Your local machine stays untouched. Every operation happens inside an E2B sandbox VM.

Token Savings

Running commands through E2B sandboxes instead of local Bash reduces the tokens consumed per conversation. Tool outputs are structured and truncated (100KB per stream, 200KB total), so large build/test outputs don't flood your context window.

Project SizeExampleLocal Bash TokensE2B Sandbox TokensSavings
SmallExpress API, ~10 files~15K-25K~10K-18K~20-30%
MediumNext.js app, 50-100 files~50K-100K~25K-45K~40-55%
LargeMonorepo, 500+ files~200K-500K+~60K-120K~60-75%

Why it scales: A local npm install on a monorepo can dump 10K+ lines into context. A full test suite adds thousands more. With E2B, those outputs are capped and structured. Background processes (sandbox_exec_background) return only a process ID — zero streaming output. Directory listings are capped at 1000 entries. The result: your context window stays available for actual work instead of being consumed by terminal noise.

Use Cases

Work on Any GitHub Repo Remotely

Clone any repository into a sandbox, run its build and test suite, make changes, and push — without ever installing the project locally.

You: "Clone github.com/fastify/fastify, run the tests, and find why test X fails"

Claude Code:
  → sandbox_create
  → sandbox_git_clone "https://github.com/fastify/fastify"
  → sandbox_exec "npm install"
  → sandbox_exec "npm test"
  → sandbox_file_read (inspect failing test)
  → sandbox_file_write (apply fix)
  → sandbox_exec "npm test" (verify)

Safe Experimentation

Try risky changes — dependency upgrades, major refactors, migration scripts — in a throwaway environment. If it breaks, sandbox_kill and start fresh.

Persistent Development Sessions

Pause a sandbox when you're done for the day, resume it tomorrow with all your files and state intact. No more rebuilding environments from scratch.

You: "Pause this sandbox, I'll continue tomorrow"

Claude Code:
  → sandbox_pause (saves state)

Next day:
  → sandbox_resume (picks up where you left off)

Preview Dev Servers

Start a web app in a sandbox and get a public URL to preview it in your browser — no port forwarding or tunneling needed.

You: "Start the dev server and give me a URL to preview it"

Claude Code:
  → sandbox_exec_background "npm run dev"
  → sandbox_get_url 3000
  → Returns: https://abc123-3000.e2b.dev

Multi-Repo Parallel Work

Spin up multiple sandboxes, clone different repos, work on all of them simultaneously. Each sandbox is fully isolated.

Clean CI-Like Testing

Run your full test suite in a fresh Linux environment. Catch "works on my machine" issues before pushing to CI.

Open Source Contributions

Fork a repo, clone it in a sandbox, make your changes, commit, and push to your fork — all without local project setup.

Code Review in a Live Environment

Clone a PR branch into a sandbox, run the tests, inspect the changes, and verify the behavior — without checking out the branch locally.

Getting Started

Prerequisites

1. Register with Claude Code

No separate install needed — just point Claude Code at the npm package with npx:

claude mcp add e2b-sandbox -s user \
  -e E2B_API_KEY=your-e2b-api-key \
  -e GITHUB_TOKEN=your-github-token \
  -- npx -y e2b-sandbox-mcp

Restart Claude Code after adding the server.

Alternative: global install

If you prefer a global install instead of npx:

npm install -g e2b-sandbox-mcp

claude mcp add e2b-sandbox -s user \
  -e E2B_API_KEY=your-e2b-api-key \
  -e GITHUB_TOKEN=your-github-token \
  -- e2b-sandbox-mcp

2. Use It

Start Claude Code and ask it to work on any repo:

"Create a sandbox, clone https://github.com/expressjs/express, and run the test suite"

Claude Code will call the MCP tools automatically.

Available Tools

Sandbox Lifecycle

ToolDescription
sandbox_createCreate a new cloud sandbox (Linux VM)
sandbox_listList all active sandboxes
sandbox_infoGet details about a specific sandbox
sandbox_killTerminate and destroy a sandbox
sandbox_keep_aliveExtend a sandbox's timeout
sandbox_pausePause a sandbox, preserving its state for later
sandbox_resumeResume a previously paused sandbox

Networking & File Transfer

ToolDescription
sandbox_get_urlGet a public URL for a port (preview dev servers in browser)
sandbox_upload_urlGet a presigned URL to upload files to the sandbox
sandbox_download_urlGet a presigned URL to download files from the sandbox

Command Execution

ToolDescription
sandbox_execRun a shell command and get stdout/stderr/exit code
sandbox_exec_backgroundStart a background process (dev servers, watchers)
sandbox_process_listList all running processes with PIDs
sandbox_process_killKill a running process by PID

File Operations

ToolDescription
sandbox_file_readRead file contents
sandbox_file_writeWrite/create a file
sandbox_file_listList directory contents
sandbox_file_mkdirCreate a directory
sandbox_file_removeDelete a file or directory
sandbox_file_infoGet file metadata (size, type, permissions)
sandbox_file_existsCheck if a file or directory exists
sandbox_file_renameRename or move a file or directory

Git Operations

ToolDescription
sandbox_git_cloneClone a repository (supports private repos with GITHUB_TOKEN)
sandbox_git_statusGet working tree status
sandbox_git_commitStage files and commit
sandbox_git_pushPush commits to remote
sandbox_git_pullPull latest changes from remote
sandbox_git_branchList, create, or switch branches
sandbox_git_initInitialize a new git repository

Environment Variables

VariableRequiredDescription
E2B_API_KEYYesYour E2B API key from e2b.dev/dashboard
GITHUB_TOKENNoGitHub personal access token for private repo access and git push

Architecture

src/
ā”œā”€ā”€ index.ts                  # MCP server entry point (stdio transport)
ā”œā”€ā”€ types.ts                  # Shared types and error helpers
ā”œā”€ā”€ services/
│   └── sandbox-manager.ts    # Sandbox registry (tracks active VMs)
└── tools/
    ā”œā”€ā”€ sandbox.ts            # Lifecycle tools
    ā”œā”€ā”€ commands.ts           # Command execution tools
    ā”œā”€ā”€ filesystem.ts         # File operation tools
    └── git.ts                # Git operation tools

The server manages a registry of active sandbox instances. Each tool references sandboxes by ID, allowing concurrent work across multiple isolated environments.

Important Notes

  • Sandboxes are real VMs. Commands execute on actual Linux machines in E2B's cloud.
  • Git push is real. Pushing from a sandbox pushes to the actual remote repository.
  • Sandboxes auto-expire. Default timeout is 5 minutes. Use sandbox_keep_alive to extend.
  • E2B usage has costs. Check E2B pricing for details. Free tier is available.
  • Sandboxes are isolated from your machine, but not from the internet. Network requests, git pushes, and npm publishes are real.

License

MIT

Related MCP Servers

alfonsograziano/node-code-sandbox-mcp

šŸ“‡ šŸ  – A Node.js MCP server that spins up isolated Docker-based sandboxes for executing JavaScript snippets with on-the-fly npm dependency installation and clean teardown

šŸ‘Øā€šŸ’» Code Execution0 views
alvii147/piston-mcp

šŸ ā˜ļø 🐧 šŸŽ 🪟 - MCP server that lets LLMs execute code through the Piston remote code execution engine, with a zero-config uv setup and a ready-to-use Claude Desktop config example.

šŸ‘Øā€šŸ’» Code Execution0 views
ckanthony/openapi-mcp

šŸŽļø ā˜ļø - OpenAPI-MCP: Dockerized MCP Server to allow your AI agent to access any API with existing api docs.

šŸ‘Øā€šŸ’» Code Execution0 views
dagger/container-use

šŸŽļø šŸ  🐧 šŸŽ 🪟 - Containerized environments for coding agents. Multiple agents can work independently, isolated in fresh containers and git branches. No conflicts, many experiments. Full execution history, terminal access to agent environments, git workflow. Any agent/model/infra stack.

šŸ‘Øā€šŸ’» Code Execution0 views

Engagement

Views
0
Installs
0
Upvotes
0

Views and upvotes are unique per visitor network (hashed IP). Installs count copy actions.

Status

Health: Active

Recent health check succeeded.

Last checked: 7/28/2026, 4:50:53 PM

Unclaimed listing (imported or pending owner verification). Claim it →
ā˜… Spotlight Slot

Feature Your MCP Server

Get maximum visibility for your server across our directory, search results, and detail pages.

Spotlight Your Server

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to get the verified badge and attach your website.

Claim this listing

Promote this listing

Optional paid placement. Free listings stay free forever.

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.