Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

fix: guard against missing stdin in MCP stdio server startup

Laith Weinberger674547a41486
diff --git a/browser_use/mcp/server.py b/browser_use/mcp/server.py
index e8df61d90..bb4e9be7b 100644
--- a/browser_use/mcp/server.py
+++ b/browser_use/mcp/server.py
@@ -1223,6 +1223,9 @@ class BrowserUseServer:
# Start the cleanup task
await self._start_cleanup_task()
+ if sys.stdin is None:
+ raise RuntimeError('MCP stdio transport requires stdin, but this process was launched without one.')
+
async with mcp.server.stdio.stdio_server() as (read_stream, write_stream):
await self.server.run(
read_stream,