For AI agents: a documentation index is available at /llms.txt
Skip to main content

Browserless MCP Server

The Browserless MCP server gives AI assistants full browser automation capabilities through the Model Context Protocol. Connect Claude Desktop, Cursor, VS Code, Windsurf, or any MCP-compatible client to the hosted server and start scraping, searching, mapping, crawling, running Lighthouse audits, exporting, downloading, and running custom browser code — no infrastructure required.

Prerequisites
  • A Browserless account - either an API token from your account dashboard, or OAuth sign-in
  • An MCP-compatible client (Claude Desktop, Cursor, VS Code, Windsurf, etc.)

Hosted Server

Browserless provides a hosted MCP server ready to use:

https://mcp.browserless.io/mcp

No installation or environment variables required. See Authentication for how to connect.

Authentication

The hosted server supports three authentication methods:

MethodBest for
OAuth (Browserless account login)Clients that support OAuth — no token needed
Authorization headerClients that support custom headers
token query parameterURL-only clients (e.g. Claude.ai custom connectors)

When multiple methods are present, they are evaluated in this order: Authorization header (plain API token) → token query parameter → OAuth JWT.

OAuth

For clients that support OAuth (for example Claude Desktop or Cursor), the hosted server can authenticate you through your Browserless account - no API token required. When you connect, your client will open a browser window to sign in. After authenticating, the server resolves your account automatically.

OAuth is enabled on the hosted server at https://mcp.browserless.io/mcp with no extra configuration needed.

API Token

Pass your API token as a Bearer header or query parameter:

  • Header (recommended): Authorization: Bearer YOUR_API_TOKEN_HERE
  • Query parameter: ?token=YOUR_API_TOKEN_HERE

Client Setup

Claude.ai supports MCP servers via custom connectors. Since the connector form only accepts a URL, pass your token as a query parameter:

  1. Go to Customize > Connectors in Claude.ai.
  2. Click Add custom connector.
  3. Enter a name (e.g., Browserless) and the following URL:
https://mcp.browserless.io/mcp?token=YOUR_API_TOKEN_HERE
  1. Click Add.
tip

Clients that support OAuth can connect without a token - the server will prompt you to sign in with your Browserless account.

Run Locally

Requirements

Node.js 24 or newer.

Prefer not to use the hosted server? The MCP server is published to npm as @browserless.io/mcp, so you can run it locally with npx — no cloning, building, or Docker required. This is useful for pinning a specific server version or pointing at a self-hosted Browserless instance — including fully air-gapped setups, but only when that self-hosted instance also runs inside the isolated network. On its own, running locally with npx still calls the Browserless cloud for browser execution.

Running locally still calls the Browserless cloud (or your self-hosted instance) for the actual browser work. Only the MCP server process runs on your machine.

stdio (MCP clients)

For desktop MCP clients, point the server config at npx and pass your token as an environment variable. The server starts in stdio mode by default, which is what local clients expect:

Add to your claude_desktop_config.json:

{
"mcpServers": {
"browserless": {
"command": "npx",
"args": ["-y", "@browserless.io/mcp"],
"env": {
"BROWSERLESS_TOKEN": "YOUR_API_TOKEN_HERE"
}
}
}
}

HTTP (httpStream)

To run the server as a long-lived HTTP endpoint (for example to share one instance across clients) set TRANSPORT=httpStream:

TRANSPORT=httpStream PORT=8080 BROWSERLESS_TOKEN=YOUR_API_TOKEN_HERE \
npx -y @browserless.io/mcp

Then point your MCP client at http://localhost:8080/mcp, using the same header or query-parameter auth as the hosted server.

Environment variables

VariableRequiredDefaultDescription
BROWSERLESS_TOKENYesYour Browserless API token
BROWSERLESS_API_URLNohttps://production-sfo.browserless.ioAPI endpoint (set this to point at a self-hosted instance or a different region)
TRANSPORTNostdioTransport type: stdio or httpStream
PORTNo8080HTTP server port (only used with httpStream)
BROWSERLESS_TIMEOUTNo30000Request timeout in milliseconds
BROWSERLESS_MAX_RETRIESNo3Max retry attempts for failed requests
BROWSERLESS_CACHE_TTLNo60000Cache TTL in milliseconds (0 to disable)

Regional Endpoints

By default, the hosted MCP server connects to the US West (San Francisco) Browserless region. To use a different region, pass the endpoint as a header or query parameter:

RegionEndpoint
US West — San Francisco (default)https://production-sfo.browserless.io
Europe — Londonhttps://production-lon.browserless.io
Europe — Amsterdamhttps://production-ams.browserless.io

Using the x-browserless-api-url header (for clients that support headers):

{
"mcpServers": {
"browserless": {
"type": "http",
"url": "https://mcp.browserless.io/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN_HERE",
"x-browserless-api-url": "https://production-sfo.browserless.io"
}
}
}
}

Using the browserlessUrl query parameter (for URL-only clients like Claude.ai):

https://mcp.browserless.io/mcp?token=YOUR_API_TOKEN_HERE&browserlessUrl=https://production-sfo.browserless.io

Tools

The MCP server exposes nine tools to your AI assistant, split across two reference pages:

Browser Agent

A single stateful tool, browserless_agent, that drives a browser session across turns. The session persists across tool calls, so the model can navigate, snapshot the page, click, type, fill forms, and react to what it sees — all within one browser context. Ideal for logins, multi-step flows, and anything that needs the browser's state to survive between turns.

REST API Tools

Eight stateless tools that wrap individual Browserless REST endpoints — one call in, one result out:

ToolPurpose
browserless_smartscraperScrape any URL with cascading strategies (HTTP → proxy → headless → CAPTCHA solving)
browserless_functionRun custom Puppeteer JavaScript on the Browserless cloud
browserless_downloadTrigger and retrieve browser-initiated file downloads
browserless_exportExport a page as HTML, PDF, image, or full offline ZIP
browserless_searchWeb/news/image search with optional scraping of each result
browserless_mapDiscover all URLs on a site via sitemap and link extraction
browserless_performanceRun a Lighthouse audit (accessibility, performance, SEO, PWA, best practices)
browserless_crawlCrawl a site from a seed URL and scrape every discovered page

Further Reading