MCP Memory

MCP Memory

An MCP server that gives AI assistants the ability to remember user information (preferences, behaviors) across conversations using vector search technology.

Category
Visit Server

README

<div align="center" >🤝 Show your support - give a ⭐️ if you liked the content </div>


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

<a href="https://www.youtube.com/watch?feature=player_embedded&v=qfFvYERw2TQ" target="_blank"> <img src="https://github.com/Puliczek/mcp-memory/blob/main/video.png?raw=true" alt="Watch the video" width="800" height="450" border="10" /> </a>

🚀 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

Deploy 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

Visit MCP Memory

Option 2: Use this template

  1. Click the "Use this template" button at the top of this repository
  2. Clone your new repository
  3. 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)

  1. Install dependencies:
npm install
  1. Create a Vectorize index:
npx wrangler vectorize create mcp-memory-vectorize --dimensions 1024 --metric cosine
  1. Install Wrangler:
npm run dev
  1. Deploy the worker:
npm run deploy

🧠 How It Works

MCP Memory Architecture

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

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:

📧 Email API

In addition to storing arbitrary text, MCP Memory can capture emails and related metadata for improved context retrieval. The following endpoints are available:

POST /:userId/emails – Store a new email. Body fields: subject, body, sender, optional recipients array, date, messageId, inReplyTo, and company.

GET /:userId/emails – List stored emails for the user.

GET /:userId/emails/search?q=your+query[&company=acme] – Search stored emails semantically. The optional company parameter filters results by sender domain.

DELETE /:userId/emails/:memoryId – Remove an email from storage.

❓ FAQ

  1. 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
  2. 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
  3. 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
  4. Can I use different hosting?

    • No, MCP Memory is specifically designed for Cloudflare's infrastructure
  5. Why did you build it?

    • I wanted an open-source solution
    • Control over my own data was important to me
  6. 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
  7. 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

🤝 Show your support

<div>🤝 Show your support - give a ⭐️ if you liked the content</div>

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured