ZenBrain Memory — Claude Code MCP server: setup and use
A local SQLite memory layer for agents that keeps facts, episodes, procedures, and working context across conversations. No account is required.
claude mcp add --env ZENBRAIN_DB=<ZENBRAIN_DB> --env ZENBRAIN_CONTEXTS=<ZENBRAIN_CONTEXTS> --transport stdio mcp -- npx -y @zensation/mcpWhat ZenBrain Memory 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.
What it helps with
- 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 for the agent
- 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.
How to install ZenBrain Memory
Platform CLI
claude mcp add --env ZENBRAIN_DB=<ZENBRAIN_DB> --env ZENBRAIN_CONTEXTS=<ZENBRAIN_CONTEXTS> --transport stdio mcp -- npx -y @zensation/mcpReplace <…> with your own values
Platform CLI
codex mcp add mcp --env ZENBRAIN_DB=<ZENBRAIN_DB> --env ZENBRAIN_CONTEXTS=<ZENBRAIN_CONTEXTS> -- npx -y @zensation/mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@zensation/mcp"
],
"env": {
"ZENBRAIN_DB": "<ZENBRAIN_DB>",
"ZENBRAIN_CONTEXTS": "<ZENBRAIN_CONTEXTS>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@zensation/mcp"
],
"env": {
"ZENBRAIN_DB": "<ZENBRAIN_DB>",
"ZENBRAIN_CONTEXTS": "<ZENBRAIN_CONTEXTS>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e ZENBRAIN_DB=<ZENBRAIN_DB> -e ZENBRAIN_CONTEXTS=<ZENBRAIN_CONTEXTS> mcp npx -y @zensation/mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about ZenBrain Memory
How do I install ZenBrain Memory in Claude Code?
Install Node.js 22 or newer, then run claude mcp add zenbrain -- npx -y @zensation/mcp.
What does ZenBrain Memory do?
It gives an MCP client local agent memory backed by SQLite. The server can store, find, remove, consolidate, and inspect memories across several layers.
Is ZenBrain Memory semantic search?
Recall is lexical by default, so it compares tokens rather than related meanings. SQLite scans the store, and consolidation starts only when the corresponding tool is called.