MCP Server

Give AI coding assistants the ability to see and control a real browser. Works with Cursor, Claude Desktop, Windsurf, and any MCP-compatible client.

Install in one line: npx -y @browserbeam/mcp-server — no global install required.

What is MCP? #

The Model Context Protocol (MCP) is an open standard that lets AI agents call external tools. Instead of just generating text, the agent can take real actions — browse the web, fill forms, extract data.

The Browserbeam MCP Server exposes 19 tools that give your AI agent a real browser session. The agent decides which tool to call and when. You just describe what you want.

Setup for Cursor #

Add this to your ~/.cursor/mcp.json file. Create it if it doesn't exist.

{
  "mcpServers": {
    "browserbeam": {
      "command": "npx",
      "args": ["-y", "@browserbeam/mcp-server"],
      "env": {
        "BROWSERBEAM_API_KEY": "sk_live_your_key_here"
      }
    }
  }
}

Restart Cursor. The Browserbeam tools appear in the MCP tools list automatically.

Setup for Claude Desktop #

Open the Claude Desktop config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Add the Browserbeam server to the mcpServers object:

{
  "mcpServers": {
    "browserbeam": {
      "command": "npx",
      "args": ["-y", "@browserbeam/mcp-server"],
      "env": {
        "BROWSERBEAM_API_KEY": "sk_live_your_key_here"
      }
    }
  }
}

Restart Claude Desktop. You'll see the Browserbeam tools in the tool picker.

Setup for Windsurf #

Add this to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "browserbeam": {
      "command": "npx",
      "args": ["-y", "@browserbeam/mcp-server"],
      "env": {
        "BROWSERBEAM_API_KEY": "sk_live_your_key_here"
      }
    }
  }
}

Restart Windsurf. The tools are available immediately.

Available Tools #

The MCP server exposes 19 tools. Your AI agent picks which tool to call based on your instructions.

Tool Description
browserbeam_create_session Create a browser session, optionally navigate to a URL
browserbeam_navigate Navigate to a new URL with optional wait conditions
browserbeam_observe Get page content as markdown or HTML + interactive element refs
browserbeam_click Click an element by ref, visible text, or label
browserbeam_fill Fill a single field or an entire form at once
browserbeam_type Type text character-by-character with real keyboard events
browserbeam_select Select an option from a dropdown
browserbeam_check Check or uncheck a checkbox or radio button
browserbeam_scroll Scroll the page or scroll an element into view
browserbeam_scroll_collect Scroll the entire page to load lazy content, then observe
browserbeam_wait Wait for a selector, text, JS expression, or fixed delay
browserbeam_extract Extract structured data from the page with a schema
browserbeam_execute_js Run custom JavaScript in the browser page context
browserbeam_screenshot Take a screenshot of the current page
browserbeam_pdf Generate a PDF of the current page
browserbeam_upload Upload files to a file input element
browserbeam_list_sessions List your active browser sessions
browserbeam_get_session Get the status and metadata of a session
browserbeam_close Close a session and release resources

browserbeam_create_session

Create a new browser session. Optionally navigate to a URL. The response includes page markdown and interactive element refs — use it as your first observation.

ParameterTypeDescription
urlstringURL to navigate to after creating the session
viewport_widthnumberViewport width in pixels (default: 1280)
viewport_heightnumberViewport height in pixels (default: 720)
timeoutnumberSession lifetime in seconds (default: 300)
auto_dismiss_blockersbooleanAuto-dismiss cookie banners and popups (default: true)
user_agentstringCustom User-Agent string
localestringBrowser locale (e.g. "en-US")
timezonestringTimezone ID (e.g. "America/New_York")
block_resourcesstring[]Resource types to block: "image", "font", "media", "stylesheet", "script"
cookiesobject[]Cookie objects to inject. Each needs "name", "value", and "domain" or "url".

browserbeam_navigate

Navigate to a new URL. The response includes page markdown and element refs. Only call observe separately if you need HTML format, a scoped section, or more text.

ParameterTypeDescription
session_idstringSession ID (ses_...)
urlstringURL to navigate to
wait_forstringCSS selector to wait for after navigation
wait_untilstringJavaScript expression to wait for (must become truthy)
wait_timeoutnumberMax ms to wait for wait_for/wait_until (default: 10000)

browserbeam_observe

Re-read the current page state. Use scope to limit to a CSS container and reduce output. Switch to HTML format when you need tag/class names for building extract selectors.

