neu-sandbox-mcp
OfficialClick on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@neu-sandbox-mcp Start a Python sandbox, install pandas, and run my script."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
neu-sandbox-mcp
An MCP server that gives an agent remote sandboxes: start a container from an image, run commands in it, read and write its files, reach the servers it runs, and shut it down.
Why
One set of tools across backends. Prompts and skills keep the same tool names and outputs when sandboxes move to another backend. Each backend is a small adapter behind one interface.
Backends differ, and the tools say so. Sandbox services vary a lot: some take any image and some need it registered first, some keep a background command's output and some only stream it, some previews are public and some need a token. Each backend declares what it supports, and only the tools it can really serve are registered, with descriptions that match. Nothing missing is faked.
Credentials stay on the server. The backend token never enters the agent's context.
Safe to share between tenants. A scope confines every tool to the sandboxes tagged for one tenant, even when tenants share the backend's credentials.
Related MCP server: sandbox-as-a-service-mcp
Tools
The base tools are always there. The rest appear when the backend supports them.
Tool | What it does | Needs |
| Starts a sandbox from an image. Takes | — |
| Lists sandboxes in scope. | — |
| Destroys a sandbox. | — |
| Runs a shell command and waits for it. With |
|
| Reads a text file, optionally a line range. | — |
| Writes text files, creating parent directories. | — |
| Pushes the expiry further out. | renew |
| Whether a background command is still running, and its exit code. | background output kept ( |
| A background command's output: in increments from a cursor, or its latest tail. | background output kept ( |
| Stops a background command. | interrupt |
| Lists a directory, with entry types. | directory listing |
| Finds files by glob on the name. | file search |
| Replaces text in files, reporting a count per file. | replace |
| File management. | each its own |
| A URL that reaches a port inside the sandbox. | a |
Backends
Backend | Image | Timeout (default / max) | Background output | Preview | Metadata | Renew | List dir | Search | Replace |
any, entrypoint override | 1 hour / none | cursor | public (when configured) | ✅ | ✅ | ✅ | ✅ | ✅ |
More backends are planned. See Adding a backend.
Capabilities
A backend declares, in capabilities, the form its create and lifecycle take:
Capability | Values |
|
|
|
|
|
|
|
|
| Sandboxes can be tagged and listed by tag. Required for a scope. |
Everything else is an optional member of the provider, present only when the backend has it. A member that comes in several forms carries its kind:
Member |
|
|
|
|
|
renew, commands.interrupt and each file operation beyond read and write are simply present or absent.
Sandbox status is one of creating, running, paused, stopped, failed or unknown; each backend maps its own states onto these.
Run it as a server
Requires Node.js 22 or newer. The server speaks MCP over stdio.
{
"mcpServers": {
"sandbox": {
"command": "npx",
"args": ["-y", "neu-sandbox-mcp"],
"env": {
"NEU_SANDBOX_BACKEND": "nap",
"NAP_SANDBOX_URL": "https://sandbox.example.com",
"NAP_SANDBOX_TOKEN": "<token>",
"NAP_SANDBOX_PUBLIC_URL": "https://sandbox.example.com"
}
}
}
}NEU_SANDBOX_BACKEND picks the backend and defaults to nap. Each backend then reads its own variables.
nap
Variable | Meaning |
| Base URL of the sandbox service API. Required. |
| Bearer token for the sandbox service. Required. |
| Public URL of the sandbox service, whose host fronts the preview subdomains ( |
Use it as a library
To add the tools to an MCP server you already run, register them on it:
import { McpServer } from '@modelcontextprotocol/server'
import { createNapProvider, registerSandboxTools } from 'neu-sandbox-mcp'
const server = new McpServer({ name: 'my-server', version: '1.0.0' })
registerSandboxTools(server, {
provider: createNapProvider({
baseUrl: 'http://sandbox.internal:3006',
previewBaseUrl: 'https://sandbox.example.com',
token: async () => lookUpTokenFor(tenant),
}),
scope: { tenant_id: tenant.id },
})The server can come from either generation of the MCP TypeScript SDK: @modelcontextprotocol/server (v2) or @modelcontextprotocol/sdk (v1).
scope is a set of tags that confines the tools to one tenant. Every sandbox they create carries the tags, list_sandboxes returns only sandboxes that carry them, and a tool given a sandbox ID refuses it unless that sandbox carries them.
registerSandboxTools returns the provider the tools act through, already confined to the scope, so tools you add yourself get the same confinement. The provider is also usable on its own, for example behind your own REST API: wrap it with scopeProvider(provider, scope), and calls on an out-of-scope ID throw SandboxNotFoundError. unsupportedCreateOptions(provider.capabilities, opts) names create options the backend cannot honour, so your API can refuse them.
To pick the backend from the environment, the way the standalone server does, use providerFromEnv(process.env).
License
Available Tools
17 toolscreate_sandboxCreate SandboxA
Create an isolated sandbox environment with a specified container image. Returns a sandbox_id for use with other sandbox tools. The sandbox auto-expires after the timeout (default 1 hour). Extend it with sandbox_renew. For coding tasks (e.g. git clone, npm install, dev server), use a longer timeout like 21600 (6h) or 86400 (24h) and higher resources (cpu: "2", memory: "4Gi").
Inputs: image (required), env, resource, timeout_seconds, +1 more.
kill_sandboxKill SandboxA
Stop and destroy a sandbox. All data inside the sandbox will be lost.
Inputs: sandbox_id (required).
list_sandboxesList SandboxesB
List all sandboxes.
Inputs: no named parameters.
sandbox_create_directoriesCreate Directories in SandboxA
Create directories. Not needed before sandbox_write_files, which creates parents on its own.
Inputs: paths (required), sandbox_id (required).
sandbox_delete_directoriesDelete Directories from SandboxC
Delete directories and everything inside them.
Inputs: paths (required), sandbox_id (required).
sandbox_delete_filesDelete Files from SandboxA
Delete one or more files. For directories use sandbox_delete_directories.
Inputs: paths (required), sandbox_id (required).
sandbox_get_command_logsGet Background Command LogsA
Fetch output from a background command. Returns { content, cursor }. Pass the cursor back on the next call to get only what was written since — polling from cursor 0 every time re-reads the whole log and will eventually blow past the tool output limit.
Inputs: command_id (required), sandbox_id (required), cursor.
sandbox_get_command_statusGet Background Command StatusB
Check whether a background command is still running. Returns running, exit_code, and timing.
Inputs: command_id (required), sandbox_id (required).
sandbox_interrupt_commandInterrupt CommandA
Stop a running background command. The command ends with a non-zero exit code.
Inputs: command_id (required), sandbox_id (required).
sandbox_list_directoryList Sandbox DirectoryA
List a directory inside a sandbox. Each entry carries a type (file / directory / symlink). Use depth to walk subdirectories. To find a file by name rather than list a directory, use sandbox_search_files.
Inputs: path (required), sandbox_id (required), depth.
sandbox_move_filesMove or Rename Files in SandboxB
Move or rename files and directories inside a sandbox.
Inputs: entries (required), sandbox_id (required).
sandbox_read_fileRead File from SandboxA
Read the contents of a file inside a sandbox. Reads the whole file by default. For a large file, page through it with offset/limit instead — an oversized read gets truncated on the way back to you, and you will not be told where it was cut.
Inputs: path (required), sandbox_id (required), limit, offset.
sandbox_renewRenew SandboxA
Extend a sandbox expiry. Use this instead of creating a replacement when a task runs longer than the original timeout.
Inputs: sandbox_id (required), extend_seconds (required).
sandbox_replace_contentsReplace Text in Sandbox FilesA
Replace text inside files, editing in place instead of rewriting the whole file. Returns a replaced_count per file — 0 means the old text was not found, so check it rather than assuming the edit landed. If detail_available is false the sandbox runtime is too old to report counts: the replacement still happened, but you have to read the file back to confirm what changed.
Inputs: entries (required), sandbox_id (required).
sandbox_run_commandRun Command in SandboxA
Execute a shell command inside a sandbox. Returns stdout, stderr, exit_code, and execution_time_ms. By default this blocks until the command exits. For anything long-running (dev servers, builds, watchers) pass background: true — it returns a command_id immediately. Follow it with sandbox_get_command_logs / sandbox_get_command_status and stop it with sandbox_interrupt_command.
Inputs: command (required), sandbox_id (required), cwd, env, +2 more.
sandbox_search_filesSearch Files in SandboxB
Find files under a directory by glob pattern (e.g. "*.py"). Returns a flat list.
Inputs: path (required), sandbox_id (required), pattern.
sandbox_write_filesWrite Files to SandboxC
Write one or more files inside a sandbox. Creates parent directories automatically.
Inputs: files (required), sandbox_id (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Each tool targets a distinct resource+action, and the descriptions actively disambiguate the risky pairs (delete_files vs delete_directories, create_directories vs write_files, sandbox_list_directory vs sandbox_search_files). Minor residual overlap between list_sandboxes and sandbox_list_directory, and between renew and create, but both are clarified in the text. An agent can select correctly without guessing.
14 of 17 tools follow a clear sandbox_<verb>_<noun> pattern (sandbox_read_file, sandbox_move_files, sandbox_delete_directories). The lifecycle trio (list_sandboxes, create_sandbox, kill_sandbox) drops the prefix and inverts to verb_noun, which is a systematic but noticeable deviation. Still highly readable with no chaotic mixing.
17 tools is at the upper edge of comfortable but each one maps to a real capability gap in a sandbox runtime: lifecycle, command execution/streaming, and file operations. Nothing looks like a redundant alias. Slightly heavy, but no obvious removal candidate.
Coverage is strong for the domain: create/list/renew/kill lifecycle, blocking and background command execution with status, cursor-based logs, and interrupt, plus a full file surface (read, write, replace, move, search, list, delete files and directories). Small gaps remain — no single-sandbox detail/inspect call, no host-to-sandbox upload/download, and no permission or attr operations — but agents can work around these via run_command.
Maintenance
Related MCP Connectors
Start, pause, resume, and run commands and file operations in Linux sandboxes.
Run commands, code and file operations for AI agents in Cloud Hypervisor microVM sandboxes.
1Secure Linux sandboxes for AI agents, as MCP tools.
Execution platform for AI agents on Firecracker microVMs in the EU. Interactive Linux sandboxes with root, templates for Python, Node.js, Go, Rust and a headless browser, public HTTPS URLs. Background jobs that outlive the connection, batches of up to 1,000 jobs with dependencies, hard cost caps reserved up front, execution receipts with SHA-256, log digests that fit the context. IPv4, dual-stack or IPv6-only with its own public address, allowlists or no network. WASI runtime for small tasks. Idle sandboxes sleep and keep their files. Also REST API, Python SDK and LangChain.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides a restricted Docker-based sandbox for LLM agents, enabling file operations, command execution, and local Git within an isolated runtime.18 npmMIT
- AlicenseAqualityCmaintenanceProvides agents with real Linux VMs to run commands, manage files, expose ports, and track costs, all through an ephemeral sandbox service.11MIT
- AlicenseAqualityBmaintenanceEnables AI coding agents to safely run commands, install dependencies, test, and modify code inside disposable, policy-enforced Docker sandboxes isolated from the host, returning results and diffs.15MIT
- AlicenseAqualityBmaintenanceProvides secure, disposable, resource-bounded container sandboxes that let AI agents create and inspect files, run shell commands with timeouts, and perform Git operations without exposing the host environment.11MIT