cloudflare-browser-rendering

cloudflare-browser-rendering

6

This project explores using Cloudflare Browser Rendering to aid language models by providing web context. It involves experiments and an MCP server to assist with web content extraction for LLMs.

Overview

This project showcases Cloudflare Browser Rendering, focusing on extracting web content for language model context. It includes experimental setups using the REST API and Workers Binding API and implements an MCP server to provide web context for LLMs.

Project Structure

  • Examples and utilities for implementations and debugging
  • Educational experiments focusing on REST API and Workers Binding API
  • MCP server source code, including browser client and content processing utilities

Prerequisites

  • Node.js (v16 or later)
  • A Cloudflare account with Browser Rendering enabled
  • TypeScript
  • Wrangler CLI for deployment

Installation

  1. Clone the repository
  2. Install dependencies

Cloudflare Worker Setup

  • Install Cloudflare Puppeteer package
  • Configure Wrangler
  • Deploy the Worker

Running Experiments

  • Basic REST API
  • Puppeteer Binding API
  • Content Extraction

MCP Server

Tools provided include content fetching, documentation searching, structured content extraction, and content summarizing.

Configuration

Set the BROWSER_RENDERING_API environment variable for your Cloudflare Worker.

Integration

Integrate with Cline by updating cline_mcp_settings.json.