claude-brain
Provides persistent memory storage using Supabase Postgres, allowing agents to save message exchanges, perform full-text search across stored history, retrieve recent messages, and list conversation sessions.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@claude-brainsearch my memory for what we discussed about the API design"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
claude-brain
A persistent memory layer for Claude. Every prompt/response exchange is logged to a Postgres database (Supabase), and an MCP server exposes tools so Claude itself can save and recall that history on demand — with full-text search.
Why
LLM conversations are ephemeral by default — close the session and the context is gone. This project gives Claude a durable, queryable memory: a database it can write to and search through the Model Context Protocol, plus (in progress) a web interface for browsing that history as a human.
Related MCP server: mcp-openmemory
Architecture
flowchart LR
A[Claude Desktop / Claude Code] -- "MCP (stdio)" --> B[claude-brain server]
B -- "@supabase/supabase-js" --> C[(Supabase Postgres)]
D[Web interface, Claude Design] -.planned.-> Csrc/server.ts— the MCP server, built on@modelcontextprotocol/sdk. Registers four tools:Tool
Purpose
save_memoryStore one message (role, content, model, metadata) under a session id
search_memoryFull-text search across everything ever stored
get_recent_memoryMost recent messages, optionally scoped to a session
list_conversationsList known sessions
supabase/migrations/0001_init.sql— schema:conversations(one row per session) andprompt_logs(one row per message, with a generatedtsvectorcolumn powering search).src/tools/— one module per tool, thin and independently testable wrappers around the Supabase client.tests/— Vitest suite covering input validation (Zod schemas) for every tool.
Tech stack
TypeScript · Node.js · Model Context Protocol SDK · Supabase (Postgres) · Zod · Vitest · GitHub Actions
Setup
Create a Supabase project at supabase.com.
Run the migration in
supabase/migrations/0001_init.sqlagainst it (via the SQL editor, orsupabase db pushif you link the project with the Supabase CLI).Copy
.env.exampleto.envand fill in your project's URL and service role key (Project Settings → API).Install, build, and run:
npm install npm run build npm run dev
Testing
npm run typecheck # tsc --noEmit
npm test # vitest — schema/validation coverage
npm run build # compiles to dist/
npm run smoke-test # spawns the real server over MCP and exercises every tool against SupabaseThe first three run in CI on every push (see .github/workflows/ci.yml). smoke-test
needs a real .env and isn't run in CI, but is the fastest way to sanity-check a
deployment end-to-end.
Connecting to Claude
Add this server to your MCP client config (e.g. Claude Desktop's
claude_desktop_config.json, or a Claude Code MCP config):
{
"mcpServers": {
"claude-brain": {
"command": "node",
"args": ["C:/Users/admin/projects/claude-brain/dist/server.js"],
"env": {
"SUPABASE_URL": "https://your-project-ref.supabase.co",
"SUPABASE_SERVICE_ROLE_KEY": "your-service-role-key"
}
}
}
}Run npm run build first so dist/server.js exists.
Roadmap
Deploy a read/search web interface (Vercel) designed with Claude Design
Auto-log every Claude Code/Desktop session without manual tool calls
Tagging / categorization of stored memories
Row-level security policies if the interface is ever exposed beyond local use
License
MIT — see LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent memory for AI agents across Claude, ChatGPT and any MCP client.
- mcpOAuthai.butlerbrain
Persistent memory for AI assistants. Save once; recall from Claude, ChatGPT, or any MCP client.
Persistent AI memory shared across Claude, ChatGPT, coding agents, and compatible MCP clients.
Private persistent memory for Claude, ChatGPT & Gemini via MCP - semantic search, zero-code setup.
Related MCP Servers
FlicenseNot gradedqualityDmaintenanceGives Claude Desktop, Cursor, Cline, and other MCP-compatible AI tools persistent memory, enabling them to store and recall information seamlessly across sessions.2 npm1-- AlicenseAqualityDmaintenanceEnables Claude to remember conversations and learn over time by storing and recalling messages, memory abstracts, and recent history using a local SQLite database.419 npm71MIT
- AlicenseNot gradedqualityDmaintenanceGives AI persistent personal memory with hybrid search, temporal decay, and knowledge graph. Works with Claude and any MCP client.73 npm8MIT

tribeRef MCP Serverofficial
AlicenseNot gradedqualityDmaintenanceProvides persistent tribal memory for Claude Code sessions, enabling querying of decisions and entities, logging artifacts, and managing tasks with Supabase.1MIT