loading…
Search for a command to run...
loading…
A personal semantic knowledge base that enables storing, searching, and retrieving memories and work history using natural language. It features vector-based se
A personal semantic knowledge base that enables storing, searching, and retrieving memories and work history using natural language. It features vector-based search, tool discovery via a registry, and indexing of Cursor agent transcripts using Supabase or Postgres.
A personal semantic knowledge base exposed as MCP tools. Store, search, and retrieve memories using natural language across Cursor, Claude Desktop, or any MCP-compatible client.
| Tool | Description |
|---|---|
search_brain |
Semantic similarity search across all memories |
add_memory |
Embed and store a new piece of knowledge |
recall |
Filtered list retrieval by source, tags, or date — no embedding needed |
forget |
Delete a memory by UUID |
brain_stats |
Counts and breakdown by source |
discover_tools |
Semantic search across the tool registry (Toolshed) |
index_cursor_chats |
Index Cursor agent transcripts as searchable work history |
search_work_history |
Keyword search across raw Cursor transcript files |
cd mcp-server
npm install
cp .env.example .env
# edit .env with your credentials
All configuration is via environment variables in .env.
| Variable | Description |
|---|---|
OPENROUTER_API_KEY |
Used to generate embeddings via OpenRouter |
The server supports two database backends. Set DB_BACKEND to choose (default: supabase).
DB_BACKEND=supabase
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
Point the server at any Postgres instance with the pgvector extension and the brain_memories schema applied.
DB_BACKEND=postgres
DATABASE_URL=postgresql://user:password@host:5432/dbname
Both backends use the same schema and the same
match_memoriesSQL function. See Database Schema below.
| Variable | Default | Description |
|---|---|---|
EMBEDDING_MODEL |
openai/text-embedding-3-small |
OpenRouter embedding model |
EMBEDDING_DIMENSIONS |
1536 |
Must match the model output and schema |
MCP_HTTP_PORT |
3100 |
Port for the HTTP/SSE transport |
CURSOR_TRANSCRIPTS_DIR |
— | Path to Cursor agent-transcripts directory; enables index_cursor_chats and search_work_history |
npm run dev:stdio # development (tsx)
npm run start:stdio # production (compiled JS)
Add to .cursor/mcp.json:
{
"mcpServers": {
"open-brain": {
"command": "npx",
"args": ["tsx", "/path/to/mcp-server/src/stdio.ts"],
"env": {
"DB_BACKEND": "supabase",
"SUPABASE_URL": "...",
"SUPABASE_SERVICE_ROLE_KEY": "...",
"OPENROUTER_API_KEY": "..."
}
}
}
}
To use raw Postgres instead, swap the env block:
{
"env": {
"DB_BACKEND": "postgres",
"DATABASE_URL": "postgresql://user:pass@host:5432/dbname",
"OPENROUTER_API_KEY": "..."
}
}
npm run dev:http # development
npm run start:http # production
Endpoints:
| Endpoint | Description |
|---|---|
GET /sse |
SSE stream (MCP SSE transport) |
POST /messages |
MCP message handling |
GET /health |
Health check |
Both backends require the following on the Postgres instance:
pgvector extension (for halfvec type)brain_memories tablematch_memories SQL functionbrain_stats viewSchema is managed via the migrations in supabase/migrations/. For a raw Postgres instance, run the migration files in order against your database:
001_initial_schema.sql
002_open_brain.sql
003_brain_rls.sql
004_vector_halfvec.sql
005_uuid_default.sql
006_storage_fillfactor.sql
007_column_reorder.sql
CREATE TABLE brain_memories (
id uuid NOT NULL DEFAULT gen_random_uuid(),
created_at timestamptz DEFAULT NOW(),
updated_at timestamptz DEFAULT NOW(),
source text NOT NULL DEFAULT 'manual',
content text NOT NULL,
tags text[] DEFAULT '{}',
source_metadata jsonb DEFAULT '{}',
embedding halfvec(1536)
);
Valid source values: manual, telegram, cursor, api, conversations, knowledge, work_history, toolshed.
The Toolshed (discover_tools) solves the "tool explosion" problem. Instead of injecting hundreds of MCP tool schemas into the agent context, the agent calls discover_tools with a natural language query and gets back only the tools relevant to the current task.
Tool descriptions are loaded from tool-registry.json and embedded into brain_memories (source toolshed) at startup. Indexing is idempotent.
When CURSOR_TRANSCRIPTS_DIR is set, two additional tools are enabled:
index_cursor_chats — reads JSONL transcript files from the directory, embeds each session summary, and stores it as a work_history memory. Re-running is idempotent (already-indexed sessions are skipped).search_work_history — keyword search across raw transcript files for exact phrase matching. Complements the semantic search_brain.CURSOR_TRANSCRIPTS_DIR=/Users/you/.cursor/projects/.../agent-transcripts
npm run build # compile TypeScript to dist/
npm run dev:stdio # run stdio server with tsx (hot reload)
npm run dev:http # run HTTP server with tsx (hot reload)
Run in your terminal:
claude mcp add open-brain-mcp-server -- npx Yes, Open Brain Server MCP is free — one-click install via Unyly at no cost.
No, Open Brain Server runs without API keys or environment variables.
Self-hosted: the server runs locally on your machine via the install command above.
Open Open Brain Server on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Query your database in natural language
by AnthropicA universal database MCP server supporting simultaneous connections to multiple databases. It provides tools for database operations, health analysis, SQL optim
by wenb1n-devThis server enables interaction with PostgreSQL databases through the Model Context Protocol, optimized for the AWS Bedrock AgentCore Runtime. It provides tools
by madhurprashRead-only database access with schema inspection.
by modelcontextprotocolNot sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All data MCPs