# ZenBrain Memory

A local SQLite memory layer for agents that keeps facts, episodes, procedures, and working context across conversations. No account is required.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 27
- Author: zensation-ai
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/zensation-ai/zenbrain/tree/HEAD/packages/mcp
- Updated: 2026-10-18
- HTML: https://affpapa.org/en/nevibecode/mcp/zenbrain-memory

## What it does

ZenBrain Memory exposes five MCP tools for storing, recalling, deleting, consolidating, and checking memory. Stored content is routed automatically to procedural, episodic, semantic, or core memory using its wording and emotional weight. Working memory is searched only when requested.

The server runs over stdio and keeps data in a local SQLite file. It does not call an LLM or make network requests. Recall is lexical by default, ranking token overlap on a 0-to-1 score rather than matching related meanings. Consolidation runs only when a tool call starts it. Node.js 22 or newer is required, and the database file is unencrypted, so its location matters.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `ZENBRAIN_DB`, `ZENBRAIN_CONTEXTS` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env ZENBRAIN_DB=<ZENBRAIN_DB> --env ZENBRAIN_CONTEXTS=<ZENBRAIN_CONTEXTS> --transport stdio mcp -- npx -y @zensation/mcp
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add mcp --env ZENBRAIN_DB=<ZENBRAIN_DB> --env ZENBRAIN_CONTEXTS=<ZENBRAIN_CONTEXTS> -- npx -y @zensation/mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp": {
            "command": "npx",
            "args": [
                "-y",
                "@zensation/mcp"
            ],
            "env": {
                "ZENBRAIN_DB": "<ZENBRAIN_DB>",
                "ZENBRAIN_CONTEXTS": "<ZENBRAIN_CONTEXTS>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@zensation/mcp"
            ],
            "env": {
                "ZENBRAIN_DB": "<ZENBRAIN_DB>",
                "ZENBRAIN_CONTEXTS": "<ZENBRAIN_CONTEXTS>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e ZENBRAIN_DB=<ZENBRAIN_DB> -e ZENBRAIN_CONTEXTS=<ZENBRAIN_CONTEXTS> mcp npx -y @zensation/mcp
```
Replace <…> with your own values

## When to use it
- keep project decisions across agent sessions
- retrieve facts and procedures from memory
- remove stale entries with their linked copies
- turn high-weight episodes into semantic facts
- inspect the size of each memory layer

## Example prompts
- Save this project decision as a rule and keep it in long-term memory.
- Search memory for database setup procedures and return the relevant matches.
- Delete the memory with this id, then store the corrected version.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
