Provides embedding capabilities for Loom videos, as shown in the README demo section.
Playwright Browserbase MCP Server
The Model Context Protocol (MCP) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. Whether you’re building an AI-powered IDE, enhancing a chat interface, or creating custom AI workflows, MCP provides a standardized way to connect LLMs with the context they need.
How to Setup
Quickstarts:
You can either use our Server hosted on NPM or run it completely locally by cloning this repo.
To run on NPM (Recommended)
Go into your MCP Config JSON and add the Browserbase Server:
Thats it! Reload your MCP client and Claude will be able to use Browserbase.
To run 100% local:
Then in your MCP Config JSON run the server. To run locally we can use STDIO or self-host over SSE.
STDIO:
To your MCP Config JSON file add the following:
SSE:
Run the following command in your terminal. You can add any flags (see options below) that you see fit to customize your configuration.
Then in your MCP Config JSON file put the following:
Then reload your MCP client and you should be good to go!
Flags Explained:
The Browserbase MCP server accepts the following command-line flags:
Flag | Description |
---|---|
--browserbaseApiKey <key> | Your Browserbase API key for authentication |
--browserbaseProjectId <id> | Your Browserbase project ID |
--proxies | Enable Browserbase proxies for the session |
--advancedStealth | Enable Browserbase Advanced Stealth (Only for Scale Plan Users) |
--contextId <contextId> | Specify a Browserbase Context ID to use |
--persist [boolean] | Whether to persist the Browserbase context (default: true) |
--port <port> | Port to listen on for HTTP/SSE transport |
--host <host> | Host to bind server to (default: localhost, use 0.0.0.0 for all interfaces) |
--cookies [json] | JSON array of cookies to inject into the browser |
--browserWidth <width> | Browser viewport width (default: 1024) |
--browserHeight <height> | Browser viewport height (default: 768) |
These flags can be passed directly to the CLI or configured in your MCP configuration file.
NOTE:
Currently, these flags can only be used with the local server (npx @browserbasehq/mcp).
Flags & Example Configs
Proxies
Here are our docs on Proxies.
To use proxies in STDIO, set the --proxies flag in your MCP Config:
Advanced Stealth
Here are our docs on Advanced Stealth.
To use proxies in STDIO, set the --advancedStealth flag in your MCP Config:
Contexts
Here are our docs on Contexts
To use contexts in STDIO, set the --contextId flag in your MCP Config:
Cookie Injection
Why would you need to inject cookies? Our context API currently works on persistent cookies, but not session cookies. So sometimes our persistent auth might not work (we're working hard to add this functionality).
You can flag cookies into the MCP by adding the cookies.json to your MCP Config.
To use proxies in STDIO, set the --proxies flag in your MCP Config. Your cookies JSON must be in the type of Playwright Cookies
Browser Viewport Sizing
The default viewport sizing for a browser session is 1024 x 768. You can adjust the Browser viewport sizing with browserWidth and browserHeight flags.
Here's how to use it for custom browser sizing. We recommend to stick with 16:9 aspect ratios (ie: 1920 x 1080, 1280, 720, 1024 x 768)
Structure
src/
: TypeScript source codeindex.ts
: Main entry point, env checks, shutdownserver.ts
: MCP Server setup and request routingsessionManager.ts
: Handles Browserbase session creation/managementtools/
: Tool definitions and implementationsresources/
: Resource (screenshot) handlingtypes.ts
: Shared TypeScript types
dist/
: Compiled JavaScript outputtests/
: Placeholder for testsutils/
: Placeholder for utility scriptsDockerfile
: For building a Docker image- Configuration files (
.json
,.ts
,.mjs
,.npmignore
)
Contexts for Persistence
This server supports Browserbase's Contexts feature, which allows persisting cookies, authentication, and cached data across browser sessions:
- Creating a Context:
- Using a Context with a Session:
- Deleting a Context:
Contexts make it much easier to:
- Maintain login state across sessions
- Reduce page load times by preserving cache
- Avoid CAPTCHAs and detection by reusing browser fingerprints
Cookie Management
This server also provides direct cookie management capabilities:
- Adding Cookies:
- Getting Cookies:
- Deleting Cookies:
These tools are useful for:
- Setting authentication cookies without navigating to login pages
- Backing up and restoring cookie state
- Debugging cookie-related issues
- Manipulating cookie attributes (expiration, security flags, etc.)
TODO/Roadmap
- Implement true
ref
-based interaction logic for click, type, drag, hover, select_option. - Implement element-specific screenshots using
ref
. - Add more standard MCP tools (tabs, navigation, etc.).
- Add tests.
This server cannot be installed
An MCP server that enables LLM applications to control web browsers via Browserbase, supporting features like web navigation, screenshots, cookie management, and persistent contexts.
Related MCP Servers
- -securityAlicense-qualityAn MCP server that connects any MCP client (like Claude or Cursor) with the browser using browser-use, allowing clients to utilize existing LLMs without requiring additional API keys.Last updated -74PythonApache 2.0
- -securityFlicense-qualityMCP server enabling LLMs to perform browser tasks via SSE transport, allowing clients like Cursor.ai and Claude to open websites and interact with web content through natural language commands.Last updated -
- AsecurityFlicenseAqualityAn MCP server that enables LLMs to 'see' what's happening in browser-based games and applications through vectorized canvas visualization and debug information.Last updated -1136JavaScript
- -securityAlicense-qualityAn MCP server paired with a Firefox extension that enables LLM clients to control the user's browser, supporting tab management, history search, and content reading.Last updated -83TypeScriptMIT License