Connect Browserbase to Claude Code
Run headless browsers in the cloud, and fetch or search the web through Browserbase. Add Toolspoke to Claude Code once and it can use 13 Browserbase actions. Your Browserbase credential stays in Toolspoke, and you choose which actions Claude Code may call.
Set it up in Claude Code
Three steps, the first one once for every toolkit you will ever add.
Add Toolspoke to Claude Code
Run it in your project, then /mcp to sign in
claude mcp add --transport http toolspoke https://toolspoke.com/mcpThe sign-in opens in your browser, and Toolspoke asks you to approve it.
Install Browserbase and connect it
Add Browserbase to a project in your Toolspoke workspace.
API key. You provide it once, when you install the connector. Toolspoke encrypts it at rest and decrypts it only for the length of a single call, and the gateway attaches it to the outbound request itself, so it is never part of the arguments an agent sends.
- API key
- browserbase.com → sign in → Overview (the dashboard home page) → API Key. Copy the key shown there.
Choose what Claude Code may do
All 13 actions start on. Switch off any of the 4 actions that change something in Browserbase, and Claude Code gets a refusal if it tries.
What you can ask Claude Code for
A few of the Browserbase actions that only read, so they are safe to try first.
- List the projects this key can reach, with id, name, default session timeout and concurrency
- Read a project's usage so far this billing period, browser minutes and proxy bytes
- List browser sessions, newest first, with id, status, region, start and end time, and proxy bytes used
- Read one session, status, region, timings, keepAlive, context and user metadata
What Claude Code can do in Browserbase
9 actions read, 2 write and 2 delete or permanently change something.
Reads
List projects
List the projects this key can reach, with id, name, default session timeout and concurrency. The project id is what get_project_usage takes.
Get project usage
Read a project's usage so far this billing period, browser minutes and proxy bytes. Use it to check spend before starting many sessions.
List sessions
List browser sessions, newest first, with id, status, region, start and end time, and proxy bytes used. Filter by `status` (RUNNING to see what is live and billing right now), or search user metadata with `q`. This is the connection test: it reads the account's own sessions, not just the key.
Get session
Read one session, status, region, timings, keepAlive, context and user metadata.
Get session live urls
Get the live-view URLs of a running session, for watching or taking over the browser by hand. Anyone with these URLs can control the browser, so the payload is kept out of the audit log. Set `expiresIn` to make them expire sooner than the session does.
Get session logs
Read a session's browser logs, the DevTools Protocol requests and responses. Use it to find out why an automation failed. The logs carry the pages the browser visited, so the payload is kept out of the audit log.
Get context
Read one context's id, name, project and dates.
Fetch page
Fetch one URL through Browserbase's network, with a real browser user agent, and return its status, headers and content, as-is, as markdown, or as JSON in the shape of `schema`. No browser is started and no JavaScript runs, so a page that renders client-side comes back empty; use the MCP route for those. Content over 5 MB is refused. The content is other people's, so the payload is kept out of the audit log.
Web search
Search the web and get back ranked results with title, URL and snippet. Use it to find the page before fetching or browsing it. The results are other people's pages, so the payload is kept out of the audit log; the query is kept out too.
Writes
Create session
Start a cloud browser and return its id and connectUrl. Nothing here drives it: hand the connectUrl to a Playwright, Puppeteer or Stagehand client, or use the MCP route instead. The browser bills by the minute until it is released or times out, so set a short `timeout` and call release_session when done. Classified write because it starts a billed resource.
Create context
Create a context, a saved browser profile that keeps cookies and logins between sessions. Pass its id in create_session's browserSettings.context to use it.
Deletes or permanently changes
Release session
End a running session now instead of waiting for its timeout. Classified destructive because it closes the browser under whatever client is using it, and that client's work in progress is lost. Use it on sessions you started; check list_sessions first.
Delete context
Delete a context and the cookies and logins saved in it. It cannot be recovered, and sessions that relied on it start signed out.
Browserbase in Claude Code: questions
Does Claude Code see my Browserbase credential?
No. The credential is stored encrypted in Toolspoke, and the gateway adds it to each call. Claude Code only ever talks to Toolspoke, and the dashboard shows the last four characters of the credential and nothing more.
Can I stop Claude Code from changing things in Browserbase?
Yes. Each of the 13 actions can be switched off for a project. Turn off the 4 that change something and Claude Code can only read.
Will 13 actions crowd Claude Code's context?
No. Toolspoke shows Claude Code five bridge tools, plus a guide where a toolkit has one, and Claude Code searches for the Browserbase action it needs when it needs it. Adding more toolkits does not add more tools to its list.
Can I add it once for every project?
Yes. Add --scope user to the command and Claude Code keeps Toolspoke in every project on this machine. Without it, the server is added to the project you ran the command in.
What does it cost?
Tool calls are free on every plan, and a Browserbase call does not run in a sandbox, so it bills nothing.
Browserbase in your other apps
Try Browserbase in Claude Code
Free to start, and tool calls cost nothing on any plan.