jmbish04/custom-cloudflare-mcp-server
If you are the rightful owner of custom-cloudflare-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This document provides a structured summary of a Model Context Protocol (MCP) server, detailing its overview, features, tools, resources, usage, and FAQs.
MCP Memory
MCP Memory is a MCP Server that gives MCP Clients (Cursor, Claude, Windsurf and more) the ability to remember information about users (preferences, behaviors) across conversations. It uses vector search technology to find relevant memories based on meaning, not just keywords. It's built with Cloudflare Workers, D1, Vectorize (RAG), Durable Objects, Workers AI and Agents.
šŗ Video

š Try It Out
https://memory.mcpgenerator.com/
š ļø How to Deploy Your Own MCP Memory
Option 1: One-Click Deploy Your Own MCP Memory to Cloudflare
In Create Vectorize section choose:
- Dimensions: 1024
- Metric: cosine
Click button "Create and Deploy"
In Cloudflare dashboard, go to "Workers & Pages" and click on Visit
Option 2: Use this template
- Click the "Use this template" button at the top of this repository
- Clone your new repository
- Follow the setup instructions below
Option 3: Create with CloudFlare CLI
npm create cloudflare@latest --git https://github.com/puliczek/mcp-memory
š§ Setup (Only Option 2 & 3)
- Install dependencies:
npm install
- Create a Vectorize index:
npx wrangler vectorize create mcp-memory-vectorize --dimensions 1024 --metric cosine
- Install Wrangler:
npm run dev
- Deploy the worker:
npm run deploy
š§ How It Works
-
Storing Memories:
- Your text is processed by Cloudflare Workers AI using the open-source
@cf/baai/bge-m3
model to generate embeddings - The text and its vector embedding are stored in two places:
- Cloudflare Vectorize: Stores the vector embeddings for similarity search
- Cloudflare D1: Stores the original text and metadata for persistence
- A Durable Object (MyMCP) manages the state and ensures consistency
- The Agents framework handles the MCP protocol communication
- Your text is processed by Cloudflare Workers AI using the open-source
-
Retrieving Memories:
- Your query is converted to a vector using Workers AI with the same
@cf/baai/bge-m3
model - Vectorize performs similarity search to find relevant memories
- Results are ranked by similarity score
- The D1 database provides the original text for matched vectors
- The Durable Object coordinates the retrieval process
- Your query is converted to a vector using Workers AI with the same
This architecture enables:
- Fast vector similarity search through Vectorize
- Persistent storage with D1
- Stateful operations via Durable Objects
- Standardized AI interactions through Workers AI
- Protocol compliance via the Agents framework
The system finds conceptually related information even when the exact words don't match.
š Security
MCP Memory implements several security measures to protect user data:
- Each user's memories are stored in isolated namespaces within Vectorize for data separation
- Built-in rate limiting prevents abuse (100 req/min - you can change it in wrangler.jsonc)
- Authentication is based on userId only
- While this is sufficient for basic protection due to rate limiting
- Additional authentication layers (like API keys or OAuth) can be easily added if needed
- All data is stored in Cloudflare's secure infrastructure
- All communications are secured with industry-standard TLS encryption (automatically provided by Cloudflare's SSL/TLS certification)
š° Cost Information - FREE for Most Users
MCP Memory is free to use for normal usage levels:
- Free tier allows 1,000 memories with ~28,000 queries per month
- Uses Cloudflare's free quota for Workers, Vectorize, Worker AI and D1 database
For more details on Cloudflare pricing, see:
ā FAQ
-
Can I use memory.mcpgenerator.com to store my memories?
- Yes, you can use memory.mcpgenerator.com to store and retrieve your memories
- The service is free
- Your memories are securely stored and accessible only to you
- I cannot guarantee that the service will always be available
-
Can I host it?
- Yes, you can host your own instance of MCP Memory for free on Cloudflare
- You'll need a Cloudflare account and the following services:
- Workers
- Vectorize
- D1 Database
- Workers AI
-
Can I run it locally?
- Yes, you can run MCP Memory locally for development
- Use
wrangler dev
to run the worker locally - You'll need to set up local development credentials for Cloudflare services
- Note that some features like vector search or workers AI requires a connection to Cloudflare's services
-
Can I use different hosting?
- No, MCP Memory is specifically designed for Cloudflare's infrastructure
-
Why did you build it?
- I wanted an open-source solution
- Control over my own data was important to me
-
Can I use it for more than one person?
- Yes, MCP Memory can be integrated into your app to serve all your users
- Each user gets their own isolated memory space
-
Can I use it to store things other than memories?
- Yes, MCP Memory can store any type of text-based information
- Some practical examples:
- Knowledge Base: Store technical documentation, procedures, and troubleshooting guides
- User Behaviors: Track how users interact with features and common usage patterns
- Project Notes: decisions and project updates
- The vector search will help find related items regardless of content type
Cloudflare Browser Rendering Experiments & MCP Server
This project demonstrates how to use Cloudflare Browser Rendering to extract web content for LLM context. It includes experiments with the REST API and Workers Binding API, as well as an MCP server implementation that can be used to provide web context to LLMs.
Project Structure
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
Prerequisites
- Node.js (v16 or later)
- A Cloudflare account with Browser Rendering enabled
- TypeScript
- Wrangler CLI (for deploying the Worker)
Installation
- Clone the repository:
git clone https://github.com/yourusername/cloudflare-browser-rendering.git
cd cloudflare-browser-rendering
- Install dependencies:
npm install
Cloudflare Worker Setup
- Install the Cloudflare Puppeteer package:
npm install @cloudflare/puppeteer
- Configure Wrangler:
# wrangler.toml
name = "browser-rendering-api"
main = "puppeteer-worker.js"
compatibility_date = "2023-10-30"
compatibility_flags = ["nodejs_compat"]
[browser]
binding = "browser"
- Deploy the Worker:
npx wrangler deploy
- Test the Worker:
node test-puppeteer.js
Running the Experiments
Basic REST API Experiment
This experiment demonstrates how to use the Cloudflare Browser Rendering REST API to fetch and process web content:
npm run experiment:rest
Puppeteer Binding API Experiment
This experiment demonstrates how to use the Cloudflare Browser Rendering Workers Binding API with Puppeteer for more advanced browser automation:
npm run experiment:puppeteer
Content Extraction Experiment
This experiment demonstrates how to extract and process web content specifically for use as context in LLMs:
npm run experiment:content
MCP Server
The MCP server provides tools for fetching and processing web content using Cloudflare Browser Rendering for use as context in LLMs.
Building the MCP Server
npm run build
Running the MCP Server
npm start
Or, for development:
npm run dev
MCP Server Tools
The MCP server provides the following tools:
fetch_page
- Fetches and processes a web page for LLM contextsearch_documentation
- Searches Cloudflare documentation and returns relevant contentextract_structured_content
- Extracts structured content from a web page using CSS selectorssummarize_content
- Summarizes web content for more concise LLM context
Configuration
To use your Cloudflare Browser Rendering endpoint, set the BROWSER_RENDERING_API
environment variable:
export BROWSER_RENDERING_API=https://YOUR_WORKER_URL_HERE
Replace YOUR_WORKER_URL_HERE
with the URL of your deployed Cloudflare Worker. You'll need to replace this placeholder in several files:
- In test files:
test-puppeteer.js
,examples/debugging-tools/debug-test.js
,examples/testing/content-test.js
- In the MCP server configuration:
cline_mcp_settings.json.example
- In the browser client:
src/browser-client.ts
(as a fallback if the environment variable is not set)
Integrating with Cline
To integrate the MCP server with Cline, copy the cline_mcp_settings.json.example
file to the appropriate location:
cp cline_mcp_settings.json.example ~/Library/Application\ Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
Or add the configuration to your existing cline_mcp_settings.json
file.
Key Learnings
- Cloudflare Browser Rendering requires the
@cloudflare/puppeteer
package to interact with the browser binding. - The correct pattern for using the browser binding is:
import puppeteer from '@cloudflare/puppeteer'; // Then in your handler: const browser = await puppeteer.launch(env.browser); const page = await browser.newPage();
- When deploying a Worker that uses the Browser Rendering binding, you need to enable the
nodejs_compat
compatibility flag. - Always close the browser after use to avoid resource leaks.
cloudflare-api-mcp
This is a lightweight Model Control Protocol (MCP) server bootstrapped with create-mcp and deployed on Cloudflare Workers.
This MCP server allows agents (such as Cursor) to interface with the Cloudflare REST API.
It's still under development, I will be adding more tools as I find myself needing them.
Available Tools
See for the current list of tools. Every method in the class is an MCP tool.
Installation
- Run the automated install script to clone this MCP server and deploy it to your Cloudflare account:
bun create mcp --clone https://github.com/zueai/cloudflare-api-mcp
-
Open
Cursor Settings -> MCP -> Add new MCP server
and paste the command that was copied to your clipboard. -
Upload your Cloudflare API key and email to your worker secrets:
bunx wrangler secret put CLOUDFLARE_API_KEY
bunx wrangler secret put CLOUDFLARE_API_EMAIL
Local Development
Add your Cloudflare API key and email to the .dev.vars
file:
CLOUDFLARE_API_KEY=<your-cloudflare-api-key>
CLOUDFLARE_API_EMAIL=<your-cloudflare-api-email>
Deploying
- Run the deploy script:
bun run deploy
- Reload your Cursor window to see the new tools.
How to Create New MCP Tools
To create new MCP tools, add methods to the MyWorker
class in src/index.ts
. Each function will automatically become an MCP tool that your agent can use.
Example:
/**
* Create a new DNS record in a zone.
* @param zoneId {string} The ID of the zone to create the record in.
* @param name {string} The name of the DNS record.
* @param content {string} The content of the DNS record.
* @param type {string} The type of DNS record (CNAME, A, TXT, or MX).
* @param comment {string} Optional comment for the DNS record.
* @param proxied {boolean} Optional whether to proxy the record through Cloudflare.
* @return {object} The created DNS record.
*/
createDNSRecord(zoneId: string, name: string, content: string, type: string, comment?: string, proxied?: boolean) {
// Implementation
}
The JSDoc comments are important:
- First line becomes the tool's description
@param
tags define the tool's parameters with types and descriptions@return
tag specifies the return value and type