Cloudflare MCP Server

by jmbish04

Not rated
GitHub

About

Deploy a remote, authentication-free MCP server on Cloudflare Workers.

Details

Author
jmbish04
Categories
Cloud Service, Other, Infrastructure

Option 1: One-Click Deploy Your Own MCP Memory to Cloudflare

Click button"Create and Deploy"

In Cloudflare dashboard, go to "Workers & Pages" and click on Visit
- Click the "Use this template" button at the top of this repository
- Clone your new repository
- Follow the setup instructions below

npm create cloudflare@latest --git https://github.com/puliczek/mcp-memory
npx wrangler vectorize create mcp-memory-vectorize --dimensions 1024 --metric cosine

- Your text is processed byCloudflare Workers AIusing the open-source@cf/baai/bge-m3model 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

- Your query is converted to a vector usingWorkers AIwith the same@cf/baai/bge-m3model
- Vectorize performs similarity search to find relevant memories
- Results are ranked by similarity score
- TheD1 databaseprovides the original text for matched vectors
- TheDurable Objectcoordinates the retrieval process

- 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.

MCP Memory implements several security measures to protect user data:

- Each user's memories are stored inisolated namespaceswithin Vectorize for data separation
- Built-inrate limitingprevents 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

MCP Memoryis aMCP Serverthat givesMCP Clients (Cursor, Claude, Windsurf and more)theability to rememberinformation 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.

Option 1: One-Click Deploy Your Own MCP Memory to Cloudflare

Click button"Create and Deploy"

In Cloudflare dashboard, go to "Workers & Pages" and click on Visit
- Click the "Use this template" button at the top of this repository
- Clone your new repository
- Follow the setup instructions below

npm create cloudflare@latest --git https://github.com/puliczek/mcp-memory
npx wrangler vectorize create mcp-memory-vectorize --dimensions 1024 --metric cosine

- Your text is processed byCloudflare Workers AIusing the open-source@cf/baai/bge-m3model 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

- Your query is converted to a vector usingWorkers AIwith the same@cf/baai/bge-m3model
- Vectorize performs similarity search to find relevant memories
- Results are ranked by similarity score
- TheD1 databaseprovides the original text for matched vectors
- TheDurable Objectcoordinates the retrieval process

- 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.

MCP Memory implements several security measures to protect user data:

- Each user's memories are stored inisolated namespaceswithin Vectorize for data separation
- Built-inrate limitingprevents 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

πŸ’° 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:

- Vectorize Pricing
-
Workers AI Pricing
-
Workers Pricing
-
Durable Objects Pricing
-
Database D1 Pricing
-

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

- Yes, you can host your own instance of MCP Memoryfor free on Cloudflare
- You'll need a Cloudflare account and the following services:

- Workers
- Vectorize
- D1 Database
- Workers AI

- Yes, you can run MCP Memory locally for development
- Usewrangler devto 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

- No, MCP Memory is specifically designed for Cloudflare's infrastructure

- I wanted an open-source solution
- Control over my own data was important to me

- 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

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.

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

- Node.js (v16 or later)
- A Cloudflare account with Browser Rendering enabled
- TypeScript
- Wrangler CLI (for deploying the Worker)

git clone https://github.com/yourusername/cloudflare-browser-rendering.git cd cloudflare-browser-rendering

- Install the Cloudflare Puppeteer package:

# wrangler.toml name = "browser-rendering-api" main = "puppeteer-worker.js" compatibility_date = "2023-10-30" compatibility_flags = ["nodejs_compat"] [browser] binding = "browser"

This experiment demonstrates how to use the Cloudflare Browser Rendering REST API to fetch and process web content:

This experiment demonstrates how to use the Cloudflare Browser Rendering Workers Binding API with Puppeteer for more advanced browser automation:

This experiment demonstrates how to extract and process web content specifically for use as context in LLMs:

The MCP server provides tools for fetching and processing web content using Cloudflare Browser Rendering for use as context in LLMs.

The MCP server provides the following tools:
- fetch_page- Fetches and processes a web page for LLM context
- search_documentation- Searches Cloudflare documentation and returns relevant content
- extract_structured_content- Extracts structured content from a web page using CSS selectors
- summarize_content- Summarizes web content for more concise LLM context

To use your Cloudflare Browser Rendering endpoint, set theBROWSER_RENDERING_APIenvironment variable:

export BROWSER_RENDERING_API=https://YOUR_WORKER_URL_HERE

ReplaceYOUR_WORKER_URL_HEREwith 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)

To integrate the MCP server with Cline, copy thecline_mcp_settings.json.examplefile 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 existingcline_mcp_settings.jsonfile.
- Cloudflare Browser Rendering requires the@cloudflare/puppeteerpackage 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();

This is a lightweight Model Control Protocol (MCP) server bootstrapped withcreate-mcpand deployed on Cloudflare Workers.

This MCP server allows agents (such as Cursor) to interface with theCloudflare REST API.

It's still under development, I will be adding more tools as I find myself needing them.

Seesrc/index.tsfor the current list of tools. Every method in the class is an MCP tool.
- 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

-

OpenCursor Settings -> MCP -> Add new MCP serverand 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

Add your Cloudflare API key and email to the.dev.varsfile:

CLOUDFLARE_API_KEY=<your-cloudflare-api-key> CLOUDFLARE_API_EMAIL=<your-cloudflare-api-email>

- Reload your Cursor window to see the new tools.

To create new MCP tools, add methods to theMyWorkerclass insrc/index.ts. Each function will automatically become an MCP tool that your agent can use.

/*  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 }

- First line becomes the tool's description
- @paramtags define the tool's parameters with types and descriptions
- @returntag specifies the return value and type

- Model Control Protocol Documentation
-
create-mcp Documentation
-
workers-mcp
-
Cloudflare Workers documentation
-
Cloudflare API Documentation

A self-hostable MCP server for deployment on Cloudflare Workers using Durable Objects.

Deploy a remote, authentication-free MCP server on Cloudflare Workers.

Multi-cloud deployment MCP server β€” deploy to Cloudflare Pages, Vercel, or Netlify from a single tool with 26 MCP tools.

The remote MCP bridge that lets any AI agent deploy, manage, and scale applications to Cloudflare, Netlify, or Vercel.

A remote, auth-less MCP server deployable on Cloudflare Workers or locally via npm.

A remote MCP server deployable on Cloudflare Workers with OAuth login support.

A remote MCP server deployable on Cloudflare Workers with OAuth login support.

Core AWS MCP server providing prompt understanding and server management capabilities.

An MCP service for deploying HTML content to EdgeOne Pages and obtaining a publicly accessible URL.

Create, build, deploy, and manage Netlify resources using natural language.

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.