Skip to main content
Glama
cloudflare-browser-rendering-mcp

cloudflare-browser-rendering-mcp

by amotivv

Cloudflare ブラウザレンダリング MCP サーバー

鍛冶屋のバッジ

このMCP(Model Context Protocol)サーバーは、Cloudflare Browser Renderingを使用してウェブコンテンツを取得および処理し、LLMのコンテキストとして使用するためのツールを提供します。ClaudeとClineの両方のクライアント環境で動作するように設計されています。

特徴

  • Web コンテンツの取得: LLM コンテキストの Web ページを取得して処理します。

  • ドキュメント検索: Cloudflareのドキュメントを検索し、関連するコンテンツを返します

  • 構造化コンテンツの抽出: CSSセレクタを使用してWebページから構造化コンテンツを抽出します

  • コンテンツ要約: LLM コンテキストをより簡潔にするために Web コンテンツを要約します

  • スクリーンショットキャプチャ: Webページのスクリーンショットを撮る

Related MCP server: turbowebfetch

前提条件

  • Node.js v18以上

  • ブラウザレンダリングAPIアクセスを持つCloudflareアカウント

  • 提供されたpuppeteer-worker.jsファイルを使用してデプロイされた Cloudflare Worker

インストール

Smithery経由でインストール

Smithery経由で Claude Desktop 用の Cloudflare Browser Rendering を自動的にインストールするには:

npx -y @smithery/cli install @amotivv/cloudflare-browser-rendering-mcp --client claude
  1. このリポジトリをクローンします:

    git clone https://github.com/yourusername/cloudflare-browser-rendering.git
    cd cloudflare-browser-rendering
  2. 依存関係をインストールします:

    npm install
  3. プロジェクトをビルドします。

    npm run build

