BrainLayer MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
pip install brainlayer
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add brainlayer -- node "<FULL_PATH_TO_BRAINLAYER>/dist/index.js"

Replace <FULL_PATH_TO_BRAINLAYER>/dist/index.js with the actual folder you prepared in step 1.

README.md

Persistent memory and knowledge graph for AI agents

BrainLayer

Persistent memory and knowledge graph for AI agents — 9 MCP tools, real-time indexing hooks, and a native macOS daemon for always-on recall across every conversation.


224,000+ chunks indexed · 1,002 Python + 28 Swift tests · Real-time indexing hooks · 9 MCP tools · BrainBar daemon (209KB) · Zero cloud dependencies

Your AI agent forgets everything between sessions. Every architecture decision, every debugging session, every preference you've expressed — gone. You repeat yourself constantly.

BrainLayer fixes this. It's a local-first memory layer that gives any MCP-compatible AI agent the ability to remember, think, and recall across conversations. Includes BrainBar — a 209KB native macOS daemon that provides always-on memory access.

"What approach did I use for auth last month?"     →  brain_search
"Show me everything about this file's history"     →  brain_recall
"What was I working on yesterday?"                 →  brain_recall
"Remember this decision for later"                 →  brain_store
"Ingest this meeting transcript"                   →  brain_digest
"What do we know about this person?"               →  brain_get_person
"Look up the Domica project entity"                →  brain_entity

Quick Start

pip install brainlayer
brainlayer init              # Interactive setup wizard
brainlayer index             # Index your Claude Code conversations

Then add to your editor's MCP config:

Claude Code (~/.claude.json):

{
  "mcpServers": {
    "brainlayer": {
      "command": "brainlayer-mcp"
    }
  }
}
Other editors (Cursor, Zed, VS Code)

Cursor (MCP settings):

{
  "mcpServers": {
    "brainlayer": {
      "command": "brainlayer-mcp"
    }
  }
}

Zed (settings.json):

{
  "context_servers": {
    "brainlayer": {
      "command": { "path": "brainlayer-mcp" }
    }
  }
}

VS Code (.vscode/mcp.json):

{
  "servers": {
    "brainlayer": {
      "command": "brainlayer-mcp"
    }
  }
}

That's it. Your agent now has persistent memory across every conversation.

Architecture

graph LR
    A["Claude Code / Cursor / Zed"] -->|MCP| B["BrainLayer MCP Server9 tools"]
    B --> C["Hybrid Searchsemantic + keyword (RRF)"]
    C --> D["SQLite + sqlite-vecsingle .db file"]
    B --> KG["Knowledge Graphentities + relations"]
    KG --> D

    E["Claude Code JSONLconversations"] --> F["Pipeline"]
    F -->|extract → classify → chunk → embed| D
    G["Local LLMOllama / MLX"] -->|enrich| D

    H["Real-time Hooks"] -->|live per-message| D
    I["BrainBarmacOS daemon"] -->|Unix socket MCP| B

Everything runs locally. No cloud accounts, no API keys, no Docker, no database servers.

Component Implementation
Storage SQLite + sqlite-vec (single .db file, WAL mode)
Embeddings bge-large-en-v1.5 via sentence-transformers (1024 dims, runs on CPU/MPS)
Search Hybrid: vector similarity + FTS5 keyword, merged with Reciprocal Rank Fusion
Enrichment Local LLM via Ollama or MLX — 10-field metadata per chunk
MCP Server stdio-based, MCP SDK v1.26+, compatible with any MCP client
Clustering Leiden + UMAP for brain graph visualization (optional)
BrainBar Native macOS daemon (209KB Swift binary) — always-on MCP over Unix socket

MCP Tools (9)

Core (4)

Tool Description
brain_search Semantic search — unified search across query, file_path, chunk_id, filters.
brain_store Persist memories — ideas, decisions, learnings, mistakes. Auto-type/auto-importance.
brain_recall Proactive retrieval — current context, sessions, session summaries.
brain_tags Browse and filter by tag — discover what's in memory without a search query.

Knowledge Graph (5)

Tool Description
brain_digest Ingest raw content — entity extraction, relations, sentiment, action items.
brain_entity Look up entities in the knowledge graph — type, relations, evidence.
brain_expand Expa

Tools (6)

brain_searchUnified semantic and keyword search across query, file_path, chunk_id, and filters.
brain_storePersist memories including ideas, decisions, learnings, and mistakes.
brain_recallProactive retrieval of current context, sessions, and session summaries.
brain_tagsBrowse and filter memory by tag.
brain_digestIngest raw content for entity extraction, relations, sentiment, and action items.
brain_entityLook up entities in the knowledge graph including type, relations, and evidence.

Configuration

claude_desktop_config.json
{"mcpServers": {"brainlayer": {"command": "brainlayer-mcp"}}}

Try it

What approach did I use for auth last month?
Show me everything about this file's history
Remember this decision for later
What do we know about this person?
Look up the Domica project entity

Frequently Asked Questions

What are the key features of BrainLayer?

Hybrid search combining semantic vector embeddings and FTS5 keyword search. Knowledge graph extraction for entities and relations. Always-on memory access via BrainBar macOS daemon. Real-time indexing hooks for Claude Code conversations. Zero cloud dependencies with local SQLite storage.

What can I use BrainLayer for?

Maintaining context across long-running coding sessions. Storing architectural decisions and debugging history for future recall. Ingesting meeting transcripts to extract action items and entities. Building a personal knowledge base that AI agents can query.

How do I install BrainLayer?

Install BrainLayer by running: pip install brainlayer

What MCP clients work with BrainLayer?

BrainLayer works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep BrainLayer docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare