Skip to content

Vercel Sandbox commands can now take live stdin input

A new opt-in stdin flag lets commands running inside a Vercel Sandbox stay open and keep receiving input, so a stdio MCP server can run once and serve every tool call.

Source: Vercel

Vercel announced on 26 October that commands run inside a Vercel Sandbox can now accept standard input while they are running. Before this, a sandboxed command ran to completion on its own; there was no way to feed it more data after it started, which ruled out anything built around a long-running stdin/stdout loop.

In the TypeScript SDK, set stdin: true and detached: true on runCommand(), then call writeStdin() to send data and closeStdin() to end the stream, or pass a Node.js readable stream such as process.stdin directly. The Python SDK uses stdin=subprocess.PIPE with server.stdin.send(), and communicate() to close the stream and collect what is left. Vercel’s own example is agent-browser, a stdio MCP server: with this change, one instance can stay alive inside a sandbox and answer every tool call, instead of a fresh process starting for each one.

const cmd = await sandbox.runCommand({
  cmd: 'agent-browser',
  stdin: true,
  detached: true,
})
cmd.writeStdin('...')
cmd.closeStdin()

Why it matters: stdio is how most MCP servers talk to their clients, so running one per sandbox call was wasteful and slow. Anyone running MCP tools or other stateful CLIs inside Vercel Sandbox can now keep a single process alive for the sandbox’s lifetime instead of paying startup cost on every call.

Share

Related reading

More from The Wire

All briefs