Yesterday's Top Poster

Vercel Sandbox commands now support stdin

  • Thread starter Thread starter Kishore Devireddy
  • Start date Start date
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:


You can also set stdin to a Node.js readable stream, such as process.stdin. The SDK forwards the stream’s data and closes the command’s standard input when the stream ends.

In the Python SDK, set stdin=subprocess.PIPE and send input with server.stdin.send(). Call communicate() to close stdin, collect remaining output, and wait for the process to exit:


For commands that receive all their input at once, you can pass input directly to Python’s run_process().

Read the Sandbox documentation to get started.

Read more

Continue reading...
 
Back
Top