Playwright Browserbase MCP Server
Provides embedding capabilities for Loom videos, as shown in the README demo section.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Playwright Browserbase MCP Server take a screenshot of the current page and save it"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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:
{
"mcpServers": {
"browserbase": {
"command": "npx",
"args" : ["@browserbasehq/mcp"],
"env": {
"BROWSERBASE_API_KEY": "",
"BROWSERBASE_PROJECT_ID": ""
}
}
}
}Thats it! Reload your MCP client and Claude will be able to use Browserbase.
To run 100% local:
# Clone the Repo
git clone https://github.com/browserbase/mcp-server-browserbase.git
# Install the dependencies in the proper directory and build the project
cd browserbase
npm install && npm run build
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:
{
"mcpServers": {
"browserbase": {
"command" : "node",
"args" : ["/path/to/mcp-server-browserbase/browserbase/cli.js"],
"env": {
"BROWSERBASE_API_KEY": "",
"BROWSERBASE_PROJECT_ID": ""
}
}
}
}SSE:
Run the following command in your terminal. You can add any flags (see options below) that you see fit to customize your configuration.
node cli.js --port 8931Then in your MCP Config JSON file put the following:
{
"mcpServers": {
"browserbase": {
"url": "http://localhost:8931/sse",
"env": {
"BROWSERBASE_API_KEY": "",
"BROWSERBASE_PROJECT_ID": ""
}
}
}
}Then reload your MCP client and you should be good to go!
Related MCP server: browser-use MCP Server
Flags Explained:
The Browserbase MCP server accepts the following command-line flags:
Flag | Description |
| Your Browserbase API key for authentication |
| Your Browserbase project ID |
| Enable Browserbase proxies for the session |
| Enable Browserbase Advanced Stealth (Only for Scale Plan Users) |
| Specify a Browserbase Context ID to use |
| Whether to persist the Browserbase context (default: true) |
| Port to listen on for HTTP/SSE transport |
| Host to bind server to (default: localhost, use 0.0.0.0 for all interfaces) |
| JSON array of cookies to inject into the browser |
| Browser viewport width (default: 1024) |
| 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:
{
"mcpServers": {
"browserbase": {
"command" : "npx",
"args" : ["@browserbasehq/mcp", "--proxies"],
"env": {
"BROWSERBASE_API_KEY": "",
"BROWSERBASE_PROJECT_ID": ""
}
}
}
}Advanced Stealth
Here are our docs on Advanced Stealth.
To use proxies in STDIO, set the --advancedStealth flag in your MCP Config:
{
"mcpServers": {
"browserbase": {
"command" : "npx",
"args" : ["@browserbasehq/mcp", "--advancedStealth"],
"env": {
"BROWSERBASE_API_KEY": "",
"BROWSERBASE_PROJECT_ID": ""
}
}
}
}Contexts
Here are our docs on Contexts
To use contexts in STDIO, set the --contextId flag in your MCP Config:
{
"mcpServers": {
"browserbase": {
"command" : "npx",
"args" : ["@browserbasehq/mcp", "--contextId", "<YOUR_CONTEXT_ID>"],
"env": {
"BROWSERBASE_API_KEY": "",
"BROWSERBASE_PROJECT_ID": ""
}
}
}
}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
{
"mcpServers": {
"browserbase" {
"command" : "npx",
"args" : [
"@browserbasehq/mcp", "--cookies",
'{
"cookies": json,
}'
],
"env": {
"BROWSERBASE_API_KEY": "",
"BROWSERBASE_PROJECT_ID": ""
}
}
}
}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)
{
"mcpServers": {
"browserbase": {
"command" : "npx",
"args" : [
"@browserbasehq/mcp",
"--browserHeight 1080",
"--browserWidth 1920",
],
"env": {
"BROWSERBASE_API_KEY": "",
"BROWSERBASE_PROJECT_ID": ""
}
}
}
}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 imageConfiguration 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:
browserbase_context_create: Creates a new context, optionally with a friendly nameUsing a Context with a Session:
browserbase_session_create: Now accepts a 'context' parameter with: - id: The context ID to use - name: Alternative to ID, the friendly name of the context - persist: Whether to save changes (cookies, cache) back to the context (default: true)Deleting a Context:
browserbase_context_delete: Deletes a context when you no longer need it
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:
browserbase_cookies_add: Add cookies to the current browser session with full control over propertiesGetting Cookies:
browserbase_cookies_get: View all cookies in the current session (optionally filtered by URLs)Deleting Cookies:
browserbase_cookies_delete: Delete specific cookies or clear all cookies from the session
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.
Available Tools
17 toolsbrowserbase_screenshotA
Takes a screenshot of the current page. Use this tool to learn where you are on the page when controlling the browser with Stagehand. Only use this tool when the other tools are not sufficient to get the information you need.
Inputs: name.
browserbase_session_closeA
Closes the current Browserbase session by properly shutting down the Stagehand instance, which handles browser cleanup and terminates the session recording.
Inputs: no named parameters.
browserbase_session_createA
Create or reuse a single cloud browser session using Browserbase with fully initialized Stagehand. WARNING: This tool is for SINGLE browser workflows only. If you need multiple browser sessions running simultaneously (parallel scraping, A/B testing, multiple accounts), use 'multi_browserbase_stagehand_session_create' instead. This creates one browser session with all configuration flags (proxies, stealth, viewport, cookies, etc.) and initializes Stagehand to work with that session. Updates the active session.
Inputs: sessionId.
browserbase_stagehand_actA
Performs an action on a web page element. Act actions should be as atomic and specific as possible, i.e. "Click the sign in button" or "Type 'hello' into the search input". AVOID actions that are more than one step, i.e. "Order me pizza" or "Send an email to Paul asking him to call me".
Inputs: action (required), variables.
browserbase_stagehand_extractA
Extracts structured information and text content from the current web page based on specific instructions and a defined schema. This tool is ideal for scraping data, gathering information, or pulling specific content from web pages. Use this tool when you need to get text content, data, or information from a page rather than interacting with elements. For interactive elements like buttons, forms, or clickable items, use the observe tool instead. The extraction works best when you provide clear, specific instructions about what to extract and a well-defined JSON schema for the expected output format. This ensures the extracted data is properly structured and usable.
Inputs: instruction (required).
browserbase_stagehand_get_all_urlsA
Gets the current URLs of all active browser sessions. Returns a mapping of session IDs to their current URLs.
Inputs: no named parameters.
browserbase_stagehand_get_urlA
Gets the current URL of the browser page. Returns the complete URL including protocol, domain, path, and any query parameters or fragments.
Inputs: no named parameters.
browserbase_stagehand_observeA
Observes and identifies specific interactive elements on the current web page that can be used for subsequent actions. This tool is specifically designed for finding actionable (interactable) elements such as buttons, links, form fields, dropdowns, checkboxes, and other UI components that you can interact with. Use this tool when you need to locate elements before performing actions with the act tool. DO NOT use this tool for extracting text content or data - use the extract tool instead for that purpose. The observe tool returns detailed information about the identified elements including their properties, location, and interaction capabilities. This information can then be used to craft precise actions. The more specific your observation instruction, the more accurate the element identification will be. Think of this as your 'eyes' on the page to find exactly what you need to interact with.
Inputs: instruction (required), returnAction.
multi_browserbase_stagehand_act_sessionB
Performs an action on a web page element. Act actions should be as atomic and specific as possible, i.e. "Click the sign in button" or "Type 'hello' into the search input". AVOID actions that are more than one step, i.e. "Order me pizza" or "Send an email to Paul asking him to call me". (for a specific session)
Inputs: sessionId (required), action (required), variables.
multi_browserbase_stagehand_extract_sessionA
Extracts structured information and text content from the current web page based on specific instructions and a defined schema. This tool is ideal for scraping data, gathering information, or pulling specific content from web pages. Use this tool when you need to get text content, data, or information from a page rather than interacting with elements. For interactive elements like buttons, forms, or clickable items, use the observe tool instead. The extraction works best when you provide clear, specific instructions about what to extract and a well-defined JSON schema for the expected output format. This ensures the extracted data is properly structured and usable. (for a specific session)
Inputs: sessionId (required), instruction (required).
multi_browserbase_stagehand_get_url_sessionA
Gets the current URL of the browser page. Returns the complete URL including protocol, domain, path, and any query parameters or fragments. (for a specific session)
Inputs: sessionId (required).
multi_browserbase_stagehand_observe_sessionA
Observes and identifies specific interactive elements on the current web page that can be used for subsequent actions. This tool is specifically designed for finding actionable (interactable) elements such as buttons, links, form fields, dropdowns, checkboxes, and other UI components that you can interact with. Use this tool when you need to locate elements before performing actions with the act tool. DO NOT use this tool for extracting text content or data - use the extract tool instead for that purpose. The observe tool returns detailed information about the identified elements including their properties, location, and interaction capabilities. This information can then be used to craft precise actions. The more specific your observation instruction, the more accurate the element identification will be. Think of this as your 'eyes' on the page to find exactly what you need to interact with. (for a specific session)
Inputs: sessionId (required), instruction (required), returnAction.
multi_browserbase_stagehand_session_closeA
Cleanup parallel session for multi-session workflows. Properly terminates a browser session, ends the Browserbase session, and frees cloud resources. Always use this when finished with a session to avoid resource waste and billing charges. Critical for responsible multi-session automation - each unclosed session continues consuming resources!
Inputs: sessionId (required).
multi_browserbase_stagehand_session_createA
Create parallel browser session for multi-session workflows. Use this when you need multiple browser instances running simultaneously: parallel data scraping, concurrent automation, A/B testing, multiple user accounts, cross-site operations, batch processing, or any task requiring more than one browser. Creates an isolated browser session with independent cookies, authentication, and state. Always pair with session-specific tools (those ending with '_session'). Perfect for scaling automation tasks that require multiple browsers working in parallel.
Inputs: name, browserbaseSessionID.
multi_browserbase_stagehand_session_listA
ONLY WORKS WITH MULTI-SESSION TOOLS! Track all parallel sessions: Critical tool for multi-session management! Shows all active browser sessions with their IDs, names, ages, and Browserbase session IDs. Use this frequently to monitor your parallel automation workflows, verify sessions are running, and get session IDs for session-specific tools. Essential for debugging and resource management in complex multi-browser scenarios.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Most tools have distinct purposes, with clear separation between single-session and multi-session variants, and between action (act), observation (observe), extraction (extract), navigation, and session management. However, there is some potential confusion between browserbase_stagehand_act and multi_browserbase_stagehand_act_session, as they perform identical functions but for different session contexts, which could lead to misselection if the agent doesn't track session state properly.
The naming follows a consistent snake_case pattern and uses descriptive terms like 'act', 'extract', 'observe', 'navigate', and 'session'. However, there is inconsistency in the prefixing: some tools start with 'browserbase_' while others start with 'multi_browserbase_', and the suffix '_session' is inconsistently applied (e.g., multi_browserbase_stagehand_act_session vs. browserbase_stagehand_act). This mixed convention reduces predictability.
With 17 tools, the count is on the higher side but reasonable for a browser automation server that supports both single and multi-session workflows. It covers core functionalities like navigation, interaction, extraction, and session management, but it feels slightly heavy due to the duplication of tools for single vs. multi-session contexts, which could have been streamlined.
The tool set provides comprehensive coverage for browser automation, including session creation, closure, and listing; navigation; interaction (act and observe); data extraction; and URL retrieval. It supports both single and parallel workflows, with clear guidance on when to use each tool. No obvious gaps are present for the stated purpose of controlling browsers with Stagehand.
Maintenance
Related MCP Connectors
Official Browserless MCP server: browser automation, scraping, screenshots and PDFs for AI agents.
Web scraping, browser automation, screenshots and AI data extraction for AI agents via MCP.
Browz hosted MCP (free public beta): let an AI app drive your own Browz browser profiles from anywhere. Connect https://mcp.gobrowz.com/mcp and sign in with your Browz account (OAuth) or an agent token. Each call is relayed to the Browz app on your computer, which must be online with Remote control on and have a hardware security chip (Mac Secure Enclave or TPM 2.0). 17 tools: profiles, tabs, navigate, snapshot, act, wait, screenshot. Cookies, downloads and stored sign-ins stay on your computer.
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceMCP 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.1-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI assistants to control a web browser through natural language commands, allowing them to navigate websites and extract information via SSE transport.849MIT
- AlicenseBqualityDmaintenanceAn MCP server that provides browser automation capabilities, enabling LLMs to control a web browser for navigation, interaction, and data extraction.32111 npm14MIT
- AlicenseNot gradedqualityDmaintenanceA browser automation MCP server with stealth mode, profile management, and multi-browser support, enabling LLMs to control browsers for tasks like navigation, data extraction, and form filling.11 npm1MIT