Second Brain Cloudflare
Self-hosted semantic memory layer for Claude and MCP-compatible AI clients. Store notes, search by meaning not keywords, and recall relevant context automatically across sessions. Runs free on Cloudflare Workers, D1, Vectorize, and Workers AI
What is Second Brain Cloudflare?
Second Brain Cloudflare is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to self-hosted semantic memory layer for claude and mcp-compatible ai clients. store notes, search by meaning not keywords, and recall relevant context automatically across sessions. runs free on cloudfl...
Self-hosted semantic memory layer for Claude and MCP-compatible AI clients. Store notes, search by meaning not keywords, and recall relevant context automatically across sessions. Runs free on Cloudflare Workers, D1, Vectorize, and Workers AI
This server falls under the Knowledge & Memory category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Self-hosted semantic memory layer for Claude and MCP-compati
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx second-brain-cloudflareConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Second Brain Cloudflare
Second Brain Cloudflare is a self-hosted semantic memory layer for Claude and other MCP-compatible AI clients, built entirely on free Cloudflare infrastructure: Workers for compute, D1 for structured storage, Vectorize for semantic embeddings, and Workers AI for generating those embeddings. It lets AI assistants store notes and context, then retrieve them by meaning rather than exact keywords, so relevant memories surface automatically across separate sessions. The entire stack runs at zero ongoing cost within Cloudflare's free tier, and the one-click deployment button makes setup a matter of minutes.
Prerequisites
- A Cloudflare account (free tier is sufficient)
- Wrangler CLI installed for manual deployment (npm install -g wrangler)
- Node.js installed for the CLI tool
- An MCP-compatible client such as Claude Desktop or Claude Code
- Your Cloudflare Worker URL after deployment
Deploy the Cloudflare Worker via one-click button
Visit the GitHub repository and click the 'Deploy to Cloudflare' button. This automatically provisions a Worker, D1 database, Vectorize index, and KV namespace in your Cloudflare account and sets up the AUTH_TOKEN secret.
Or deploy manually with Wrangler
Clone the repository, create the KV namespace, copy its ID into wrangler.toml, set your AUTH_TOKEN secret, and deploy. This gives you full control over configuration.
git clone https://github.com/rahilp/second-brain-cloudflare
cd second-brain-cloudflare
wrangler kv namespace create OAUTH_KV
# Paste the returned id into wrangler.toml under [[kv_namespaces]]
wrangler secret put AUTH_TOKEN
wrangler deployConnect AI clients using the setup script
Run the provided script with your Worker URL to automatically configure Claude Desktop, Claude Code, and other MCP clients on your machine.
curl -fsSL https://raw.githubusercontent.com/rahilp/second-brain-cloudflare/main/scripts/connect-ai-clients.sh | bash -s -- https://YOUR-WORKER-URLOr manually add the server to your MCP client config
Add the second-brain entry to your claude_desktop_config.json. The server URL and AUTH_TOKEN are the two required values.
{
"mcpServers": {
"second-brain": {
"command": "npx",
"args": ["-y", "second-brain-cf-cli"],
"env": {
"WORKER_URL": "https://your-worker.your-subdomain.workers.dev",
"AUTH_TOKEN": "your_auth_token"
}
}
}
}Verify the connection
Test that the Worker is live and the auth token works by sending a test memory capture via curl before connecting your AI client.
curl -X POST https://YOUR-WORKER-URL/capture \
-H "Authorization: Bearer YOUR-TOKEN" \
-H "Content-Type: application/json" \
-d '{"content": "second brain is working", "source": "test"}'Second Brain Cloudflare Examples
Client configuration
claude_desktop_config.json entry for Second Brain Cloudflare using the CLI package with Worker URL and auth token.
{
"mcpServers": {
"second-brain": {
"command": "npx",
"args": ["-y", "second-brain-cf-cli"],
"env": {
"WORKER_URL": "https://your-worker.your-subdomain.workers.dev",
"AUTH_TOKEN": "your_auth_token"
}
}
}
}Prompts to try
Example prompts that exercise the remember, recall, append, and forget tools.
- "Remember that the production database password is stored in 1Password under 'prod-db'."
- "What do I know about the Q3 project decisions we made last month?"
- "Store this context: we decided to use Postgres over MySQL for the new service because of JSONB support."
- "List my most recent memories."
- "Forget the memory about the old API endpoint deprecation timeline."Troubleshooting Second Brain Cloudflare
401 Unauthorized when the AI client tries to connect
Verify that AUTH_TOKEN in your MCP config env block matches exactly the secret set with wrangler secret put AUTH_TOKEN during deployment. Tokens are case-sensitive. Re-run wrangler secret put AUTH_TOKEN to reset it if needed.
recall returns empty results even though memories were stored
Ensure the Cloudflare Vectorize index was provisioned correctly. Check the Cloudflare dashboard under Workers AI > Vectorize for your index. If the index is missing, redeploy the Worker using the one-click button or re-run wrangler deploy.
Wrangler deploy fails with KV namespace errors
Run wrangler kv namespace create OAUTH_KV and copy the returned id into the wrangler.toml [[kv_namespaces]] section before deploying. The id must match exactly, including the production vs. preview id distinction.
Frequently Asked Questions about Second Brain Cloudflare
What is Second Brain Cloudflare?
Second Brain Cloudflare is a Model Context Protocol (MCP) server that self-hosted semantic memory layer for claude and mcp-compatible ai clients. store notes, search by meaning not keywords, and recall relevant context automatically across sessions. runs free on cloudflare workers, d1, vectorize, and workers ai It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Second Brain Cloudflare?
Follow the installation instructions on the Second Brain Cloudflare GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Second Brain Cloudflare?
Second Brain Cloudflare works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Second Brain Cloudflare free to use?
Yes, Second Brain Cloudflare is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
Second Brain Cloudflare Alternatives — Similar Knowledge & Memory Servers
Looking for alternatives to Second Brain Cloudflare? Here are other popular knowledge & memory servers you can use with Claude, Cursor, and VS Code.
MemPalace
★ 52.6kA local AI memory system that stores all conversations verbatim and organizes them into navigable structures. It provides 19 MCP tools for AI assistants to search and retrieve past decisions, debugging sessions, and architecture debates automatically
Kratos
★ 25.7k🏛️ Memory System for AI Coding Tools - Never explain your codebase again. MCP server with perfect project isolation, 95.8% context accuracy, and the Four Pillars Framework.
Context Mode
★ 15.4kAn MCP server that preserves LLM context by intercepting large data outputs and returning only concise summaries or relevant sections. It enables efficient sandboxed code execution, file processing, and documentation indexing across multiple programm
Memu
★ 13.7kMemory for 24/7 proactive agents like OpenClaw.
MemOS
★ 9.3kMemOS (Memory Operating System) is a memory management operating system designed for AI applications. Its goal is: to enable your AI system to have long-term memory like a human, not only remembering what users have said but also actively invoking, u
Everos
★ 5.4kBuild, evaluate, and integrate long-term memory for self-evolving agents.
Browse More Knowledge & Memory MCP Servers
Explore all knowledge & memory servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Second Brain Cloudflare in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Second Brain Cloudflare?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.