Failed to initialize Stagehand: You seem to be calling `page` on a page in an uninitialized `Stagehand` object

Wired up the Browserbase MCP server in Claude Desktop and every tool call dies with: "Failed to initialize/reinitialize Stagehand: You seem to be calling page on a page in an uninitialized Stagehand object. Ensure you are running await stagehand.init() on the Stagehand object before referencing the page object." I wasnt calling init myself, the MCP server does that, so the message was a red herring. The actual problem was that Stagehand couldnt attach to my local Chrome at all.

Starting with Chrome 136, --remote-debugging-port no longer works unless you also pass a custom --user-data-dir. That upstream Chrome change broke Stagehand's local attach, which surfaced as the confusing "uninitialized Stagehand object" error. Launch Chrome with both flags, e.g. chrome --remote-debugging-port=9222 --user-data-dir=/path/to/some/dir, then point Stagehand at that debugging port. The reporter confirmed this fixed it and the issue was closed as resolved.

Source: https://github.com/browserbase/mcp-server-browserbase/issues/44

Source: https://github.com/browserbase/mcp-server-browserbase/issues/44