second-brain-cloudflare

by @rahilp

Second Brain Cloudflare MCP Server

Self-host a persistent personal and team AI memory layer in your own Cloudflare account (Workers, D1, Vectorize, Workers AI, KV) shared across Claude, ChatGPT, Cursor, Codex, and Claude Code via remote MCP (`https://YOUR-WORKER-URL/mcp`). Deploy via signed Desktop app, Cloudflare button, or CLI.

Memory & Knowledge884typescriptRemoteMIT

Server facts

second-brain-cloudflare MCP Server

GitHub stars

884

Last commit

Nov 30, 2026

Runtime

typescript

License

MIT

Tech

Runtime
typescript
Transports
streamable-http
Remote access
Yes
Authentication
OAuth or Authorization: Bearer token (AUTH_TOKEN)

Activity

GitHub stars
884
Last commit
Data as of

Tags

  • Claude
  • Cloudflare
  • Self Hosted
  • Semantic Search
  • ai
  • mcp
  • memory
  • vectorize

Overview

Individuals and teams exploring `second brain cloudflare mcp` (`rahilp/second-brain-cloudflare`, MIT license) can run a private TypeScript memory backend on Cloudflare Workers, D1 SQLite, Vectorize (384-dimension cosine index), Workers AI, and KV—sized to fit within Cloudflare's free tier for personal usage. Setup supports a code-signed macOS/Windows desktop app that provisions the Worker and links AI clients without terminal steps, a Deploy to Cloudflare button, or manual CLI provisioning via `npm` (`vectors:create` followed by `deploy`), plus an offline local QA harness (`npm run dev:local`). Remote MCP clients—including Claude, ChatGPT, Cursor, Codex, Claude Code, VS Code Copilot, and Gemini CLI—connect to `https://YOUR-WORKER-URL/mcp` via OAuth or an `Authorization: Bearer` `AUTH_TOKEN` header (query-string tokens were removed in v3).

Across its 20 memory tools (`remember`, `recall`, `append`, `update`, `brief`, `resolve`, `digest`, `history`, `list_projects`, `get_prompt_capsule`, `link`, `share`, and more), the Worker combines semantic Vectorize retrieval with full-text ranking, point-in-time `as_of` recall, duplicate/contradiction checks, named Projects, and Team Edition isolation separating `personal` workspaces from a shared `company` team layer. Deterministic KV-cached Prompt Capsules (`get_prompt_capsule`, capped at 12,000 characters with ETag revalidation) feed stable core or project prefixes to gateways, while Obsidian, Notion, Chrome, CLI, iOS Shortcuts, and IDE session hooks capture context from daily workflows. Note the README alert to upgrade older installs to 4.0.4 before December 5, 2026 so 90-day client connections do not lapse.

Install & configure

Requirements

  • Cloudflare account (Workers, D1, Vectorize with 384-dim cosine index, Workers AI, and KV — runs within free tier at personal scale)
  • macOS/Windows Desktop app, Deploy to Cloudflare button, or Node.js CLI (`npm install && npm run vectors:create && npm run deploy`)
  • Strong `AUTH_TOKEN` passphrase/secret (e.g., `openssl rand -base64 32`) or OAuth for remote `/mcp` client authentication
Documented launch / install command
npm install && npm run vectors:create && npm run deploy

Deploy via the signed Desktop app, Deploy to Cloudflare button, or CLI (`npm run vectors:create` followed by `npm run deploy`), then connect MCP clients to `https://YOUR-WORKER-URL/mcp` using OAuth or an `Authorization: Bearer` header. Append `?client=` to label activity in the dashboard.

Config file · macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

Use Settings → Developer → Edit Config when available. Do not assume a Linux configuration path; check the client documentation for your platform. Remote servers use the app’s connector flow when supported, not the local stdio file shown here. Merge this example with existing settings; do not overwrite unrelated servers.

A supported configuration example is not available for this client and transport. Check the client documentation for its connection flow; do not substitute an undocumented JSON format.

Read the Claude Desktop setup guide

Config file · Project: .cursor/mcp.json

User: ~/.cursor/mcp.json

The project path is relative to the workspace root. The tilde denotes your user home directory. Use Cursor’s MCP settings to confirm which configuration and scope your installed version is reading. Merge this example with existing settings; do not overwrite unrelated servers.

Cursor configuration
{
  "mcpServers": {
    "second-brain": {
      "url": "https://your-worker-url/mcp"
    }
  }
}

Read the Cursor setup guide

Config file · Workspace: .vscode/mcp.json

For user scope, use the “MCP: Open User Configuration” command if available. Do not guess a user configuration path across operating systems, profiles, containers, or remote workspaces; check the client documentation. Merge this example with existing settings; do not overwrite unrelated servers.

VS Code configuration
{
  "servers": {
    "second-brain": {
      "type": "http",
      "url": "https://your-worker-url/mcp"
    }
  }
}

Read the VS Code setup guide

