# Browserless — how to use (mcp.ai)

Connect your Browserless account and use 7 tools for developer tools straight from your AI agent. Connect with your own API key. Browserless is a service that provides headless browser automation, allowing users to run automations on their own sites with browser infrastructure.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_browserless?ms=1787295720000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `browserless_download_file`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/browserless`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/browserless/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/browserless/download/file` — This tool allows downloading files that Chrome has downloaded during the execution of puppeteer code. It sets up a blank page, creates a fresh download directory, injects the provided code, and execut
  - body: { code: string, context?: object }
- `POST https://api.mcp.ai/api/browserless/execute/custom/function` — A tool that allows executing custom Puppeteer scripts via HTTP requests. This endpoint enables users to run browser automation tasks without managing their own infrastructure.
  - body: { code: string, context?: object }
- `POST https://api.mcp.ai/api/browserless/fetch/html/content` — This tool fetches the complete HTML content of a webpage using Browserless's content API. It's designed to retrieve the full HTML contents of any website, including dynamically generated content.
  - body: { url: string, best_attempt?: boolean, goto_options?: object, wait_for_event?: object, wait_for_timeout?: integer, wait_for_selector?: object, reject_resource_types?: string[], reject_request_pattern?: string[] }
- `POST https://api.mcp.ai/api/browserless/generate/pdf` — This tool generates a PDF from a specified webpage using browserless's PDF generation API. It allows specifying the URL of the webpage along with parameters such as format, filename, and waitUntil opt
  - body: { url?: string, html?: string, options?: object, addStyleTag?: object[], bestAttempt?: boolean, gotoOptions?: object, addScriptTag?: object[], waitForSelector?: object, rejectResourceTypes?: string[], rejectRequestPattern?: string[] }
- `POST https://api.mcp.ai/api/browserless/scrape/content` — A tool to extract structured content from a webpage by specifying CSS selectors. The tool navigates to the specified URL, waits for the page to load (including parsing and executing JavaScript), and r
  - body: { url: string, elements: object[], gotoOptions?: object, waitForEvent?: object, waitForTimeout?: integer, waitForFunction?: object, waitForSelector?: object }
- `POST https://api.mcp.ai/api/browserless/take/screenshot` — A tool that captures a screenshot of a webpage using browserless's screenshot API. The tool takes a URL and returns either a PNG or JPEG image. It includes options for full page capture, image type, q
  - body: { url: string, clip_x?: integer, clip_y?: integer, quality?: integer, full_page?: boolean, clip_width?: integer, image_type?: string, clip_height?: integer, omit_background?: boolean }
- `POST https://api.mcp.ai/api/browserless/unblock/protected/content` — This tool provides access to content from websites that implement bot protection mechanisms. It is designed to bypass various types of protection (such as CAPTCHA and bot detections) and return the HT
  - body: { ttl?: integer, url: string, content?: boolean, cookies?: boolean, screenshot?: boolean, waitForEvent?: object, waitForFunction?: object, waitForSelector?: object, browserWSEndpoint?: boolean }

## Example prompts
- "What can I do in Browserless?"
- "Show me a summary of my Browserless account"

## More
- Page: https://mcp.ai/browserless
- Agent spec (llms.txt): https://mcp.ai/browserless/llms.txt
- Postman collection: https://mcp.ai/browserless/postman.json
