Open source · MIT · Claude Code + Obsidian

A second brain that grows itself.

Mimisbrunn turns a folder of markdown into a memory your AI maintains for you: it ingests email, meetings and quick captures, links every fact to its source, and serves it to Claude on every device through MCP.

9MCP tools
3search lanes, RRF-fused
14 msmedian search, 900 pages
0databases to run
claude — ~/my-brain

    
What you get

Everything a second brain needs, none of the lock-in.

Plain markdown with YAML frontmatter and [[wikilinks]]. Git is the database. Claude Code is the librarian.

Typed entities

People, clients, projects, tools, concepts, places, recipes — each one file, each with a one-sentence description that drives recall, sources, confidence and freshness.

MCP on every device

One Python file exposes search, outline, get, related, recent, append and create. Run it over stdio locally or behind a token on Docker for the Claude app, claude.ai and other agents.

Search that is measured

BM25, weighted term-match and a local embedding lane fused with reciprocal rank fusion. Two deterministic evals keep it honest: retrieval-eval.py reports recall@5 0.98, MRR 0.84 and section coverage 0.86, and answer-eval.py runs the whole tool chain for groundedness 0.93 and abstention 1.00 — so a ranking change is a number that moved, not an impression — and it is fast: 14 ms median and 25 ms at p95 across 907 pages, 257 ms to re-read the whole vault. bench.py re-measures all of it, so the numbers on this page can be checked rather than believed.

Ingest that keeps receipts

Email, meeting transcripts and phone captures land in the vault with their source path. Contradictions are flagged, never overwritten. Nothing is deleted; merges leave redirects.

Freshness by design

Stale pages by type, undated prices and versions, missing provenance — one lint script lists them. Archived things stop nagging; active things get downweighted when they go quiet.

Secrets stay out

The schema forbids keys and passwords, a pre-commit hook refuses staged Resend, GitHub, OpenAI, AWS, Slack, Google and Stripe key formats, and CI runs gitleaks and trivy on every push. A second workflow runs selftest.py, which asserts the exact tool and prompt surface, so a patch that silently deletes half the server turns the build red instead of quietly shipping. A third, no-private-data.py, checks that no email address, public IP or phone number reaches this public repository — a secret scanner never looks for those, because they only matter depending on whose they are. The remote server compares its token in constant time and keeps credentials out of .git/config.

Routines that reflect

Cloud routines for ingest, pre-meeting briefs, weekly digest, lint and a Sunday “reflect” pass that rewrites summaries and proposes merges — proposals only, you decide.

How it works

Sources in, structure out, questions answered anywhere.

email · IMAP export meetings · transcripts captures · mail / Telegram conversations · /wiki-save ingest routinesclassify · link · cite the vaultmarkdown · frontmatter · git_index · hubs · review-queue MCP serverstdio · http + token Claude Code Claude app · claude.ai other agents lint · freshness · eval weekly reflect
MCP tools

Work in layers: search, outline, then only the section you need.

Compact hits first (about 60 tokens each), then the outline, then one section. Read-only tools are annotated as such; write tools commit and push.

ToolWhat it does
wiki_searchQuery across entity, aliases, description, tags and body. Three lanes (BM25 · weighted match · embeddings) fused with RRF; stale pages weigh less; redirects hidden. Returns slug, type, description, path, score, snippet.
wiki_outlineFrontmatter head plus every ## section with its first line and length. Cheap way to decide what to read.
wiki_getA whole page, or just one section with section=. Cite as path#heading.
wiki_relatedOutbound and inbound links, dead links, and semantic neighbours.
wiki_recentPages changed in the last N days by last_updated.
wiki_handoverThe latest task handover, so a new session continues where the last one stopped.
wiki_statsPages per type, dirty files, last commits.
wiki_appendAdd knowledge to a page with section and source. Deterministic contradiction check on email, phone, prices, versions, contact person and hosting → callout + review queue.
wiki_createNew page following the schema. Refuses duplicates and anything that looks like a secret.
Docs · quick start

From clone to a working brain in ten minutes.

You need Claude Code, Python 3.10+ and Obsidian (optional but recommended). Everything else is in the repo.

1

Clone and name it

Run the setup interview inside Claude Code. It asks for your name, role and stack and creates the first entities.

git clone https://github.com/mahope/mimisbrunn.git my-brain cd my-brain && claude > /wiki-setup
2

Turn on the secret gate

A pre-commit hook blocks API keys, tokens and private keys before they reach git.

git config core.hooksPath .githooks
3

Serve it to Claude

Register the MCP server once; every Claude Code session can now search and write to the brain.

pip install "mcp>=1.12,<2" pyyaml fastembed claude mcp add wiki -s user -- python /path/to/my-brain/scripts/wiki-mcp-server.py
4

Use it from your phone

Deploy deploy/wiki-mcp/ with Docker (Dokploy compose included), then add it as a custom connector in the Claude app with a Bearer token.

claude mcp add --transport http wiki-remote https://YOUR-DOMAIN/mcp \ --header "Authorization: Bearer <token>"

Skills

/wiki-save quick update · /wiki-query ask the brain · /wiki-ingest one source · /wiki-auto-ingest batch · /wiki-lint quality · /wiki-review confidence graduation · /wiki-learn before compaction · /wiki-handover and /wiki-resume across sessions · /wiki-import for ChatGPT, Claude, LinkedIn, Facebook, Google Takeout and Notion exports.

Scripts

wiki-lint.py dead links, orphans, duplicate slugs · wiki-freshness.py frontmatter, stale pages per type, undated values, missing sources · retrieval-eval.py recall@5 / MRR · answer-eval.py groundedness and abstention · selftest.py 21 invariants of the MCP tool surface · claims.py which claims a live source could verify · open-actions.py actions written down and never done · dns-check.py domains that no longer resolve · wiki-merge.py merge with redirect stub, --candidates · regen-index.py index and hub pages · completeness-score.py, gen-dashboard.py, gen-graph.py.

Hooks for Claude Code

wiki-context.py runs at session start and injects the critical facts plus the pages that match the project folder you opened. wiki-autocommit.py commits only the wiki file you changed and aborts a failed rebase instead of leaving the vault broken. See docs/automation-setup.md.

Capture from anywhere: forward a mail to your brain’s address, or message the optional Telegram bot (deploy/wiki-inbox/). A daily triage routine files it on the right page or parks it in the review queue — it never invents new pages.

Questions people ask

Does it need a vector database?

No. Search runs on SQLite FTS5 (BM25) plus an optional local embedding index built with fastembed. The markdown files remain the source of truth; the index is rebuilt from them and is git-ignored.

What happens when two sources disagree?

The new value goes into the text, the old one is preserved in a warning callout, and a line is added to _review-queue.md. Nothing is silently overwritten.

Can I run it without Claude?

The vault is plain markdown and the MCP server speaks the open Model Context Protocol, so any MCP client works. The skills and hooks are written for Claude Code.

Is anything sent anywhere?

Only what you configure. The template contains no keys, and the pre-commit hook blocks secrets. Embeddings are computed locally. Cloud routines are optional.

The name

Mímisbrunnr, the well of Mímir.

In Norse myth, Mímir’s well lies beneath one of the roots of Yggdrasil and holds all wisdom and memory. Odin gave an eye for a single drink from it. This project is a smaller bargain: give your notes a schema and a librarian, and the well fills itself.

All wisdom is in the well; the price is that you keep drawing from it.Gylfaginning, loosely — and the maintenance rule of every second brain that survives