Web Content MCP Server
Cloudflare 浏览器渲染实验和 MCP 服务器
该项目演示了如何使用 Cloudflare 浏览器渲染为 LLM 上下文提取 Web 内容。它包含 REST API 和 Workers Binding API 的实验,以及可用于为 LLM 提供 Web 上下文的 MCP 服务器实现。
项目结构
cloudflare-browser-rendering/
├── examples/ # Example implementations and utilities
│ ├── basic-worker-example.js # Basic Worker with Browser Rendering
│ ├── minimal-worker-example.js # Minimal implementation
│ ├── debugging-tools/ # Tools for debugging
│ │ └── debug-test.js # Debug test utility
│ └── testing/ # Testing utilities
│ └── content-test.js # Content testing utility
├── experiments/ # Educational experiments
│ ├── basic-rest-api/ # REST API tests
│ ├── puppeteer-binding/ # Workers Binding API tests
│ └── content-extraction/ # Content processing tests
├── src/ # MCP server source code
│ ├── index.ts # Main entry point
│ ├── server.ts # MCP server implementation
│ ├── browser-client.ts # Browser Rendering client
│ └── content-processor.ts # Content processing utilities
├── puppeteer-worker.js # Cloudflare Worker with Browser Rendering binding
├── test-puppeteer.js # Tests for the main implementation
├── wrangler.toml # Wrangler configuration for the Worker
├── cline_mcp_settings.json.example # Example MCP settings for Cline
├── .gitignore # Git ignore file
└── LICENSE # MIT LicenseRelated MCP server: MCP Web Tools Server
先决条件
Node.js(v16 或更高版本)
已启用浏览器渲染的 Cloudflare 帐户
TypeScript
Wrangler CLI(用于部署 Worker)
安装
克隆存储库:
git clone https://github.com/yourusername/cloudflare-browser-rendering.git
cd cloudflare-browser-rendering安装依赖项:
npm installCloudflare Worker 设置
安装 Cloudflare Puppeteer 包:
npm install @cloudflare/puppeteer配置Wrangler:
# wrangler.toml
name = "browser-rendering-api"
main = "puppeteer-worker.js"
compatibility_date = "2023-10-30"
compatibility_flags = ["nodejs_compat"]
[browser]
binding = "browser"部署 Worker:
npx wrangler deploy测试 Worker:
node test-puppeteer.js运行实验
基本 REST API 实验
此实验演示了如何使用 Cloudflare 浏览器渲染 REST API 来获取和处理 Web 内容:
npm run experiment:restPuppeteer 绑定 API 实验
此实验演示了如何将 Cloudflare 浏览器渲染工作器绑定 API 与 Puppeteer 结合使用,实现更高级的浏览器自动化:
npm run experiment:puppeteer内容提取实验
此实验演示了如何提取和处理 Web 内容,专门用作 LLM 中的上下文:
npm run experiment:contentMCP 服务器
MCP 服务器提供使用 Cloudflare 浏览器渲染来获取和处理 Web 内容的工具,以用作 LLM 中的上下文。
构建 MCP 服务器
npm run build运行 MCP 服务器
npm start或者,对于开发来说:
npm run devMCP 服务器工具
MCP 服务器提供以下工具:
fetch_page- 获取并处理 LLM 上下文的网页search_documentation- 搜索 Cloudflare 文档并返回相关内容extract_structured_content- 使用 CSS 选择器从网页中提取结构化内容summarize_content- 总结网络内容以获得更简洁的 LLM 上下文
配置
要使用 Cloudflare 浏览器渲染端点,请设置BROWSER_RENDERING_API环境变量:
export BROWSER_RENDERING_API=https://YOUR_WORKER_URL_HERE将YOUR_WORKER_URL_HERE替换为您已部署的 Cloudflare Worker 的 URL。您需要在多个文件中替换此占位符:
在测试文件中:
test-puppeteer.js、examples/debugging-tools/debug-test.js、examples/testing/content-test.js在 MCP 服务器配置中:
cline_mcp_settings.json.example在浏览器客户端中:
src/browser-client.ts(如果未设置环境变量,则作为后备)
与 Cline 集成
要将 MCP 服务器与 Cline 集成,请将cline_mcp_settings.json.example文件复制到适当的位置:
cp cline_mcp_settings.json.example ~/Library/Application\ Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json或者将配置添加到您现有的cline_mcp_settings.json文件中。
关键学习
Cloudflare 浏览器渲染需要
@cloudflare/puppeteer包与浏览器绑定进行交互。使用浏览器绑定的正确模式是:
import puppeteer from '@cloudflare/puppeteer'; // Then in your handler: const browser = await puppeteer.launch(env.browser); const page = await browser.newPage();部署使用浏览器渲染绑定的 Worker 时,需要启用
nodejs_compat兼容性标志。使用后请务必关闭浏览器,以避免资源泄漏。
执照
麻省理工学院
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceA server that enables browser automation using Playwright, allowing interaction with web pages, capturing screenshots, and executing JavaScript in a browser environment through LLMs.1216,0661MIT
- Alicense-qualityDmaintenanceA Model Context Protocol server that allows LLMs to interact with web content through standardized tools, currently supporting web scraping functionality.1MIT
- AlicenseAqualityDmaintenanceThis MCP server provides tools for interacting with Cloudflare Browser Rendering, allowing you to fetch and process web content for use as context in LLMs directly from Cline or Claude Desktop.511MIT
- Flicense-qualityDmaintenanceA server that enables AI systems to browse, retrieve content from, and interact with web pages through the Model Context Protocol.1
Related MCP Connectors
Enable language models to perform advanced AI-powered web scraping with enterprise-grade reliabili…
Zenrows MCP server — Fetch, Extract, Batch, and Browser Sessions for AI coding assistants
Web intelligence for AI agents: fetch, render, extract, research. x402 micropayments, no API keys.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/amotivv/cloudflare-browser-rendering'
If you have feedback or need assistance with the MCP directory API, please join our Discord server