SPAWNBOX

● Works today

Run MCP servers you did not write.Each one in its own sandbox.

An MCP server runs someone else's code with your tokens. Run each one in its own microVM. Its tokens stay outside, it can reach only the hosts you list, and every connection it makes is logged.

Servers that speak Streamable HTTP, in any language

  • MCP
  • TypeScript
  • Node.js
  • Python
  • Go
  • Rust
MCP CLIENTSANDBOXnode server.jsSPAWNBOX APIKEYS · SITE RULESYOUR SERVER
FIG. 02 · ONE REQUEST, THERE AND BACK
0102

Follow one request.

Each step shows the call, the reply and the lines it adds to the activity log. You can read the whole log withGET /v1/sandboxes/$S/events.

  1. YOUR APP

    Save the token that the server needs

    This server calls the GitHub API. Save the token in Spawnbox, not in the server's settings. Inside the sandbox, $GITHUB_TOKEN holds only a placeholder.

    REQUEST
    POST /v1/secrets
    
    {"name": "github", "type": "http_header",
     "value": "ghp_…",
     "allowed_hosts": ["api.github.com"],
     "env": "GITHUB_TOKEN"}
  2. SPAWNBOX API

    Start the server as a service

    mcp-github is a template you build once, with the server's code in /workspace/mcp. Spawnbox keeps the server running, checks its port and starts it again if it stops. This sandbox can reach api.github.com and no other site.

    REQUEST
    POST /v1/sandboxes
    
    {"template": "mcp-github",
     "secrets": ["github"],
     "egress": {"mode": "allowlist",
                "allow": ["api.github.com"]},
     "services": [{
       "name": "mcp",
       "command": ["node", "server.js"],
       "cwd": "/workspace/mcp",
       "port": 8000,
       "access": "private",
       "health": {"tcp": true}
     }]}
    • sandbox.createdsbx_4kq2m8wd0xjr7n1p
    • service.startedmcp
  3. YOUR APP

    Point your MCP client at it

    The service's port gets a private preview URL. Give it to your agent's MCP client with an API key that has only the sandboxes:read scope. Spawnbox checks the key and removes it before the request reaches the server. The server must use the Streamable HTTP transport.

    REQUEST
    GET /v1/sandboxes/$S/ports
    MCP CLIENT SETTINGS
    {"mcpServers": {"github": {
      "url": "https://{label}.preview.example.com/mcp",
      "headers": {"Authorization": "Bearer <read-only key>"}
    }}}
  4. IN THE SANDBOX

    Your agent calls a tool

    The call goes through the preview URL to the server. The server calls GitHub with the placeholder. On the way out, Spawnbox puts in the real token.

    MCP REQUEST
    {"jsonrpc": "2.0", "id": 7,
     "method": "tools/call",
     "params": {"name": "list_issues",
                "arguments": {"repo": "acme/api"}}}
    • net.dnsapi.github.com
    • net.connectionapi.github.com:443
    • secret.injectedapi.github.com
  5. IN THE SANDBOX

    It tries to send data somewhere else

    A bad or hacked server can try to post your data to a different host. The DNS answer is REFUSED. A connection to a raw IP address is blocked too. Both go in the log.

    • net.dnspaste.example.net · REFUSED
    • net.blocked203.0.113.9:443
  6. SPAWNBOX API

    It crashes and comes back

    Spawnbox starts the server again after 1 s, then 2 s and 4 s, up to 30 s. The last 1 MiB of its output stays in its log.

    REQUEST
    GET /v1/sandboxes/$S/services/mcp/logs?follow=true
    • service.exitedmcp · code 1
    • service.restartedmcp · exit
0202

Good to know.