Vercel Sandbox now lets you send input to running commands through standard input (stdin). Use it to exchange messages with stdio MCP servers such as agent-browser , or send data to other command-line programs while they run.
In the TypeScript SDK, set stdin: true and detached: true in runCommand() . Use writeStdin() to send input and closeStdin() when you’re done:
import { Sandbox } from '@vercel/sandbox' ;
const sandbox = await Sandbox . create ( ) ;
const cmd = await sandbox . runCommand ( {
cmd : 'cat' ,
stdin : true ,
detached : true ,
} ) ;
await cmd . writeStdin ( 'hello' ) ;
await cmd . closeStdin ( ) ;
const result = await cmd . wait ( ) ;
console . log ( await result . stdout ( ) ) ; // "hello"
Send input to a running command and read its output with the Sandbox TypeScript SDK.
You can also set stdin to a Node.js readable stream, such as process.stdin .…