Trilium backend
Why Trilium
- Self-hosted — your knowledge base never leaves your infrastructure.
- Structured query language — search by ancestor, attribute, content, modification date.
- First-class labels — every brain note gets
#claude-brain, retrievable by query. - Sync via Trilium’s own protocol or via shared Docker volume.
Install Trilium
docker run -d --name trilium \ -p 127.0.0.1:8787:8787 \ -v trilium-data:/home/node/trilium-data \ -e TRILIUM_NETWORK_TRUSTEDREVERSEPROXY=loopback \ triliumnext/notes:v0.95.0For production with HTTPS, put it behind nginx — see the TriliumNext deployment docs.
Generate an ETAPI token
In the Trilium UI: Options → ETAPI → Create new token. The token gives the MCP read/write access to your notes via the External API.
Configure the MCP
export BRAIN_BACKEND=trilium # default; can omitexport TRILIUM_URL=http://127.0.0.1:8787 # defaultexport TRILIUM_ETAPI_TOKEN=<your token>Or, for multi-user hosts, the adapter falls back to:
/etc/claude-brain/trilium-token(mode 0640, owner root:claude)~/.trilium-mcp/config.properties(compat with the trilium-mcp Java MCP)
Verify
brain_setup_checkYou should see:
backend: [ok] using trilium backendreachable: [ok] trilium reachable + credentials validroot_note: [ok] root note exists (id=...)Notes appear in Trilium as
- Root:
Claude Memory - Children:
00 — How to use this brain,Standards,Decisions,Lessons Learned,Apps,Reviews,Drafts - Each
brain_remembercall creates a child of the appropriate category, tagged#claude-brain - Body stored as plain text inside
<pre>blocks (round-trip-safe; no markdown rendering)