e2b-sandbox-mcp
E2B Sandbox MCP-Server
Ein MCP-Server (Model Context Protocol), der Claude Code mit E2B-Cloud-Sandboxes verbindet und Ihnen isolierte Linux-VMs zur Verfügung stellt, um an jedem beliebigen GitHub-Repository zu arbeiten, ohne Ihren lokalen Rechner zu belasten.
Was er bewirkt
Dieser Server stellt Claude Code 29 Tools zur Verfügung, um Cloud-Sandboxes zu erstellen, Repos zu klonen, Befehle auszuführen, Dateien zu verwalten und Git-Operationen durchzuführen – alles in einer sicheren, temporären Linux-Umgebung.
Ihr lokaler Rechner bleibt unberührt. Jeder Vorgang findet innerhalb einer E2B-Sandbox-VM statt.
Related MCP server: codex-cli-mcp-tool
Token-Einsparungen
Das Ausführen von Befehlen über E2B-Sandboxes anstelle der lokalen Bash reduziert die pro Konversation verbrauchten Token. Tool-Ausgaben sind strukturiert und gekürzt (100 KB pro Stream, 200 KB insgesamt), sodass große Build-/Test-Ausgaben Ihr Kontextfenster nicht überfluten.
Projektgröße | Beispiel | Lokale Bash-Token | E2B-Sandbox-Token | Einsparung |
Klein | Express API, ~10 Dateien | ~15K-25K | ~10K-18K | ~20-30% |
Mittel | Next.js App, 50-100 Dateien | ~50K-100K | ~25K-45K | ~40-55% |
Groß | Monorepo, 500+ Dateien | ~200K-500K+ | ~60K-120K | ~60-75% |
Warum es skaliert: Ein lokales npm install in einem Monorepo kann über 10.000 Zeilen in den Kontext schreiben. Eine vollständige Test-Suite fügt Tausende weitere hinzu. Mit E2B sind diese Ausgaben begrenzt und strukturiert. Hintergrundprozesse (sandbox_exec_background) geben nur eine Prozess-ID zurück – keine Streaming-Ausgabe. Verzeichnisauflistungen sind auf 1000 Einträge begrenzt. Das Ergebnis: Ihr Kontextfenster bleibt für die eigentliche Arbeit verfügbar, anstatt durch Terminal-Rauschen verbraucht zu werden.
Anwendungsfälle
Arbeiten an jedem GitHub-Repo aus der Ferne
Klonen Sie jedes Repository in eine Sandbox, führen Sie dessen Build- und Test-Suite aus, nehmen Sie Änderungen vor und pushen Sie diese – ohne das Projekt jemals lokal installieren zu müssen.
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)Sicheres Experimentieren
Probieren Sie riskante Änderungen aus – Abhängigkeits-Upgrades, größere Refactorings, Migrationsskripte – in einer Wegwerf-Umgebung. Wenn etwas kaputt geht, führen Sie sandbox_kill aus und fangen Sie von vorne an.
Persistente Entwicklungssitzungen
Halten Sie eine Sandbox an, wenn Sie für den Tag fertig sind, und setzen Sie sie am nächsten Tag mit all Ihren Dateien und dem Status intakt fort. Kein mühsames Neuerstellen von Umgebungen von Grund auf mehr.
You: "Pause this sandbox, I'll continue tomorrow"
Claude Code:
→ sandbox_pause (saves state)
Next day:
→ sandbox_resume (picks up where you left off)Vorschau von Dev-Servern
Starten Sie eine Web-App in einer Sandbox und erhalten Sie eine öffentliche URL, um sie in Ihrem Browser in der Vorschau anzuzeigen – keine Portweiterleitung oder Tunneling erforderlich.
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.devParalleles Arbeiten an mehreren Repos
Starten Sie mehrere Sandboxes, klonen Sie verschiedene Repos und arbeiten Sie gleichzeitig an allen. Jede Sandbox ist vollständig isoliert.
Saubere CI-ähnliche Tests
Führen Sie Ihre vollständige Test-Suite in einer frischen Linux-Umgebung aus. Finden Sie "funktioniert auf meinem Rechner"-Probleme, bevor Sie sie in die CI pushen.
Open-Source-Beiträge
Forken Sie ein Repo, klonen Sie es in einer Sandbox, nehmen Sie Ihre Änderungen vor, committen Sie und pushen Sie auf Ihren Fork – alles ohne lokale Projekteinrichtung.
Code-Review in einer Live-Umgebung
Klonen Sie einen PR-Branch in eine Sandbox, führen Sie die Tests aus, untersuchen Sie die Änderungen und überprüfen Sie das Verhalten – ohne den Branch lokal auszuchecken.
Erste Schritte
Voraussetzungen
Node.js >= 18
Claude Code CLI installiert
E2B API-Schlüssel (kostenlose Stufe verfügbar)
GitHub Personal Access Token (optional, für private Repos und Push)
1. Registrierung bei Claude Code
Keine separate Installation erforderlich – verweisen Sie Claude Code einfach mit npx auf das npm-Paket:
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-mcpStarten Sie Claude Code nach dem Hinzufügen des Servers neu.
Wenn Sie eine globale Installation anstelle von npx bevorzugen:
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-mcp2. Verwendung
Starten Sie Claude Code und bitten Sie es, an einem beliebigen Repo zu arbeiten:
"Erstelle eine Sandbox, klone https://github.com/expressjs/express und führe die Test-Suite aus"
Claude Code ruft die MCP-Tools automatisch auf.
Verfügbare Tools
Sandbox-Lebenszyklus
Tool | Beschreibung |
| Erstellt eine neue Cloud-Sandbox (Linux-VM) |
| Listet alle aktiven Sandboxes auf |
| Ruft Details zu einer bestimmten Sandbox ab |
| Beendet und zerstört eine Sandbox |
| Verlängert das Timeout einer Sandbox |
| Hält eine Sandbox an und bewahrt ihren Status für später |
| Setzt eine zuvor angehaltene Sandbox fort |
Netzwerk & Dateiübertragung
Tool | Beschreibung |
| Ruft eine öffentliche URL für einen Port ab (Vorschau von Dev-Servern im Browser) |
| Ruft eine vorsignierte URL zum Hochladen von Dateien in die Sandbox ab |
| Ruft eine vorsignierte URL zum Herunterladen von Dateien aus der Sandbox ab |
Befehlsausführung
Tool | Beschreibung |
| Führt einen Shell-Befehl aus und gibt stdout/stderr/Exit-Code zurück |
| Startet einen Hintergrundprozess (Dev-Server, Watcher) |
| Listet alle laufenden Prozesse mit PIDs auf |
| Beendet einen laufenden Prozess per PID |
Dateioperationen
Tool | Beschreibung |
| Liest Dateiinhalt |
| Schreibt/erstellt eine Datei |
| Listet Verzeichnisinhalt auf |
| Erstellt ein Verzeichnis |
| Löscht eine Datei oder ein Verzeichnis |
| Ruft Dateimetadaten ab (Größe, Typ, Berechtigungen) |
| Überprüft, ob eine Datei oder ein Verzeichnis existiert |
| Benennt eine Datei oder ein Verzeichnis um oder verschiebt sie |
Git-Operationen
Tool | Beschreibung |
| Klonen eines Repositorys (unterstützt private Repos mit GITHUB_TOKEN) |
| Ruft den Status des Arbeitsbaums ab |
| Staged Dateien und committet |
| Pusht Commits auf das Remote-Repository |
| Pullt die neuesten Änderungen vom Remote-Repository |
| Listet Branches auf, erstellt oder wechselt sie |
| Initialisiert ein neues Git-Repository |
Umgebungsvariablen
Variable | Erforderlich | Beschreibung |
| Ja | Ihr E2B API-Schlüssel von e2b.dev/dashboard |
| Nein | GitHub Personal Access Token für den Zugriff auf private Repos und |
Architektur
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 toolsDer Server verwaltet eine Registrierung aktiver Sandbox-Instanzen. Jedes Tool referenziert Sandboxes über eine ID, was gleichzeitiges Arbeiten in mehreren isolierten Umgebungen ermöglicht.
Wichtige Hinweise
Sandboxes sind echte VMs. Befehle werden auf tatsächlichen Linux-Maschinen in der E2B-Cloud ausgeführt.
Git Push ist echt. Ein Push aus einer Sandbox erfolgt auf das tatsächliche Remote-Repository.
Sandboxes laufen automatisch ab. Das Standard-Timeout beträgt 5 Minuten. Verwenden Sie
sandbox_keep_alivezur Verlängerung.E2B-Nutzung verursacht Kosten. Überprüfen Sie die E2B-Preise für Details. Eine kostenlose Stufe ist verfügbar.
Sandboxes sind von Ihrem Rechner isoliert, aber nicht vom Internet. Netzwerkanfragen, Git-Pushes und npm-Publishes sind echt.
Lizenz
MIT
Available Tools
29 toolssandbox_createA
Create a new E2B cloud sandbox (secure Linux VM). Returns a sandboxId to use with other tools.
Inputs: templateId, timeoutMs, metadata.
sandbox_download_urlA
Get a presigned URL to download a file from the sandbox. Use this to retrieve build artifacts, logs, or any file from the sandbox.
Inputs: sandboxId (required), path (required).
sandbox_execA
Execute a shell command in a sandbox and return stdout, stderr, and exit code. Use for running builds, tests, installs, or any CLI command.
Inputs: sandboxId (required), command (required), cwd, timeoutMs, +1 more.
sandbox_exec_backgroundA
Start a background process in a sandbox (e.g., dev server, file watcher). Returns immediately without waiting for completion.
Inputs: sandboxId (required), command (required), cwd, envs.
sandbox_file_existsA
Check if a file or directory exists in a sandbox. Returns true/false without throwing an error if not found.
Inputs: sandboxId (required), path (required).
sandbox_file_infoA
Get metadata about a file or directory in a sandbox (size, type, permissions).
Inputs: sandboxId (required), path (required).
sandbox_file_listC
List files and directories in a sandbox path.
Inputs: sandboxId (required), path.
sandbox_file_mkdirB
Create a directory (and parent directories) in a sandbox.
Inputs: sandboxId (required), path (required).
sandbox_file_readB
Read the contents of a file in a sandbox.
Inputs: sandboxId (required), path (required).
sandbox_file_removeC
Delete a file or directory in a sandbox.
Inputs: sandboxId (required), path (required).
sandbox_file_renameC
Rename or move a file or directory in a sandbox.
Inputs: sandboxId (required), oldPath (required), newPath (required).
sandbox_file_writeA
Write content to a file in a sandbox. Creates parent directories automatically. Overwrites if file exists.
Inputs: sandboxId (required), path (required), content (required).
sandbox_get_urlA
Get the public URL for a port running inside a sandbox. Use this to access dev servers, web apps, or any HTTP service running in the sandbox from a browser.
Inputs: sandboxId (required), port (required).
sandbox_git_branchB
Manage git branches: list, create, or switch branches in a sandbox repository.
Inputs: sandboxId (required), repoPath (required), action (required), branchName.
sandbox_git_cloneA
Clone a GitHub repository into a sandbox. Supports private repos when GITHUB_TOKEN is configured.
Inputs: sandboxId (required), repoUrl (required), path, branch, +1 more.
sandbox_git_commitB
Stage files and create a git commit in a sandbox repository.
Inputs: sandboxId (required), repoPath (required), message (required), files, +2 more.
sandbox_git_initB
Initialize a new git repository in a sandbox directory.
Inputs: sandboxId (required), path (required).
sandbox_git_pullC
Pull latest changes from a remote repository in a sandbox.
Inputs: sandboxId (required), repoPath (required), remote, branch.
sandbox_git_pushA
Push commits to a remote repository. Requires GITHUB_TOKEN for authentication.
Inputs: sandboxId (required), repoPath (required), remote, branch, +1 more.
sandbox_git_statusA
Get the git status of a repository in a sandbox (current branch, modified/staged/untracked files).
Inputs: sandboxId (required), repoPath (required).
sandbox_infoC
Get details about a specific sandbox.
Inputs: sandboxId (required).
sandbox_keep_aliveA
Extend a sandbox timeout to prevent it from being automatically terminated.
Inputs: sandboxId (required), timeoutMs (required).
sandbox_killA
Terminate and clean up a sandbox. The sandbox and all its data will be destroyed.
Inputs: sandboxId (required).
sandbox_listA
List all active E2B sandboxes managed by this server.
Inputs: no named parameters.
sandbox_pauseA
Pause a sandbox to preserve its state. The sandbox can be resumed later with sandbox_resume using the same sandbox ID. Paused sandboxes persist across sessions and do not count against timeout.
Inputs: sandboxId (required).
sandbox_process_killA
Kill a running process in a sandbox by its PID. Use sandbox_process_list to find the PID.
Inputs: sandboxId (required), pid (required).
sandbox_process_listA
List all running processes (commands and PTY sessions) in a sandbox. Shows PID, command, and arguments for each process.
Inputs: sandboxId (required).
sandbox_resumeA
Resume a previously paused sandbox. Reconnects to the sandbox and restores its state including filesystem and running processes.
Inputs: sandboxId (required), timeoutMs.
sandbox_upload_urlA
Get a presigned URL to upload a file to the sandbox. Send a POST request with the file as multipart/form-data to the returned URL.
Inputs: sandboxId (required), path.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 29 tools
Each tool targets a distinct operation on sandboxes (create, exec, file ops, git, lifecycle management, process control). No overlapping purposes; even similar operations like sandbox_exec vs sandbox_exec_background are clearly differentiated by synchronous vs background execution.
All tools follow the consistent pattern of `sandbox_<action>`, using snake_case. Actions are clear verbs (create, exec, list, kill, etc.). This provides a predictable and intuitive naming scheme.
29 tools is on the higher side but justified by the broad scope of sandbox management (execution, file system, git, process management, lifecycle). The count is reasonable for a comprehensive server, though could be slightly trimmed by merging some rare operations.
The tool set covers the full lifecycle of sandboxes: create, list, info, keep-alive, pause/resume, kill. It includes file operations (CRUD), execution (command + background), process management, git operations (init, clone, branch, status, commit, pull, push), and utilities like download/upload URLs. No obvious gaps for typical sandbox usage.
Maintenance
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Hosted YouTube MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server that spawns autonomous Claude Code agents in GitHub repos, enabling task delegation with persistent state, multi-step workflows, and job monitoring.47161 npm2Apache 2.0
- AlicenseNot gradedqualityDmaintenanceAn MCP server that allows Claude Code to interact with the OpenAI Codex CLI.50 npm20MIT
- AlicenseAqualityDmaintenanceAn MCP server that gives Claude live access to your GitHub workspace — PR reviews, issue triaging, repo search, and weekly digest reports through natural language.7MIT
- AlicenseNot gradedqualityCmaintenanceA self-hosted MCP server that gives Claude access to your GitHub account — read files, browse repos, commit changes, and manage issues and pull requests, all from a conversation.330 npmISC