Second Brain Cloudflare

v1.0.0Knowledge & Memorystable

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

ai-memoryclaudeclaude-aiclaude-codecloudflare
Share:
76
Stars
0
Downloads
0
Weekly
0/5

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

Store notes and search by semantic meaning, not keywords.
Recall relevant context automatically across sessions with zero hosting cost.
rahilp

Maintainer

LicenseMIT License
Languagehtml
Versionv1.0.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx second-brain-cloudflare

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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.

2

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 deploy
3

Connect 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-URL
4

Or 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"
      }
    }
  }
}
5

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.

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.

Quick Config Preview

{ "mcpServers": { "second-brain-cloudflare": { "command": "npx", "args": ["-y", "second-brain-cloudflare"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides