MCP server

BrowserGen ships a hosted MCP server that turns any MCP client into a browser operator: 16 tools for creating sessions, navigating, clicking, typing, and reading pages. One URL, one API key, no glue code.

Quickstart

With Claude Code, connecting is one command:

terminal
claude mcp add --transport http browsergen https://api.browsergen.com/mcp \
  --header "Authorization: Bearer brl-k-v7-YOUR-KEY"

Then ask your agent to browse: "open news.ycombinator.com and tell me the top story". The first page tool call creates a browser session automatically; there is no setup step inside the conversation.

No model key needed. The tools are deterministic browser operations, so nothing on our side calls an LLM. Your BrowserGen API key (from API keys) is the only credential, on any plan including the trial.

Endpoint and authentication

The server lives at https://api.browsergen.com/mcp (Streamable HTTP, stateless). Authenticate with an API key, in one of three ways:

  • Authorization: Bearer brl-k-v7-... header (preferred).
  • x-api-key header with the same key value.
  • ?key=brl-k-v7-... query parameter for clients that cannot send custom headers (ChatGPT, claude.ai connectors). Keys in URLs can end up in logs, so prefer a header where possible.

The MCP server sits behind the same gate as the REST API: it needs an active BrowserGen plan, and sessions it creates count against your plan's concurrency.

For clients that only speak stdio, the browsergen-mcp npm package is a thin local bridge to the hosted endpoint (run npx -y browsergen-mcp with BROWSERGEN_API_KEY in the environment). The tools live server-side either way, so both transports behave identically.

Client setup

Claude Code

terminal
claude mcp add --transport http browsergen https://api.browsergen.com/mcp \
  --header "Authorization: Bearer brl-k-v7-YOUR-KEY"

Or, if you prefer a local stdio process:

terminal
claude mcp add browsergen --env BROWSERGEN_API_KEY=brl-k-v7-YOUR-KEY \
  -- npx -y browsergen-mcp

Codex CLI

terminal
export BROWSERGEN_API_KEY=brl-k-v7-YOUR-KEY
codex mcp add browsergen --url https://api.browsergen.com/mcp \
  --bearer-token-env-var BROWSERGEN_API_KEY

# Or over stdio:
codex mcp add browsergen --env BROWSERGEN_API_KEY=brl-k-v7-YOUR-KEY -- npx -y browsergen-mcp

Gemini CLI

terminal
gemini mcp add --transport http browsergen https://api.browsergen.com/mcp \
  --header "Authorization: Bearer brl-k-v7-YOUR-KEY"

Cursor

~/.cursor/mcp.json
{
  "mcpServers": {
    "browsergen": {
      "url": "https://api.browsergen.com/mcp",
      "headers": { "Authorization": "Bearer brl-k-v7-YOUR-KEY" }
    }
  }
}

Windsurf

Windsurf uses serverUrl where other clients use url:

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "browsergen": {
      "serverUrl": "https://api.browsergen.com/mcp",
      "headers": { "Authorization": "Bearer brl-k-v7-YOUR-KEY" }
    }
  }
}

VS Code

For Copilot agent mode:

terminal
code --add-mcp '{"name":"browsergen","type":"http","url":"https://api.browsergen.com/mcp","headers":{"Authorization":"Bearer brl-k-v7-YOUR-KEY"}}'

Claude Desktop

Under Settings > Connectors, add a custom connector with this URL (Claude Desktop connectors cannot send headers, hence the query key):

connector URL
https://api.browsergen.com/mcp?key=brl-k-v7-YOUR-KEY

Or run the stdio bridge instead:

claude_desktop_config.json
{
  "mcpServers": {
    "browsergen": {
      "command": "npx",
      "args": ["-y", "browsergen-mcp"],
      "env": { "BROWSERGEN_API_KEY": "brl-k-v7-YOUR-KEY" }
    }
  }
}

ChatGPT and claude.ai

Both take a plain server URL (ChatGPT under Developer mode, claude.ai under custom connectors). Paste the endpoint with the query-parameter key:

server URL
https://api.browsergen.com/mcp?key=brl-k-v7-YOUR-KEY

Tools

The server exposes 16 tools. Four manage session lifecycle; the rest drive the page.

Session lifecycle

ToolDescription
browser_create_sessionStart a browser explicitly. Options: timeout in seconds (60 to 21600, default 3600), country ("us", "de", "us-dal", ...), a custom proxy URL, and a start url. Returns the session id, live view URL, and CDP connectUrl.
browser_list_sessionsList the key's running sessions.
browser_stop_sessionEnd a session and free its concurrency slot immediately.
browser_get_usageConcurrency usage: slots in use vs available on your plan.

Page control

ToolDescription
browser_navigateOpen a URL. Creates a session automatically if none is active.
browser_navigate_backGo back one page in history.
browser_snapshotAccessibility snapshot of the page, with [ref=eN] ids the interaction tools target.
browser_clickClick an element by its snapshot ref.
browser_typeType text into an element.
browser_press_keyPress a keyboard key.
browser_select_optionChoose options in a select element.
browser_screenshotJPEG screenshot of the viewport, or the full page.
browser_evaluateRun a JavaScript expression on the page and return the result.
browser_tab_newOpen a new tab.
browser_tab_selectSwitch to another open tab.
browser_tab_closeClose a tab.

How sessions behave

  • Implicit creation. The first page tool call auto-creates a session with default settings; agents can simply call browser_navigate. Use browser_create_session first when you need a specific timeout, exit country, or proxy.
  • Idle end. A session ends 2 minutes after its last tool call (or CDP disconnect), and always at its absolute timeout. browser_stop_session frees the slot immediately.
  • Human handoff via the live view. Every session has a live view at https://browsergen.com/dash/sessions/{id} where a person can watch the agent work and take over for logins, captchas, or 2FA, then hand control back.
MCP and CDP share sessions. browser_create_session returns the same connectUrl as the REST API, so Playwright or Puppeteer can attach to the very browser your agent is operating: script the precise parts, let the model handle the rest.

Related