Cloudflareワーカーのセットアップ

  1. Wrangler を使用してpuppeteer-worker.jsファイルを Cloudflare Workers にデプロイします。

    npx wrangler deploy
  2. Cloudflare Worker で次のバインディングを必ず構成してください。

    • ブラウザレンダリングバインディングのbrowser

    • SCREENSHOTSという名前の KV 名前空間バインディング

  3. デプロイされたワーカーの URL をメモします (例: https://browser-rendering-api.yourusername.workers.dev )

構成

クロードデスクトップ向け

  1. Claude Desktop 構成ファイルを開きます。

    # macOS
    code ~/Library/Application\ Support/Claude/claude_desktop_config.json
    
    # Windows
    code %APPDATA%\Claude\claude_desktop_config.json
  2. MCP サーバー構成を追加します。

    {
      "mcpServers": {
        "cloudflare-browser-rendering": {
          "command": "node",
          "args": ["/path/to/cloudflare-browser-rendering/dist/index.js"],
          "env": {
            "BROWSER_RENDERING_API": "https://your-worker-url.workers.dev"
          },
          "disabled": false,
          "autoApprove": []
        }
      }
    }
  3. Claudeデスクトップを再起動します

クラインのために

  1. Cline MCP 設定ファイルを開きます。

    # macOS
    code ~/Library/Application\ Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
    
    # Windows
    code %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
  2. MCP サーバー構成を追加します。

    {
      "mcpServers": {
        "cloudflare-browser-rendering": {
          "command": "node",
          "args": ["/path/to/cloudflare-browser-rendering/dist/index.js"],
          "env": {
            "BROWSER_RENDERING_API": "https://your-worker-url.workers.dev"
          },
          "disabled": false,
          "autoApprove": []
        }
      }
    }

使用法

設定が完了すると、MCPサーバーはClaude DesktopとClineの両方で利用できるようになります。以下のツールをご利用いただけます。

フェッチページ

LLM コンテキストの Web ページを取得して処理します。

パラメータ:

  • url (必須): 取得するURL

  • maxContentLength (オプション): 返されるコンテンツの最大長

例:

Can you fetch and summarize the content from https://developers.cloudflare.com/browser-rendering/?

検索ドキュメント

Cloudflare のドキュメントを検索し、関連するコンテンツを返します。

パラメータ:

  • query (必須): 検索クエリ

  • maxResults (オプション): 返される結果の最大数

例:

Search the Cloudflare documentation for information about "browser rendering API".

構造化コンテンツの抽出

CSS セレクターを使用して Web ページから構造化コンテンツを抽出します。

パラメータ:

  • url (必須): コンテンツを抽出するURL

  • selectors (必須): コンテンツを抽出するための CSS セレクター

例:

Extract the main heading and first paragraph from https://developers.cloudflare.com/browser-rendering/ using the selectors h1 and p.

要約内容

LLM コンテキストをより簡潔にするために Web コンテンツを要約します。

パラメータ:

  • url (必須): 要約するURL

  • maxLength (オプション): 要約の最大長

例:

Summarize the content from https://developers.cloudflare.com/browser-rendering/ in 300 words or less.

スクリーンショット

Web ページのスクリーンショットを撮ります。

パラメータ:

  • url (必須): スクリーンショットを撮るURL

  • width (オプション): ビューポートの幅(ピクセル単位)(デフォルト: 1280)

  • height (オプション):ビューポートの高さ(ピクセル単位)(デフォルト:800)

  • fullPage (オプション): ページ全体のスクリーンショットを撮るか、ビューポートのみのスクリーンショットを撮るか (デフォルト: false)

例:

Take a screenshot of https://developers.cloudflare.com/browser-rendering/ with a width of 1024 pixels.

トラブルシューティング

ログ記録

MCP サーバーは、次のプレフィックスを持つ包括的なログ記録を使用します。

  • [Setup] :初期化と設定

  • [API] : APIリクエストとレスポンス

  • [Error] : エラー処理とデバッグ

ログを表示するには:

  • Claude デスクトップ: ~/Library/Logs/Claude/mcp*.log (macOS) または%APPDATA%\Claude\Logs\mcp*.log (Windows) のログを確認してください。

  • Cline : VSCode拡張機能の出力コンソールにログが表示されます

よくある問題

  1. 「BROWSER_RENDERING_API環境変数が設定されていません」

    • MCPサーバー設定でCloudflare Workerへの正しいURLが設定されていることを確認してください。

  2. 「CloudflareワーカーAPIは利用できないか、設定されていません」

    • Cloudflare Workerがデプロイされ、実行されていることを確認します

    • URLが正しくアクセス可能か確認してください

  3. 「ブラウザバインディングは利用できません」

    • Cloudflare Workerでブラウザレンダリングバインディングが設定されていることを確認してください。

  4. 「スクリーンショットKVバインディングは利用できません」

    • Cloudflare WorkerでKV名前空間バインディングが設定されていることを確認してください。

発達

プロジェクト構造

  • src/index.ts : メインエントリポイント

  • src/server.ts : MCP サーバーの実装

  • src/browser-client.ts : Cloudflare ブラウザレンダリングと対話するためのクライアント

  • src/content-processor.ts : LLMコンテキストのWebコンテンツを処理します

  • puppeteer-worker.js : Cloudflare Worker の実装

建物

npm run build

テスト

このプロジェクトには、すべての MCP ツールが正しく動作していることを確認する包括的なテスト スクリプトが含まれています。

npm test

これにより、次のようになります。

  1. MCPサーバーを起動する

  2. サンプルリクエストで各ツールをテストする

  3. 回答を確認する

  4. テスト結果の要約を提供する

特定のコンポーネントに対して個別のテストを実行することもできます。

# Test the Puppeteer integration
npm run test:puppeteer

テストが適切に機能するには、次のものを用意してください。

  1. npm run buildでプロジェクトをビルドしました

  2. BROWSER_RENDERING_API環境変数をCloudflare Worker URLに設定します。

  3. 必要なバインディングを使用してCloudflare Workerをデプロイしました

ライセンス

マサチューセッツ工科大学

Available Tools

5 tools
extract_structured_contentC

Extracts structured content from a web page using CSS selectors

Inputs: selectors (required), url (required).

fetch_pageC

Fetches and processes a web page for LLM context

Inputs: url (required), maxContentLength.

search_documentationC

Searches Cloudflare documentation and returns relevant content

Inputs: query (required), maxResults.

summarize_contentC

Summarizes web content for more concise LLM context

Inputs: url (required), maxLength.

take_screenshotB

Takes a screenshot of a web page and returns it as an image

Inputs: url (required), fullPage, height, width.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no overlap: extract_structured_content targets specific elements, fetch_page retrieves full pages, search_documentation queries documentation, summarize_content condenses content, and take_screenshot captures visual output. An agent can easily differentiate between these functions.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern with snake_case naming (e.g., extract_structured_content, fetch_page, search_documentation). This uniformity makes the toolset predictable and easy to understand for an agent.

    Tool Count5/5

    With 5 tools, this server is well-scoped for browser rendering and content processing tasks. Each tool earns its place by covering distinct aspects like fetching, extracting, searching, summarizing, and screenshotting, without being overly sparse or bloated.

    Completeness4/5

    The toolset covers core browser rendering workflows (fetching, extracting, summarizing, screenshotting) and includes a domain-specific search function. A minor gap exists in advanced interactions like form submission or navigation, but agents can work around this for most use cases.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      An MCP server that provides LLMs with stealth browser automation capabilities via CloakBrowser to bypass bot detection services like Cloudflare and reCAPTCHA. It supports full page interaction, content extraction, and human-like behavior through 30 specialized tools.
      20
      40 PyPI
      14
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      MCP server that lets Claude Code fetch web content using real Chrome browsers. Renders JavaScript-heavy pages, handles bot mitigation, and runs up to 14 parallel browsers locally with zero API keys. Makes outbound HTTP requests only to URLs the user explicitly asks Claude to fetch.
      2
      14 npm
      91
      MIT