deniz.in

Markets

Weather

Loading weather

· via Vercel blog

Vercel Sandbox adds stdin support for interactive commands and stdio MCP servers

Vercel Sandbox commands can now receive data over stdin, letting developers talk to stdio MCP servers such as agent-browser and feed other interactive CLI programs as they run.

Vercel Sandbox adds stdin support for interactive commands and stdio MCP servers

Vercel has added standard input support to Sandbox commands, according to a post on the Vercel blog. Processes running inside a Vercel Sandbox can now accept data while they execute, which opens the door to two-way communication with stdio-based Model Context Protocol (MCP) servers — agent-browser is cited as one example — and with any other command-line program that expects input on an ongoing basis rather than all at once.

How the TypeScript SDK handles it

In the TypeScript SDK, a command launched through runCommand() opts into the feature with two settings: stdin set to true and detached set to true. Once the command is up and running, writeStdin() pushes data into the process, and closeStdin() signals that no further input will arrive. The caller can then wait for the command to finish and read whatever the process wrote out.

Vercel's changelog demonstrates the pattern with the cat utility: the string "hello" is written to the running command's input, the input is closed, and the same value comes back when the command's output is read.

There is also a streaming variant. Instead of a plain value, stdin can be pointed at a Node.js readable stream such as process.stdin. The SDK then relays everything the stream produces and closes the command's input automatically once the stream ends.

The Python SDK takes the subprocess route

The Python SDK leans on conventions that will feel familiar to anyone who has used the standard library's subprocess module. A process is created with stdin=subprocess.PIPE, input is delivered through server.stdin.send(), and a call to communicate() closes the input pipe, gathers whatever output is still pending, and blocks until the process exits.

For simpler commands that consume all of their input up front, Vercel notes that Python users can skip the manual plumbing and hand the input directly to run_process().

Why it matters

The inability to write to a running process's input has been a real constraint for agent workloads. A meaningful slice of the MCP ecosystem — including browser-automation servers — is built as local processes that sit waiting for messages on stdin, so a sandbox that could only start a command and read its output could never actually host one. With this change, an agent running inside a Vercel Sandbox can drive a stdio MCP server end to end: launch it, send protocol messages as needed, and read the responses, all inside the same isolated cloud environment.

The same mechanics benefit ordinary interactive tooling — REPLs, prompts, long-running pipelines — that previously would have been impossible to operate from a sandboxed command. Both the TypeScript and Python SDKs are covered, and Vercel points readers to the Sandbox documentation for full details on getting started.

  • #vercel
  • #cloud
  • #mcp
  • #developer-tools
  • #sdk

Related posts