ParameterTypeDescription
session_idstringSession ID (ses_...)
scopestringCSS selector to scope observation to a page section
formatstringContent format: "markdown" (default) or "html"
max_text_lengthnumberMax content length in chars (default: 12000)

browserbeam_click

Click an element on the page. Use a ref from the element list, or match by visible text or label.

ParameterTypeDescription
session_idstringSession ID (ses_...)
refstringElement ref from interactive_elements (e.g. "e1")
textstringVisible text to click
labelstringElement label to click

browserbeam_fill

Fill a form field or an entire form. Use fields to fill multiple fields at once.

ParameterTypeDescription
session_idstringSession ID (ses_...)
refstringElement ref to fill
labelstringField label to fill
valuestringValue to fill into the field
fieldsobjectLabel-value pairs to fill an entire form
submitbooleanSubmit the form after filling (default: false)

browserbeam_extract

Extract structured data using a declarative schema. Selectors use CSS >> attribute syntax. Use _limit to test with a small sample before extracting a full list.

ParameterTypeDescription
session_idstringSession ID (ses_...)
schemastringJSON extraction schema. Scalar: {"title": "h1 >> text"}. List: {"items": [{"_parent": ".card", "_limit": 3, "name": "h2 >> text", "url": "a >> href"}]}. Attributes: >> text, >> href, >> src, >> any HTML attribute.

browserbeam_type

Type text character-by-character into an input. Fires real keyboard events for each character. Use for autocomplete or search-as-you-type inputs. Does not clear the field first (use fill for that).

ParameterTypeDescription
session_idstringSession ID (ses_...)
refstringElement ref (e.g. "e1")
labelstringField label to type into
valuestringText to type
delaynumberMilliseconds between keystrokes (default: 50)

browserbeam_select

Select an option from a <select> dropdown by its value.

ParameterTypeDescription
session_idstringSession ID (ses_...)
refstringElement ref (e.g. "e1")
labelstringField label of the select element
valuestringOption value to select

browserbeam_check

Check or uncheck a checkbox or radio button.

ParameterTypeDescription
session_idstringSession ID (ses_...)
refstringElement ref (e.g. "e1")
labelstringElement label
checkedbooleanSet to false to uncheck (default: true)

browserbeam_scroll

Scroll the page by direction, to top/bottom, or scroll an element into view.

ParameterTypeDescription
session_idstringSession ID (ses_...)
directionstring"up" or "down"
amountnumberPixels to scroll (default: 500)
timesnumberRepeat scroll N times (default: 1)
tostringJump to "top" or "bottom"
refstringScroll element into view by ref
textstringScroll element into view by text
labelstringScroll element into view by label

browserbeam_scroll_collect

Scroll through the entire page to trigger lazy-loaded content, then return a unified observation. Ideal for infinite-scroll or long pages.

ParameterTypeDescription
session_idstringSession ID (ses_...)
max_scrollsnumberSafety limit on scroll iterations (default: 50)
wait_msnumberPause between scrolls in ms (default: 500)
timeout_msnumberTotal time budget in ms (default: 60000)
max_text_lengthnumberContent length limit (default: 100000)

browserbeam_wait

Wait for a condition before continuing. Provide exactly one of: ms, selector, text, or until.

ParameterTypeDescription
session_idstringSession ID (ses_...)
msnumberFixed wait in milliseconds
selectorstringCSS selector to wait for
textstringWait for this text to appear on the page
untilstringJavaScript expression to wait for (must become truthy)
timeoutnumberMax wait time in ms (default: 10000)

browserbeam_execute_js

Run custom JavaScript in the browser page context. Use return to send values back. The return value appears in the extraction field under the result_key.

ParameterTypeDescription
session_idstringSession ID (ses_...)
codestringJavaScript code to execute
result_keystringKey name in extraction for the return value (default: "js_result")
timeoutnumberMax execution time in ms (default: 10000)

browserbeam_screenshot

Take a screenshot of the current page. Returns base64-encoded image data.

ParameterTypeDescription
session_idstringSession ID (ses_...)
full_pagebooleanCapture the full scrollable page (default: false)

browserbeam_pdf

Generate a PDF of the current page. Returns base64-encoded PDF data.

ParameterTypeDescription
session_idstringSession ID (ses_...)
formatstringPaper size (default: "A4")
landscapebooleanLandscape orientation (default: false)
print_backgroundbooleanPrint background graphics (default: true)
scalenumberScale factor 0.1–2 (default: 1)

