This 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.
What is amotivv cloudflare browser rendering mcp
Cloudflare Browser Rendering MCP Server
This MCP (Model Context Protocol) server provides tools for fetching and processing web content using Cloudflare Browser Rendering for use as context in LLMs. It's designed to work with both Claude and Cline client environments.
Features
- Web Content Fetching: Fetch and process web pages for LLM context
- Documentation Search: Search Cloudflare documentation and return relevant content
- Structured Content Extraction: Extract structured content from web pages using CSS selectors
- Content Summarization: Summarize web content for more concise LLM context
- Screenshot Capture: Take screenshots of web pages
Prerequisites
- Node.js v18 or higher
- A Cloudflare account with Browser Rendering API access
- A deployed Cloudflare Worker using the provided
puppeteer-worker.js
file
Installation
Installing via Smithery
To install Cloudflare Browser Rendering for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @amotivv/cloudflare-browser-rendering-mcp --client claude
-
Clone this repository:
git clone https://github.com/yourusername/cloudflare-browser-rendering.git cd cloudflare-browser-rendering
-
Install dependencies:
npm install
-
Build the project:
npm run build
Cloudflare Worker Setup
-
Deploy the
puppeteer-worker.js
file to Cloudflare Workers using Wrangler:npx wrangler deploy
-
Make sure to configure the following bindings in your Cloudflare Worker:
- Browser Rendering binding named
browser
- KV namespace binding named
SCREENSHOTS
- Browser Rendering binding named
-
Note the URL of your deployed worker (e.g.,
https://browser-rendering-api.yourusername.workers.dev
)
Configuration
For Claude Desktop
-
Open the Claude Desktop configuration file:
# macOS code ~/Library/Application\ Support/Claude/claude_desktop_config.json # Windows code %APPDATA%\Claude\claude_desktop_config.json
-
Add the MCP server configuration:
{ "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": [] } } }
-
Restart Claude Desktop
For Cline
-
Open the Cline MCP settings file:
# macOS code ~/Library/Application\ Support/claude-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
-
Add the MCP server configuration:
{ "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": [] } } }
Usage
Once configured, the MCP server will be available to both Claude Desktop and Cline. You can use the following tools:
fetch_page
Fetches and processes a web page for LLM context.
Parameters:
url
(required): URL to fetchmaxContentLength
(optional): Maximum content length to return
Example:
Can you fetch and summarize the content from https://developers.cloudflare.com/browser-rendering/?
search_documentation
Searches Cloudflare documentation and returns relevant content.
Parameters:
query
(required): Search querymaxResults
(optional): Maximum number of results to return
Example:
Search the Cloudflare documentation for information about "browser rendering API".
extract_structured_content
Extracts structured content from a web page using CSS selectors.
Parameters:
url
(required): URL to extract content fromselectors
(required): CSS selectors to extract content
Example:
Extract the main heading and first paragraph from https://developers.cloudflare.com/browser-rendering/ using the selectors h1 and p.
summarize_content
Summarizes web content for more concise LLM context.
Parameters:
url
(required): URL to summarizemaxLength
(optional): Maximum length of the summary
Example:
Summarize the content from https://developers.cloudflare.com/browser-rendering/ in 300 words or less.
take_screenshot
Takes a screenshot of a web page.
Parameters:
url
(required): URL to take a screenshot ofwidth
(optional): Width of the viewport in pixels (default: 1280)height
(optional): Height of the viewport in pixels (default: 800)fullPage
(optional): Whether to take a screenshot of the full page or just the viewport (default: false)
Example:
Take a screenshot of https://developers.cloudflare.com/browser-rendering/ with a width of 1024 pixels.
Troubleshooting
Logging
The MCP server uses comprehensive logging with the following prefixes:
[Setup]
: Initialization and configuration[API]
: API requests and responses[Error]
: Error handling and debugging
To view logs:
- Claude Desktop: Check the logs in
~/Library/Logs/Claude/mcp*.log
(macOS) or%APPDATA%\Claude\Logs\mcp*.log
(Windows) - Cline: Logs appear in the output console of the VSCode extension
Common Issues
-
"BROWSER_RENDERING_API environment variable is not set"
- Make sure you've set the correct URL to your Cloudflare Worker in the MCP server configuration
-
"Cloudflare worker API is unavailable or not configured"
- Verify that your Cloudflare Worker is deployed and running
- Check that the URL is correct and accessible
-
"Browser binding is not available"
- Ensure that you've configured the Browser Rendering binding in your Cloudflare Worker
-
"SCREENSHOTS KV binding is not available"
- Ensure that you've configured the KV namespace binding in your Cloudflare Worker
Development
Project Structure
src/index.ts
: Main entry pointsrc/server.ts
: MCP server implementationsrc/browser-client.ts
: Client for interacting with Cloudflare Browser Renderingsrc/content-processor.ts
: Processes web content for LLM contextpuppeteer-worker.js
: Cloudflare Worker implementation
Building
npm run build
Testing
The project includes a comprehensive test script that verifies all MCP tools are working correctly:
npm test
This will:
- Start the MCP server
- Test each tool with sample requests
- Verify the responses
- Provide a summary of test results
You can also run individual tests for specific components:
# Test the Puppeteer integration
npm run test:puppeteer
For the tests to work properly, make sure you have:
- Built the project with
npm run build
- Set the
BROWSER_RENDERING_API
environment variable to your Cloudflare Worker URL - Deployed the Cloudflare Worker with the necessary bindings
License
MIT
Leave a Comment
Frequently Asked Questions
What is MCP?
MCP (Model Context Protocol) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications, providing a standardized way to connect AI models to different data sources and tools.
What are MCP Servers?
MCP Servers are lightweight programs that expose specific capabilities through the standardized Model Context Protocol. They act as bridges between LLMs like Claude and various data sources or services, allowing secure access to files, databases, APIs, and other resources.
How do MCP Servers work?
MCP Servers follow a client-server architecture where a host application (like Claude Desktop) connects to multiple servers. Each server provides specific functionality through standardized endpoints and protocols, enabling Claude to access data and perform actions through the standardized protocol.
Are MCP Servers secure?
Yes, MCP Servers are designed with security in mind. They run locally with explicit configuration and permissions, require user approval for actions, and include built-in security features to prevent unauthorized access and ensure data privacy.
Related MCP Servers
AWS Knowledge Base Retrieval
An MCP server implementation for retrieving information from the AWS Knowledge Base using the Bedrock Agent Runtime.
chrisdoc hevy mcp
sylphlab pdf reader mcp
An MCP server built with Node.js/TypeScript that allows AI agents to securely read PDF files (local or URL) and extract text, metadata, or page counts. Uses pdf-parse.
aashari mcp server atlassian bitbucket
Node.js/TypeScript MCP server for Atlassian Bitbucket. Enables AI systems (LLMs) to interact with workspaces, repositories, and pull requests via tools (list, get, comment, search). Connects AI directly to version control workflows through the standard MCP interface.
aashari mcp server atlassian confluence
Node.js/TypeScript MCP server for Atlassian Confluence. Provides tools enabling AI systems (LLMs) to list/get spaces & pages (content formatted as Markdown) and search via CQL. Connects AI seamlessly to Confluence knowledge bases using the standard MCP interface.
prisma prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB
Zzzccs123 mcp sentry
mcp sentry for typescript sdk
zhuzhoulin dify mcp server
zhongmingyuan mcp my mac
zhixiaoqiang desktop image manager mcp
MCP 服务器,用于管理桌面图片、查看详情、压缩、移动等(完全让Trae实现)
Submit Your MCP Server
Share your MCP server with the community
Submit Now