● Works today
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
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.
YOUR APP
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.
POST /v1/secrets
{"name": "github", "type": "http_header",
"value": "ghp_…",
"allowed_hosts": ["api.github.com"],
"env": "GITHUB_TOKEN"}SPAWNBOX API
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.
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}
}]}YOUR APP
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.
GET /v1/sandboxes/$S/ports{"mcpServers": {"github": {
"url": "https://{label}.preview.example.com/mcp",
"headers": {"Authorization": "Bearer <read-only key>"}
}}}IN THE SANDBOX
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.
{"jsonrpc": "2.0", "id": 7,
"method": "tools/call",
"params": {"name": "list_issues",
"arguments": {"repo": "acme/api"}}}IN THE SANDBOX
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.
SPAWNBOX API
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.
GET /v1/sandboxes/$S/services/mcp/logs?follow=true