Browserless MCP in Grok Build
xAI's Grok Build connects to the hosted Browserless MCP server with OAuth or an API token header, added through the grok mcp CLI. Once it's connected, Grok Build can scrape, search, crawl, and drive a cloud browser with the Browserless MCP tools.
- A Browserless API token from your account dashboard, or a Browserless account for OAuth sign-in
- Grok Build installed
Connect to the hosted server
The hosted server runs at https://mcp.browserless.io/mcp, so there's nothing to install.
Set BROWSERLESS_TOKEN in your environment, then run:
grok mcp add --transport http browserless https://mcp.browserless.io/mcp \
--header 'Authorization: Bearer ${BROWSERLESS_TOKEN}'
Grok Build stores header values as written, so the single quotes keep the token itself out of ~/.grok/config.toml and your shell history. It expands ${BROWSERLESS_TOKEN} when it loads the config. To sign in with OAuth instead, leave out --header. Grok Build opens a browser window on first use.
To use a region other than US West, add an x-browserless-api-url header, or a browserlessUrl query parameter on the server URL for clients that only take a URL. See regional endpoints.
Run the server locally
To run the MCP server process on your machine instead, use the @browserless.io/mcp npm package over stdio. You need Node.js 24 or newer. Browser work still runs on Browserless, so this is mainly for pinning a server version (add it to the package name, for example @browserless.io/mcp@1.41.0) or pointing at a self-hosted instance with BROWSERLESS_API_URL. Both setups use the server name browserless, so replace the hosted entry with this one rather than adding both.
Run in your terminal:
grok mcp add browserless -- npx -y @browserless.io/mcp
Then add the token to the entry in ~/.grok/config.toml, and set BROWSERLESS_TOKEN in your environment before starting Grok Build so it can expand the variable:
[mcp_servers.browserless]
command = "npx"
args = ["-y", "@browserless.io/mcp"]
env = { BROWSERLESS_TOKEN = "${BROWSERLESS_TOKEN}" }
Check the connection
Run grok mcp doctor browserless. Inside a session, /mcps opens the MCP tab, where you can check and manage servers. Tools are named browserless__<tool>, so they read browserless__browserless_agent and so on.
FAQ & Troubleshooting
The server fails to start and I can't see why
Grok Build writes each server's stderr to ~/.grok/logs/mcp/<server>.stderr.log. Check ~/.grok/logs/mcp/browserless.stderr.log for the error.
Grok Build picked up a different Browserless config than the one I added
Grok Build also reads ~/.claude.json, .cursor/mcp.json, and .mcp.json, at lower priority than config.toml. Run grok mcp list to see which entry is active, and remove duplicates you don't want.
The server connects but every tool call returns 401 Unauthorized
The token is missing or wrong. Copy it again from your account dashboard and check the header reads Bearer followed by the token, with no quotes or trailing whitespace inside the value. If you used an environment variable, confirm it's set in the environment the client was launched from. GUI apps started from the dock or Start menu don't see variables exported in your shell profile.
The connection fails with an SSE error like Non-200 status code (400)
The hosted server speaks Streamable HTTP only and doesn't support the legacy SSE transport. Check the client entry is using its HTTP transport (see the config above), not an SSE one.