Content
<p align="center">
<img src="brainchair.png" alt="Brainchair" width="200">
</p>
<h1 align="center">Brainchair</h1>
<p align="center">
Shared memory MCP server for LLM applications.
</p>
<p align="center">
<sub><i>Named after the laundry chair every home has — the one you toss clothes onto instead of folding them into a shelf. Brainchair does the same for your memories and data: throw it on, sort it later (or never).</i></sub>
</p>
---
Brainchair is a [Model Context Protocol](https://modelcontextprotocol.io) server that gives Claude Code, Claude Desktop, and other MCP clients a single SQLite-backed memory they all read and write. Entries are organized by **kind** — a flexible, advisory type system that auto-registers on first use, generates SQL views, and exposes typed tools per kind.
## Install
Requires Go 1.23+ and a C compiler (CGO).
```bash
go build -tags "sqlite_fts5" -o brainchair .
```
The database lives at `~/.local/share/brainchair/brainchair.db` (override with `BRAINCHAIR_DB`). All clients share the same file via SQLite WAL mode.
## Configure
**Claude Code**
```bash
claude mcp add --transport stdio brainchair --scope user -- /path/to/brainchair
```
**Claude Desktop** — edit `claude_desktop_config.json`:
```json
{
"mcpServers": {
"brainchair": { "command": "/path/to/brainchair" }
}
}
```
## Tools
All entry tools accept arrays — single operations are just arrays of one.
**Entries:** `store_entries`, `get_entries`, `search_entries`, `update_entries`, `delete_entries`, `get_entries_history`, `list_tags`, `get_memory_map`
**Kinds:** `register_kinds`, `update_kinds`, `list_kinds`, `get_kinds`, `deprecate_kinds`, `canonicalize_kind`
**Auto-generated:** Each registered kind with examples gets a typed `store_<kind>` wrapper.
## Concepts
**Entry** — the core unit: `kind`, `domain`, `project`, `title`, `content`, `metadata` (JSON), `tags`, `source`.
**Kind** — an advisory type spec for a family of entries. Auto-registers on first unknown-kind write. Each kind gets a SQL view (`v_contacts`, `v_decisions`, …), expression indexes on queryable fields, and a typed wrapper tool.
**Memory map** — a compact summary of all stored knowledge, auto-injected into the LLM's context at session start via MCP `instructions`.
**History** — every update saves the previous version automatically (SQLite trigger). Retrieve via `get_entries_history`.
**Validation** — advisory by default: warnings on shape mismatch, not errors. Set `strict_enums` on a kind to reject invalid enum values.
## License
MIT