OpenAICloudflare Developer PlatformApr 10, 2026, 12:00 AM

Browser Rendering - Browser Rendering adds Chrome DevTools Protocol (CDP) and MCP client support

A condensed section focused on the key takeaways first.

Original Post

Quick Digest

Summary

A condensed section focused on the key takeaways first.

openaienmodel: gpt-5-mini-2025-08-07

Browser Rendering adds Chrome DevTools Protocol (CDP) and MCP client support

Key Points

  • CDP WebSocket endpoint available
  • One-line switch for Puppeteer/Playwright
  • MCP clients supported via chrome-devtools-mcp

Summary

Browser Rendering now exposes the Chrome DevTools Protocol (CDP), enabling any CDP-compatible client (Puppeteer, Playwright, etc.) and supported MCP tools to connect to Cloudflare's remote browser. Connections use a WebSocket endpoint and your Cloudflare API token, and work from Workers, local machines, or cloud environments.

Key Points

  • CDP WebSocket endpoint: wss://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/browser-rendering/devtools/browser?keep_alive=600000.
  • Puppeteer/Playwright compatibility: switch with a one-line change, e.g. puppeteer.connect({ browserWSEndpoint, headers: { Authorization: 'Bearer <API_TOKEN>' } }).
  • MCP clients (Claude Desktop, Claude Code, Cursor, OpenCode) can use Browser Rendering via the chrome-devtools-mcp package and supply the same WebSocket endpoint and headers.
  • Authentication: include your Cloudflare API token in the Authorization: Bearer <API_TOKEN> header.
  • Environments: supported from Cloudflare Workers, local development, and other cloud environments.

How to get started

  1. Create a Cloudflare API token with appropriate permissions.
  2. Replace <ACCOUNT_ID> and <API_TOKEN> in the WebSocket URL and headers.
  3. Connect using your existing CDP client (Puppeteer/Playwright) or configure an MCP client with chrome-devtools-mcp.

Links

  • Refer to Cloudflare's CDP documentation for full connection details and permission requirements.

Full Translation

Translations

A translation section that keeps the flow of the original article.

openaijamodel: gpt-5-mini-2025-08-07

Browser Rendering — Chrome DevTools Protocol (CDP) と MCP クライアントのサポートを追加

Browser Rendering が Chrome DevTools Protocol (CDP) と MCP クライアントのサポートを追加

公開日: 2026-04-10

概要

  • Browser Rendering は Chrome DevTools Protocol (CDP) を公開しました。CDP はブラウザ自動化の低レベルプロトコルです。
  • CDP ベースのエージェントツールや既存の CDP 自動化スクリプトは、直接 Browser Rendering を利用できます。
  • Puppeteer や Playwright を含む任意の CDP 互換クライアントは、Cloudflare Workers、ローカルマシン、クラウド環境など、どの環境からでも接続できます。
  • 必要なのは Cloudflare API key(API_TOKEN)のみです。

CDP 接続の例

既存の CDP スクリプトを Browser Rendering に切り替えるのは 1 行の変更です。例(JavaScript):

const puppeteer = require("puppeteer-core");
const browser = await puppeteer.connect({
  browserWSEndpoint: `wss://api.cloudflare.com/client/v4/accounts/${ACCOUNT_ID}/browser-rendering/devtools/browser?keep_alive=600000`,
  headers: { Authorization: `Bearer ${API_TOKEN}` },
});
const page = await browser.newPage();
await page.goto("https://example.com");
console.log(await page.title());
await browser.close();

コードの説明

  • browserWSEndpoint: wss://api.cloudflare.com/client/v4/accounts/${ACCOUNT_ID}/browser-rendering/devtools/browser?keep_alive=600000 の形式で、<ACCOUNT_ID> を指定します。keep_alive パラメータは接続のタイムアウト保持時間(ミリ秒)です。
  • headers: Authorization ヘッダーに Bearer ${API_TOKEN} を渡して認証します。

MCP クライアントのサポート

Claude Desktop、Claude Code、Cursor、OpenCode のような MCP クライアントは、chrome-devtools-mcp ↗ パッケージを介して Browser Rendering をリモートブラウザとして使用できます。Claude Desktop の設定例:

{
  "mcpServers": {
    "browser-rendering": {
      "command": "npx",
      "args": [
        "-y",
        "chrome-devtools-mcp@latest",
        "--wsEndpoint=wss://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/browser-rendering/devtools/browser?keep_alive=600000",
        "--wsHeaders={\"Authorization\":\"Bearer <API_TOKEN>\"}"
      ]
    }
  }
}

コードの説明

  • 上記設定は npx chrome-devtools-mcp@latest を起動し、--wsEndpoint--wsHeaders を渡して Browser Rendering の WebSocket エンドポイントに接続します。
  • <ACCOUNT_ID><API_TOKEN> を実際の値に置き換してください。

開始方法

CDP のドキュメントを参照してセットアップを開始してください。


その他のリソースや詳細は Cloudflare のドキュメントを参照してください。