modelscope·@amotivv/cloudflare-browser-rendering
一个利用 Cloudflare 浏览器渲染来提取和处理网页内容以供大型语言模型(LLMs)作为上下文使用的服务器,提供抓取页面、搜索文档、提取结构化内容和总结内容的工具。
该项目展示了如何使用 Cloudflare 浏览器渲染来提取用于 LLM 上下文的网页内容。它包括对 REST API 和 Workers 绑定 API 的实验,以及一个可以用来为 LLLMs 提供网页上下文的 MCP 服务器实现。
<a href="https://glama.ai/mcp/servers/wg9fikq571"> <img width="380" height="200" src="https://glama.ai/mcp/servers/wg9fikq571/badge" alt="Web Content Server MCP server" /> </a>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 License
git clone https://github.com/yourusername/cloudflare-browser-rendering.git
cd cloudflare-browser-rendering
npm install
npm install @cloudflare/puppeteer
# wrangler.toml
name = "browser-rendering-api"
main = "puppeteer-worker.js"
compatibility_date = "2023-10-30"
compatibility_flags = ["nodejs_compat"]
[browser]
binding = "browser"
npx wrangler deploy
node test-puppeteer.js
此实验展示了如何使用 Cloudflare 浏览器渲染 REST API 来获取和处理网页内容:
npm run experiment:rest
此实验展示了如何使用 Cloudflare 浏览器渲染 Workers 绑定 API 结合 Puppeteer 来进行更高级的浏览器自动化:
npm run experiment:puppeteer
此实验展示了如何提取并处理网页内容以特别作为 LLMs 的上下文使用:
npm run experiment:content
MCP 服务器提供了利用 Cloudflare 浏览器渲染获取和处理网页内容的工具,这些内容可作为 LLMs 的上下文使用。
npm run build
npm start
或者,在开发模式下运行:
npm run dev
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.jscline_mcp_settings.json.examplesrc/browser-client.ts(如果未设置环境变量,则作为后备)要将 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/puppeteer 包来与浏览器绑定进行交互。import puppeteer from '@cloudflare/puppeteer';
// 然后在你的处理函数中:
const browser = await puppeteer.launch(env.browser);
const page = await browser.newPage();
nodejs_compat 兼容性标志。MIT
快递100 MCP Server提供快递信息查询、快递运费预估比价、快递时效查询(含发货前时效查询与在途动态时效查询)等功能。
暂无描述。
一个提供网页开发工具的MCP服务器,例如屏幕捕捉功能,可以让AI代理获取并处理用户屏幕的截图。
一个从网站提取有意义内容并将HTML转换为高质量Markdown的MCP服务器,使用Mozilla的Readability引擎。
一种模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页交互,而无需使用视觉模型或截图。
桌面通知、个性化声音、ntfy 手机应用通知、邮件通知和 API 推送,减少 AI 任务等待焦虑,舒适地享用一杯咖啡。