browserbeam_upload

Upload files to a <input type="file"> element. Provide file URLs that Browserbeam will download and attach.

ParameterTypeDescription
session_idstringSession ID (ses_...)
refstringElement ref of the file input (e.g. "e1")
labelstringLabel of the file input
filesstring[]Array of file URLs to download and attach

browserbeam_list_sessions

List your browser sessions. Useful for checking which sessions are still active.

ParameterTypeDescription
statusstring"active" or "closed" (default: all)
limitnumberResults per page, 1–100 (default: 25)

browserbeam_get_session

Get the current status and metadata of a session, including start time and expiry.

ParameterTypeDescription
session_idstringSession ID (ses_...)

browserbeam_close

Close a browser session and release resources. Stops the billing clock.

ParameterTypeDescription
session_idstringSession ID (ses_...)

How It Works #

When you ask your AI agent to do something in a browser, the flow looks like this:

AI Agent MCP Tool Call Browserbeam API Real Browser Structured Response
  1. You describe a task in natural language. The AI agent decides which tool to use.
  2. The agent calls a Browserbeam tool through MCP (e.g. browserbeam_create_session).
  3. The MCP server sends the request to the Browserbeam API over HTTPS.
  4. Browserbeam spins up a real Chromium browser and executes the action.
  5. The API returns structured data: page content as markdown, element refs, extracted data, or screenshots.
  6. The agent reads the response, reasons about the result, and decides the next step.
Every tool call returns the current page state automatically. The agent always has fresh context about what's on screen.

Example Conversation #

Here's how an AI agent uses the tools in sequence. You say "Search Hacker News for posts about browser automation." The agent handles the rest.

1

Create session and navigate

{
  "tool": "browserbeam_create_session",
  "params": {
    "url": "https://news.ycombinator.com/"
  }
}

Returns page markdown + element refs like [e1] <a> Hacker News, [e42] <input> Search...

2

Extract top stories from the front page

{
  "tool": "browserbeam_extract",
  "params": {
    "session_id": "ses_abc123",
    "schema": "{\"stories\": [{\"_parent\": \".titleline\", \"title\": \"a >> text\", \"url\": \"a >> href\"}]}"
  }
}

Returns structured JSON: {"stories": [{"title": "Show HN: ...", "url": "https://..."}, ...]}

3

Fill the search form and submit

{
  "tool": "browserbeam_fill",
  "params": {
    "session_id": "ses_abc123",
    "fields": {"q": "browser automation"},
    "submit": true
  }
}

Fills the search input and submits the form. Page navigates to search results.

4

Take a screenshot

{
  "tool": "browserbeam_screenshot",
  "params": {
    "session_id": "ses_abc123"
  }
}

Returns a base64 PNG of the current viewport.

5

Close the session

{
  "tool": "browserbeam_close",
  "params": {
    "session_id": "ses_abc123"
  }
}

Session destroyed. Billing stops.

The agent responds with a summary of the top results about browser automation from Hacker News. Five tool calls, zero code written by you.

Environment Variables #

Variable Required Description
BROWSERBEAM_API_KEY Required Your Browserbeam API key. Get one from the dashboard.
BROWSERBEAM_BASE_URL Optional API base URL. Defaults to https://api.browserbeam.com.

Troubleshooting #

"BROWSERBEAM_API_KEY environment variable is required."

The env block is missing or the key is empty. Double-check your config file. Make sure there are no trailing spaces or line breaks in the key value.

"npx: command not found"

Node.js is not installed or not in your PATH. Install Node.js 18+ from nodejs.org. Then restart your AI client.

Server not connecting / tools not appearing

Verify the config file path is correct for your client. Common fixes:

  • Restart your AI client after editing the config file.
  • Ensure the JSON is valid (no trailing commas, correct brackets).
  • Test the server directly: BROWSERBEAM_API_KEY=sk_live_... npx -y @browserbeam/mcp-server

API errors (401, 403, 429)

401 — Invalid API key. Check that you're using a live key starting with sk_live_.
403 — Your plan doesn't support this feature. Check your dashboard.
429 — Rate limit exceeded. Wait a moment and try again, or upgrade your plan.

Give your AI agent a faster, leaner browser

Structured page data instead of raw HTML. Your agent processes less, decides faster, and costs less to run.

Stability detection built in
Fraction of the payload size
Diffs after every action
No credit card required. 1 hour of free runtime included.