Skip to content

browserbase/claude-code-plugin

Repository files navigation

Browserbase Plugin for Claude Code

Use Browserbase cloud browsers with Claude Code instead of local Chrome.

What it does

This plugin intercepts Claude Code's browser automation commands (mcp__claude-in-chrome__*) and forwards them to Browserbase's cloud browser infrastructure. This gives you:

  • Sandboxed, secure browser execution - Run browser automation in isolated cloud environments
  • Session recording and debugging - Watch Claude browse in real-time via debug URLs
  • Scalable browser automation - Cloud browsers with built-in proxy and stealth capabilities

Requirements

Installation

From Browserbase Marketplace

In Claude Code, add the plugin marketplace and install:

/plugin marketplace add browserbase/claude-code-plugin
/plugin install browserbase@claude-code-plugin

Then restart Claude Code for the changes to take effect.

Manual Installation

  1. Clone this repository:

    git clone https://github.com/browserbase/claude-code-plugin.git
  2. Copy to your Claude plugins directory:

    cp -r claude-code-plugin ~/.claude/plugins/browserbase
  3. Install dependencies:

    cd ~/.claude/plugins/browserbase
    npm install

Setup

Run the setup script to configure your Browserbase credentials:

~/.claude/plugins/browserbase/scripts/setup.sh

You'll be prompted for:

Credentials are stored in ~/.browserbase/credentials.

Alternative: Environment Variables

You can also set credentials via environment variables:

export BROWSERBASE_API_KEY="your-api-key"
export BROWSERBASE_PROJECT_ID="your-project-id"

Usage

Once installed and configured, just use Claude Code normally. The plugin automatically:

  1. On session start: Launches a cloud browser and starts the forwarding server
  2. On browser commands: Forwards all mcp__claude-in-chrome__* commands to Browserbase
  3. On navigation: Shows you the live debug URL to watch the browser
  4. On session end: Cleans up the browser session

Example

$ claude

> Navigate to github.com and take a screenshot

[Browserbase] Cloud browser ready (server PID: 12345)
[Browserbase] Watch live at: https://www.browserbase.com/sessions/abc123/debug

I'll navigate to GitHub and capture a screenshot...

How it works

┌─────────────────┐     ┌──────────────────┐     ┌─────────────────┐
│   Claude Code   │────▶│ Forwarding Server│────▶│   Browserbase   │
│                 │     │  (Unix Socket)   │     │  Cloud Browser  │
└─────────────────┘     └──────────────────┘     └─────────────────┘
         │                                                │
         │              ┌──────────────────┐              │
         └─────────────▶│ Claude in Chrome │◀─────────────┘
                        │    Extension     │   (CDP over WebSocket)
                        └──────────────────┘
  1. Claude Code sends browser commands via the MCP browser bridge socket
  2. The forwarding server intercepts these commands
  3. Commands are translated to CDP (Chrome DevTools Protocol) and sent to Browserbase
  4. Browserbase executes commands on a cloud browser
  5. Results are returned through the same path

Plugin Structure

browserbase/
├── .claude-plugin/
│   └── plugin.json          # Plugin manifest
├── hooks/
│   └── hooks.json           # Hook configuration
├── scripts/
│   ├── setup.sh             # Credential setup
│   ├── session-start.sh     # Starts forwarding server
│   ├── session-stop.sh      # Cleanup on session end
│   └── browser-tool-log.sh  # Shows debug URL on navigate
├── index.js                 # Entry point
├── forwarding-server.js     # Socket interception & forwarding
├── browserbase-client.js    # Browserbase API & CDP client
└── package.json

Troubleshooting

"Claude in Chrome extension not found"

The plugin requires the Claude in Chrome extension to be installed, even though commands are forwarded to Browserbase. Install it from the Chrome Web Store.

"Failed to load credentials"

Run the setup script again:

~/.claude/plugins/browserbase/scripts/setup.sh

Server won't start

Check the server logs:

cat ~/.browserbase/state/server.log

Debug hook execution

Check the hook debug log:

cat ~/.browserbase/state/hook-debug.log

Development

To test the plugin during development:

claude --plugin-dir /path/to/browserbase-plugin

License

MIT

Links

About

Browserbase plugin for Claude Code - Use cloud browsers with Claude Code instead of local Chrome

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published