brain — the recorder MCP Server
io.github.mordechaipotash/brain-mcp
Records your Claude Code, Codex, and Pi conversation history before deletion with verifiable citations.
What is the brain — the recorder MCP server?
brain-mcp is an MCP server that captures and preserves your AI conversation history from Claude Code, Codex, and Pi before it is automatically deleted. It stores byte-exact copies locally in an append-only format and provides searchable access with cryptographic citations you can verify, ensuring your AI interactions remain queryable and auditable.
brain-mcp solves the problem of AI conversation history being automatically deleted by recording sessions at source before they expire. It maintains an immutable local archive with full-text search, time-ordered retrieval, and verifiable citations (file location, line span, SHA256 hash) so you can recall and cite your own AI work. Every search result is either cited with a checkable pointer or explicitly abstained—no guessing or filling gaps.
How to install brain — the recorder
Copy-paste configuration for popular MCP clients.
BRAIN_HOMEData directory for the floor (default ~/.brain)
Tools & capabilities
Tools this server exposes to the agent.
brain_search— BM25 full-text search over all recorded conversations; returns cited hits or explicit abstention naming lanes and dates searched.brain_get— Retrieves raw lines behind a citation with SHA256 verification to confirm the floor has not changed.brain_recent— Time-ordered recent activity across all sessions, with every row cited.brain_sessions— Session cards grouped by day and agent (Claude Code, Codex, Pi).brain_health— Per-lane freshness status (fresh/stale/unknown) comparing origin files to recorded floor.brain_capture_status— Reports whether the recording machinery is operating: spool, heartbeats, and floor writes.brain_backup— Verified backup that syncs lake and manifest to a destination, re-hashing sampled files to detect corruption.
Use cases
- Search your entire Claude Code, Codex, and Pi conversation history before it expires and is deleted.
- Retrieve and verify specific statements you made in past sessions using cryptographic citations.
- Track how your thinking evolved on a topic by viewing time-ordered search results with full citations.
- Audit the health and freshness of your recorded history to ensure no sessions were missed.
- Back up your conversation archive with integrity verification to prevent data loss.
brain — the recorder MCP server FAQ
brain-mcp is an MCP server that records your AI conversation history from Claude Code, Codex, and Pi before it is automatically deleted. It stores byte-exact copies locally with verifiable citations so you can search, retrieve, and audit your AI interactions.
Yes, brain-mcp is open-source under the MIT license. Installation is via pipx or uvx, and it runs entirely on your machine with no cloud or network calls.
Run `pipx install brain-mcp --pre`, then `brain-mcp install cc` to add hooks and a scheduler, and `brain-mcp serve` to start the MCP server. Alternatively, use the Claude Code plugin marketplace: `/plugin marketplace add mordechaipotash/brain-marketplace` and `/plugin install brain`.
No. brain-mcp runs entirely locally with zero network calls. It stores everything in `~/.brain/lake/` and uses no telemetry, cloud services, or external accounts.
Every search result includes a file path, line span, and SHA256 hash. You can verify any claim by running `sed -n 'A,Bp' file | shasum -a 256` on the command line—no database required.
The `brain_health` tool reports per-lane freshness as fresh, stale, or unknown. If any lane is stale or unknown, it means the recorder missed content; the tool explicitly names which lanes and dates were measured.
README (reference)
Source of truth, from the repository.
brain-mcp — the recorder for your AI conversations
Your AI history is being deleted right now. Claude Code deletes session files older
than cleanupPeriodDays (default 30) at startup. Run this and see your own cliff edge:
# macOS
find ~/.claude/projects -name '*.jsonl' -exec stat -f '%Sm %N' -t '%Y-%m-%d' {} + | sort | head -3
# Linux
find ~/.claude/projects -name '*.jsonl' -printf '%TY-%Tm-%Td %p\n' | sort | head -3
The oldest date you see is where your history ends. brain-mcp records it before it goes —
byte-exact, content-hashed, locally — and makes it queryable with citations you can verify
with sed and shasum.
Install
pipx install brain-mcp --pre # or: uvx brain-mcp
brain-mcp install cc # CC hooks + 60-second scheduler
brain-mcp serve # the MCP server (stdio) — add to your client config
Or as a Claude Code plugin (hooks + server in one step):
/plugin marketplace add mordechaipotash/brain-marketplace
/plugin install brain
What it does
- Captures at source. Claude Code via Stop/SessionEnd hooks (line-deltas + a final snapshot); Codex and Pi via a 60-second poll-scan. One spool, one floor.
- Keeps the bytes. The floor is
~/.brain/lake/<lane>/<session>.jsonl— append-only, byte-identical to the original, with an append-only sha256 manifest. Nothing is parsed and discarded; the DuckDB index is a cache, fully re-derivable from the lake. - Cites or abstains. Every search hit carries
{file, line span, sha256}— checkable by anyone withsed -n 'A,Bp' file | shasum -a 256, no database required. Zero hits return an explicit abstention naming the lanes and dates actually searched. - Reports health honestly.
fresh= the floor holds everything the agent's files show;stale= the agent has content the recorder missed;unknown= unmeasured, not healthy — never folded into "looks fine". - Backs up verifiably.
brain-mcp backup <dest>syncs lake+manifest and re-hashes sampled files at the destination. The verify can fail; that is the point. - Zero network calls at runtime. No telemetry, no cloud, no accounts. Verify it: there is no httpx/requests import in this package.
The 7 MCP tools
| tool | what |
|---|---|
brain_search | BM25 over everything recorded; cited hits or an explicit abstention |
brain_get | the raw lines behind a citation, with sha verification |
brain_recent | time-ordered recent activity, every row cited |
brain_sessions | session cards per day/agent |
brain_health | per-lane origin-vs-floor freshness; unknown ≠ healthy |
brain_capture_status | is the machinery itself moving (spool, heartbeats, floor) |
brain_backup | verified backup; writes only outside the floor |
🤖 For AI Assistants
You're reading this because your human runs THE RECORDER and gave you access to their AI history. This is the honesty contract.
The one rule: everything you state from these tools is either CITED or ABSTAINED —
there is no third state. A cited claim carries a checkable pointer (file + line span +
sha256); verify it with brain_get(expect_sha256=...) before building on it. An
abstention means "not found above threshold in the lanes and dates the tool measured" —
it does NOT mean "it never happened". Never fill an abstention with your own guess.
- Present recall as their words, dated: "On 2026-08-19 you wrote: '…' (sess-7f2a.jsonl:412)" — never as your own knowledge. One claim, one citation.
verified: falsefrom brain_get means the floor changed since indexing. Say so plainly.- A health response containing any
unknownlane is never "everything looks fine". The honest sentence is: "2 lanes fresh, 1 stale, 1 unmeasured." - "What do I think about X" →
brain_search(query, role="user"). "How did my thinking evolve" → addorder="time_asc"and read the citations in time order. The server has no opinion about your human's mind; it has their words, with receipts.
The floor format
~/.brain/
spool/<lane>/ hooks + scanner write here (atomic, dot-tmp invisible)
lake/<lane>/<session>.jsonl THE FLOOR: append-only, byte-identical to the origin;
a rewrite opens <session>.g2.jsonl — old kept, never deleted
manifest/manifest.jsonl one versioned line per chunk: byte range, line range, sha256
offsets/<lane>/<session> hook fast-path line counters
health/*.last_run side-effect heartbeats (mtimes are the proof, never a report)
brain.duckdb the index — a cache, re-derivable from lake/ + manifest/
Where your agents keep their transcripts: Claude Code ~/.claude/projects/**/*.jsonl
(rolling window!), Codex ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl, Pi
~/.pi/agent/sessions/**/*.jsonl.
Other verbs
brain-mcp record # one capture tick (the scheduler runs this every 60s)
brain-mcp health [--exit-nonzero-on-stale] # cron-able
brain-mcp doctor # capture status + health summary
brain-mcp redact <file> --lines A B --reason "..." # tombstone a secret; audited in manifest
brain-mcp migrate-v1 <all_conversations.parquet> # import v1 data (marked v1_derived)
brain-mcp uninstall # removes hooks + scheduler; your floor is KEPT
v1 → v2
v2 is a rebuild around one principle: capture the bytes first; derive everything else.
v1 parsed conversations into a parquet and discarded the originals — v2's floor makes that
structurally impossible. v1's 25 tools became 7: the synthesis tools ("cognitive patterns",
"switching cost") are gone because a claim that can't carry a line-span citation isn't one
this server makes. Migration: brain-mcp migrate-v1 — v1 rows are kept, marked as derived,
and floor-backed rows win wherever the source still exists.
Windows: out of scope for v2.0. Scheduling is LaunchAgent (macOS) / systemd user timer (Linux).
MIT.
Related MCP servers

VouchSpec Agent Skill Evidence
Read-only discovery for exact-commit Agent Skill validation, x402 payment, and signed receipts.
FORGE Swap — cross-chain swaps via THORChain. Quote and execute BTC, ETH, RUNE, USDC swaps.
View repository →
io.github.morebetterclaw/humanify-mcp
Transform AI-generated copy into human-sounding, GEO-optimised marketing content.

Morfiade
Manage local Chrome profiles on Windows: own cookies, sessions and proxy per profile.

io.github.morinokami/astro-mcp
MCP server providing runtime info, docs, and integration details for Astro projects

Flameox
Bounded local runtime evidence for coding agents—profile, benchmark, and analyze artifacts without workspace setup.