# Cloudflare Browser Rendering — how to use (mcp.ai)

Connect your Cloudflare Browser Rendering account and use 4 tools for web scraping straight from your AI agent. Connect with your own API key. Cloudflare Browser Rendering enables developers to programmatically control and interact with headless browser instances running on Cloudflare’s global network, facilitating tasks such as automating browser interactions, capturing screenshots, generating PDFs, and extracting data from web pages.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_cloudflare_browser_rendering?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. `cloudflare_browser_rendering_capture_screenshot`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/cloudflare_browser_rendering`
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/cloudflare_browser_rendering/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/cloudflare_browser_rendering/capture/screenshot` — Tool to capture a webpage screenshot. Use when you need a visual snapshot of a URL or HTML with optional viewport and clipping. Always validate screenshot content — the tool returns a successful resul
  - body: { url?: string, html?: string, cacheTTL?: integer, viewport?: object, accountId: string, screenshotOptions?: object }
- `POST https://api.mcp.ai/api/cloudflare_browser_rendering/list/accounts` — List all Cloudflare accounts accessible to the authenticated API token. Returns account IDs, names, types, and settings. Use this to retrieve a valid account_id required by other browser-rendering act
  - body: { name?: string, page?: integer, per_page?: integer, direction?: string }
- `POST https://api.mcp.ai/api/cloudflare_browser_rendering/scrape/html/elements` — Tool to scrape HTML elements for text, HTML, attributes, and box metrics. Use when you need detailed data of matched selectors after rendering a page.
  - body: { url?: string, html?: string, cacheTTL?: integer, elements: object[], account_id: string, actionTimeout?: integer }
- `POST https://api.mcp.ai/api/cloudflare_browser_rendering/take/webpage/snapshot` — Capture both rendered HTML content and a screenshot of a webpage in a single request. Returns the full DOM content as a string and a Base64-encoded screenshot image. Useful when you need both visual r
  - body: { url?: string, html?: string, cookies?: object[], cacheTTL?: integer, viewport?: object, accountId?: string, userAgent?: string, addStyleTag?: object[], bestAttempt?: boolean, gotoOptions?: object, addScriptTag?: object[], authenticate?: object, actionTimeout?: integer, waitForTimeout?: integer, waitForSelector?: object, emulateMediaType?: string, screenshotOptions?: object, allowResourceTypes?: string[], allowRequestPattern?: string[], rejectResourceTypes?: string[], setExtraHTTPHeaders?: object, rejectRequestPattern?: string[], setJavaScriptEnabled?: boolean }

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

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