Vercel Sandbox commands can now receive input through stdin

Vercel Sandbox now supports standard input (stdin) for running commands, so developers can send data to a process while it is still running. According to Vercel, the feature can be used to exchange messages with stdio MCP servers such as agent-browser, or to feed data to other command-line programs.
- Vercel Sandbox commands can now receive input through standard input (stdin) while running.
- Vercel says the feature works with stdio MCP servers such as agent-browser and other command-line programs.
- In TypeScript, set stdin: true and detached: true in runCommand(), then use writeStdin() and closeStdin().
- In Python, set stdin=subprocess.PIPE, send data with server.stdin.send() and call communicate() to close stdin.
- A Node.js readable stream such as process.stdin can also be passed as stdin in the TypeScript SDK.
What the stdin support does
Until now, a command started in a Vercel Sandbox could not be fed new input once it was running. With the update, developers can write to a running command's standard input and read what it produces. Vercel says this works for stdio MCP servers such as agent-browser, which communicate over standard input and output, as well as for other command-line programs that expect data while they run.
The change is available in both the TypeScript and Python SDKs, with slightly different interfaces in each.
How it works in the TypeScript SDK
In the TypeScript SDK, developers set stdin: true and detached: true in runCommand(). They then call writeStdin() to send input and closeStdin() when they are finished.
Vercel's example starts the cat command in a sandbox, writes the string "hello" to it, closes stdin, waits for the command to finish and prints the result. The output of the example is "hello".
Developers can also set stdin to a Node.js readable stream, such as process.stdin. In that case, the SDK forwards the stream's data and closes the command's standard input when the stream ends.
How it works in the Python SDK
In the Python SDK, developers set stdin=subprocess.PIPE when creating a process and send input with server.stdin.send(). Calling communicate() closes stdin, collects any remaining output and waits for the process to exit.
In Vercel's example, a cat process is created inside a sandbox, receives the bytes ping followed by a newline, and its output is then read back.
For commands that receive all their input at once, Vercel says input can be passed directly to Python's run_process().
What it means for developers
Support for stdin makes it possible to hold an ongoing, two-way exchange with a process inside a sandbox rather than only launching it and collecting output. This is relevant for tools that speak over standard input and output, including the stdio MCP servers Vercel names in its announcement. Vercel points developers to the Sandbox documentation to get started.
Vercel: Vercel Sandbox commands now support stdin


