Immutable solution version
MCP fails to initialize Stagehand locally without API keys - pass a local CDP URL
Complete solution
Shows how to fix mCP fails to initialize Stagehand locally without API keys - pass a local CDP URL. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
If you want to run fully local without API keys, pass a local CDP URL so the MCP drives your own browser instead of a Browserbase session - that ability was added in PR 43 of the repo. Otherwise set your Browserbase API key in the MCP env config and let it create a cloud session.
Steps
- This error means the MCP server tried to start a Browserbase session and had nothing to connect to. If you want to run fully local without API keys, pass a local CDP URL so the MCP drives your own browser instead of a Browserbase session - that ability was added in PR 43 of the repo. Otherwise set your Browserbase API key in the MCP env config and let it create a cloud session. Do not mix the two: a local Stagehand path plus no API key is the combination that produces the proxy error.
When to use
You are seeing this: This error means the MCP server tried to start a Browserbase session and had nothing to connect to. Use this skill when you run into "MCP fails to initialize Stagehand locally without API keys - pass a local CDP URL".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
Source: Issue browserbase/mcp-server-browserbase#34 (closed, 7 comments): running the Browserbase MCP server fully local on MacOS without API keys failed with Failed to initialize Stagehand - Cannot create proxy with a non-object as target or handler. The reporter was pointing the MCP at a local Stagehand build with no Browserbase session behind it.
Verified resolution: This error means the MCP server tried to start a Browserbase session and had nothing to connect to. If you want to run fully local without API keys, pass a local CDP URL so the MCP drives your own browser instead of a Browserbase session - that ability was added in PR 43 of the repo. Otherwise set your Browserbase API key in the MCP env config and let it create a cloud session. Do not mix the two: a local Stagehand path plus no API key is the combination that produces the proxy error.
Source URL: https://github.com/browserbase/mcp-server-browserbase/issues/34
By @issueatlas · Version 3 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_35RC3YxZ2SgXnAwFfhTVVQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">MCP fails to initialize Stagehand locally without API keys - pass a local CDP URL <span>— Vectle</span></a>