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

Set up a coding agent

Use browserless init to give your coding agent access to Browserless MCP tools and install the skill that shows it how to use them.

Prerequisites
  • Node.js 24 or later and the Browserless CLI
  • An installed client: Claude Code, Codex, Cursor, or opencode
  • A Browserless Cloud account to sign in to the hosted MCP server

Step 1: Run setup for your client​

In an interactive terminal, run browserless init to pick a client. To skip the picker, pass --agent with claude-code, codex, cursor, or opencode. For example:

browserless init --agent claude-code

If you already have a Cursor or opencode config, close that app before running browserless init so it doesn't save the config while setup edits it. When setup replaces one of these config files, it preserves standard file mode bits and ownership where permitted, but does not copy access control lists (ACLs) or extended attributes.

Result: The CLI checks whether you're signed in to the CLI and opens browser sign-in if needed. It then adds a user-level MCP server named browserless and installs the Browserless skill from the latest MCP release. The MCP entry uses the hosted MCP URL without an API token or authorization header, so the client can handle OAuth. The CLI leaves any existing server named browserless untouched. You can rerun setup without overwriting that entry.

Step 2: Sign in through your client​

The client manages its own MCP credentials. Signing in with browserless auth login doesn't sign the client in to MCP. A self-hosted CLI token authenticates the CLI to your server, not the client to the hosted MCP server.

ClientUser MCP configSkill folderHow to sign in
Claude Code~/.claude.json~/.claude/skills/browserlessRun /mcp in Claude Code and authenticate the Browserless server.
Codex~/.codex/config.toml~/.agents/skills/browserlessFollow the prompts during setup, or run codex mcp login browserless.
Cursor~/.cursor/mcp.json~/.cursor/skills/browserlessFollow Cursor's sign-in prompt on first use.
opencode~/.config/opencode/opencode.json~/.config/opencode/skills/browserlessRun opencode mcp auth browserless.

For example, in opencode:

opencode mcp auth browserless

Result: After you authorize Browserless, the client can use its MCP tools.

FAQ & Troubleshooting​

What if the skill download fails?

Rerun browserless init --agent with your client after you restore access to the MCP release. The CLI adds the MCP entry before downloading the skill, so a download failure doesn't remove that entry. You can still use the MCP tools without the skill.

What if the CLI can't parse my JSON or JSONC config?

Use the manual configuration snippets for your client and merge the Browserless entry into your existing config. The CLI won't rewrite a config it can't parse. If you already have a server named browserless, review that entry before making changes.

What if I didn't finish signing in to Codex?

Run codex mcp login browserless and finish the sign-in in your browser. You don't need to add the server again.

Can I sign in from an SSH session?

For CLI authentication, use stdin to pass an API token if your browser can't reach the CLI's loopback callback. browserless auth login --no-browser prints the sign-in URL instead of opening it, but it still needs the browser to reach that callback. It doesn't start a device-code flow. For MCP sign-in, follow your client's authentication instructions.

Next steps​

Was this page helpful?