Config file · macOS/Linux: ~/.codeium/windsurf/mcp_config.json

Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json

Open the MCP configuration through Windsurf’s settings when possible to confirm the active file. Paths can differ in managed or future releases; check the client documentation if this location is not present. Merge this example with existing settings; do not overwrite unrelated servers.

Windsurf configuration
{
  "mcpServers": {
    "second-brain": {
      "serverUrl": "https://your-worker-url/mcp"
    }
  }
}

Read the Windsurf setup guide

Config file · Project scope: .mcp.json at the repository root

The project file uses mcpServers. For user scope, use claude mcp add --scope user rather than assuming .mcp.json in your home directory is the user configuration. Check the client documentation for managed settings and storage details. Merge this example with existing settings; do not overwrite unrelated servers.

Claude Code configuration
{
  "mcpServers": {
    "second-brain": {
      "type": "http",
      "url": "https://your-worker-url/mcp"
    }
  }
}

Read the Claude Code setup guide

Examples are translated from the published configuration. Supply your own credentials and verify requirements in the upstream README. Remote connectors are shown only where a supported configuration format is known.

Tools

Source: repository README. Tool descriptions are a documented snapshot, not a live capability check.

ToolWhat it does
rememberStore decisions, preferences, ideas, and project context with optional validity dates, tags, workspace, and project.
appendAttach a timestamped update to an existing stored memory.
updateReplace the content or tags of an existing memory and optionally record when a fact stopped being true.
recallRetrieve memories by semantic meaning and full-text relevance, with optional `as_of` point-in-time filtering.
briefSurface due items, open commitments, stale memories, and pending insights.
resolveMark a tracked task, date, insight, or stale fact as resolved.
digestRead the latest automatic summary generated for a specific project or tag.
historyInspect recorded historical revisions of a memory along with prior text.
list_recentBrowse recently captured memories.
list_teamsList shared team workspaces you belong to (wired for future multi-team support; v3.0.0 supports a primary team).
list_projectsList registered projects in scope with display names, descriptions, and memory counts.
get_prompt_capsuleFetch a deterministic core or project prompt prefix projection cached in KV with strong ETag support.
getRead an individual memory record by its ID.
forgetMove a memory to the trash (recoverable via `undo`).
undoRevert the latest change to a memory or restore a trashed memory.
set_statusMark a memory as `canonical`, `draft`, or `deprecated`.
Create an explicit relationship edge between memories.
Remove an explicit relationship edge between memories.
connectionsList all memories linked to a specified memory.
shareMove a canonical memory between the private Personal workspace and the Shared team (`company`) layer.

Use cases

  • Recall architectural decisions, personal preferences, and past project updates consistently across Claude, ChatGPT, Cursor, and Codex without re-explaining context.
  • Share team-wide engineering policies on the `company` layer via `share` while keeping individual draft notes private in each member's `personal` workspace.
  • Serve deterministic, KV-cached Prompt Capsules (`get_prompt_capsule`) as stable system-prompt prefixes for custom AI gateways.
  • Auto-capture and recall session context via Claude Code, Codex CLI, Cursor, VS Code Copilot, and Gemini CLI hooks alongside Obsidian, Notion, and iOS Shortcuts.

Strengths

  • Full data sovereignty: D1 rows, Vectorize embeddings, KV cache, and credentials stay inside your own Cloudflare account within personal free-tier limits.
  • Rich 20-tool memory engine combining semantic + full-text search, `as_of` temporal recall, explicit graph links, revision history, and deterministic Prompt Capsules.
  • Team Edition keeps private `personal` workspaces isolated from admins while enabling canonical sharing on the `company` layer in the same Worker.
  • Broad capture ecosystem spanning remote MCP, CLI, web PWA with push reminders, Chrome extension, Obsidian, Notion, iOS Shortcuts, and coding-agent hooks.

Limitations

  • Requires a Cloudflare account and deploying a Worker (with Vectorize metadata indexing and re-embedding if upgrading older team brains).
  • Team Edition v3.0.0 currently supports a single shared team per brain; multi-team creation and switching are not yet exposed in the dashboard.
  • Session-start hooks are not yet available for Windsurf, OpenCode, or Oh My Pi, and pre-4.0.4 installs must update before December 5, 2026 to keep existing AI tool connections active.

second-brain-cloudflare setup notes

  • second-brain-cloudflare's example uses http, while its catalog transports are streamable-http; use the example's connection type.

Frequently asked questions

Choose the signed macOS/Windows Desktop app, the Deploy to Cloudflare button (setting `AUTH_TOKEN`, `DIMENSION=384`, `METRIC=cosine`), or manual CLI deployment (`npm install && npm run vectors:create && npm run deploy`). Once deployed, connect Claude, ChatGPT, Cursor, Codex, or Claude Code to `https://YOUR-WORKER-URL/mcp` using OAuth or an `Authorization: Bearer` header.

Related MCP servers