# Sandbox as a Service [Health: Active]

**Category:** 👨‍💻 Code Execution  
**Repository:** https://github.com/fstandhartinger/sandbox-as-a-service-mcp  
**GitHub Stars:** 0  
**Views:** 5  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/sandbox-as-a-service

## Description
Give an agent a real Linux VM: run commands, move files, expose a preview URL, destroy it.

## Tools
Capabilities this server exposes over MCP:

- **create_sandbox** — Create an isolated cloud sandbox — a dedicated virtual machine you can run commands in. Returns once the sandbox is ready. Python 3, Node.js 22, git and a build toolchain are pre-installed. The sandbox is destroyed automatically after timeout_minutes; nothing inside it survives that. Use this before running any code you would not want to run on the local machine.
- **run_command** — Run a shell command inside a sandbox and wait for it to finish. Returns stdout, stderr and the exit code. The command runs as an unprivileged user in /workspace. A non-zero exit code is returned normally, not as an error. Use this to execute code, install packages, clone repositories or inspect the filesystem. To start something that keeps running (a web server), background it with `&` AND pass `cwd` instead of writing `cd ... &&` — a `&` after a `&&` list backgrounds a subshell that holds the output stream open, so the call waits out the whole timeout and returns exit_code 124. The process survives either way; only the waiting is wasted.
- **write_file** — Write a file inside a sandbox. Use this to place a script or input data before running it. Paths are relative to /workspace unless absolute. Content of any kind is safe — it is transferred verbatim, not interpreted by a shell.
- **read_file** — Read a file back out of a sandbox — an artifact your code produced, a log, a generated report. Use encoding "base64" for binary files such as images.
- **list_files** — List the contents of a directory in a sandbox, with the type and size of each entry. Defaults to /workspace. Use this to find what your code produced before reading it.
- **expose_port** — Give a server running inside the sandbox a public https URL, so a person can open it in a browser. Use this after starting a web server or dev server in the background with run_command (background it with `&` and pass `cwd` rather than `cd ... &&`). The server only needs to listen on localhost. Returns a URL that works until the sandbox is destroyed.
- **get_sandbox** — Get the current status and details of one sandbox, including when it expires.
- **list_sandboxes** — List the sandboxes on this account, newest first. Use it to find sandboxes you created earlier.
- **extend_sandbox** — Push a sandbox’s expiry further out so long-running work is not cut off. Total lifetime is still capped at 24 hours from creation.
- **destroy_sandbox** — Destroy a sandbox and stop billing for it. Everything inside is lost. Call this as soon as you are finished — do not leave sandboxes running.
- **get_usage** — Show the account’s remaining credit balance and recent sandbox usage.
- **get_service_info** — Describe this service: what a sandbox costs, which machine sizes exist, the account limits, and where to get an API key. Free — it never provisions anything and is not charged for. Every other tool here needs an API key and acts on the account that key belongs to.

## Claude Desktop Quick Installation
Remote MCP endpoint (confidence: high). Install path detected from listing signals. Add as a URL/SSE server in your client:

```json
"mcpServers": {
  "sandbox-as-a-service": {
    "url": "https://sandbox-as-a-service.com/v1/mcp"
  }
}
```

## Documentation

## What the Sandbox as a Service MCP server does

The Sandbox as a Service MCP server gives an AI agent access to dedicated Linux virtual machines. Each sandbox has its own kernel and is not reused between accounts. The service removes a sandbox when its lifetime expires, including cases where the agent does not explicitly destroy it.

Agents can create a VM, execute shell commands, write and read files, and inspect directory trees. They can also expose a port from the VM through a public HTTPS preview URL. Account and lifecycle operations include checking sandbox status, listing the account's sandboxes, extending expiry, destroying a sandbox, and checking remaining credit and recent usage.

## How it works

The Sandbox as a Service MCP server is available through a hosted Streamable HTTP endpoint at `https://sandbox-as-a-service.com/v1/mcp`. Requests can authenticate with either an `Authorization: Bearer` header or an `x-api-key` header. Anonymous initialization, tool discovery, and service information are available for hosted discovery, while account and execution operations require an API key.

A local stdio option runs through an npm package archive with `npx`. The hosted service exposes the eleven account and execution tools plus `get_service_info`; the local package exposes the eleven account and execution tools. The implementation uses MCP POST requests and SSE responses, so a GET-only request is not a connection test.

## Setup and configuration

Create an API key through the service dashboard, then provide it as `AAS_API_KEY`. For local use, run the package with `npx -y https://sandbox-as-a-service.com/mcp.tgz`. Claude Desktop and Claude Code can launch the same command through an MCP configuration with the key in the environment section.

`AAS_BASE_URL` is optional and defaults to `https://sandbox-as-a-service.com`. If changed, provide only the origin; the client adds the API prefix. Hosted clients should connect to the documented `/v1/mcp` endpoint and send the key per request.

## Tools and capabilities

The Sandbox as a Service MCP server provides tools for:

- Creating and destroying sandboxes.
- Running shell commands and receiving stdout, stderr, and exit status.
- Writing files without routing their content through command-line quoting.
- Reading files and listing directory trees.
- Publishing a sandbox port through an HTTPS preview URL.
- Reading status, size, and expiry information.
- Listing account sandboxes and extending their expiry.
- Checking remaining credit and recent usage.

## Limitations and notes

Commands run as an unprivileged user. `sudo` is unavailable, so `apt-get` cannot be used. The README identifies `pip install --user --break-system-packages` and `npm install` as alternatives.

`run_command` waits for the command to finish. A server started without backgrounding may keep the MCP call open until the command times out; use `&` when starting a long-running service. Expiry is automatic, but calling `destroy_sandbox` earlier stops billing and returns unused minutes that would otherwise not be used.

_Full upstream README: https://allmcps.com/mcp/sandbox-as-a-service/readme_

