# obsidian-brain [![npm version](https://img.shields.io/npm/v/obsidian-brain.svg)](https://www.npmjs.com/package/obsidian-brain) [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Node โ‰ฅ 20](https://img.shields.io/node/v/obsidian-brain.svg)](package.json) [![GitHub stars](https://img.shields.io/github/stars/sweir1/obsidian-brain.svg?style=social)](https://github.com/sweir1/obsidian-brain) A standalone Node MCP server that gives Claude (and any other MCP client) **semantic search + knowledge graph + vault editing** over an Obsidian vault. Runs as one local stdio process โ€” no plugin, no HTTP bridge, no API key, nothing hosted. Your vault content never leaves your machine. > ๐Ÿ“– **Full docs โ†’ [sweir1.github.io/obsidian-brain](https://sweir1.github.io/obsidian-brain/)** > **Companion plugin** โ†’ [`sweir1/obsidian-brain-plugin`](https://github.com/sweir1/obsidian-brain-plugin) (optional โ€” unlocks `active_note`, `dataview_query`, `base_query`) **Contents** โ€” [Why](#why-obsidian-brain) ยท [Quick start](#quick-start) ยท [What you get](#what-you-get) ยท [How it works](#how-it-works) ยท [Companion plugin](#companion-plugin-optional) ยท [Troubleshooting](#troubleshooting) ยท [Recent releases](#recent-releases) ## Why obsidian-brain? - **Works without Obsidian running** โ€” unlike Local REST API-based servers, obsidian-brain reads `.md` files directly from disk. Obsidian can be closed; your vault is just a folder. - **No Local REST API plugin required** โ€” nothing to install inside Obsidian for the core experience. - **Chunk-level semantic search with RRF hybrid retrieval** โ€” embeddings at markdown-heading granularity, fused with FTS5 BM25 via Reciprocal Rank Fusion. Finds the exact chunk, ranks on meaning. - **The only Obsidian MCP server with PageRank + Louvain + graph analytics** โ€” ask for your vault's most influential notes, bridging notes, theme clusters. Nobody else ships this. - **Ollama provider for high-quality local embeddings** โ€” switch to `qwen3-embedding:0.6b`, `nomic-embed-text`, `bge-m3`, etc. with one env var. - **All in one `npx` install** โ€” no clone, no build, no API key, no hosted endpoint. Vault content never leaves your machine. ## Quick start ### One-line install (macOS + Claude Desktop) ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/sweir1/obsidian-brain/main/scripts/install.sh)" ``` Installs Homebrew + Node 20+ if you don't already have them, adds the `/usr/local/bin` symlinks that Claude Desktop needs, merges obsidian-brain into your `claude_desktop_config.json`, opens the Full Disk Access pane for you to toggle Claude on, and relaunches Claude. You'll be asked for your macOS password once (for Homebrew + the symlinks) and your vault path once. Everything else is automatic. Audit what it does: [`scripts/install.sh`](scripts/install.sh). ### Manual install Requires Node 20+ and an Obsidian vault (or any folder of `.md` files โ€” Obsidian itself is optional). Wire obsidian-brain into your MCP client. Example for **Claude Desktop** (`~/Library/Application Support/Claude/claude_desktop_config.json`): ```json { "mcpServers": { "obsidian-brain": { "command": "npx", "args": ["-y", "obsidian-brain@latest", "server"], "env": { "VAULT_PATH": "/absolute/path/to/your/vault" } } } } ``` Quit Claude Desktop (โŒ˜Q on macOS) and relaunch. That's it. > [!NOTE] > On first boot the server auto-indexes your vault and downloads a ~34 MB embedding model. Tools may take 30โ€“60 s to appear in the client. Subsequent boots are instant. > [!TIP] > **Not a developer?** The [macOS walkthrough](docs/install-mac-nontechnical.md) covers Homebrew, Node, the GUI-app PATH fix, and Full Disk Access step-by-step. **For every other MCP client** (Claude Code, Cursor, VS Code, Jan, Windsurf, Cline, Zed, LM Studio, JetBrains AI, Opencode, Codex CLI, Gemini CLI, Warp): see [Install in your MCP client](docs/install-clients.md). โ†’ Full env-var reference: [Configuration](docs/configuration.md) โ†’ Model / preset / Ollama details: [Embedding model](docs/embeddings.md) โ†’ Migrating from aaronsb's plugin: [Migration guide](docs/migration-aaronsb.md) ## What you get 18 MCP tools grouped by intent: - **Find & read** โ€” `search`, `list_notes`, `read_note` - **Understand the graph** โ€” `find_connections`, `find_path_between`, `detect_themes`, `rank_notes` - **Write** โ€” `create_note`, `edit_note`, `apply_edit_preview`, `link_notes`, `move_note`, `delete_note` - **Live editor** (requires [companion plugin](docs/plugin.md)) โ€” `active_note`, `dataview_query`, `base_query` - **Maintenance** โ€” `reindex`, `index_status` โ†’ Arguments, examples, and response shapes: [Tool reference](docs/tools.md) ## How it works ```mermaid flowchart LR Client["MCP Client
Claude Desktop ยท Claude Code
Cursor ยท Jan ยท Windsurf ยท ..."] subgraph OB ["obsidian-brain (Node process)"] direction TB SQL["SQLite index
nodes ยท edges
FTS5 ยท vec0 embeddings"] Vault["Vault on disk
your .md files"] Vault -->|"parse + embed"| SQL SQL -.->|"writes"| Vault end Client <-->|"stdio JSON-RPC"| OB ``` Retrieval and writes both go through a SQLite index: reads are microsecond-cheap, writes land on disk immediately and incrementally re-index the affected file. Embeddings are chunk-level (heading-aware recursive chunker preserving code + LaTeX blocks), and `search`'s default `hybrid` mode fuses chunk-level semantic rank with FTS5 BM25 via Reciprocal Rank Fusion. โ†’ Deeper write-up โ€” why stdio, why SQLite, why local embeddings: [Architecture](docs/architecture.md) โ†’ Live watcher behaviour + debounces: [Live updates](docs/watching.md) โ†’ Scheduled reindex (macOS launchd / Linux systemd): [Scheduled indexing (macOS)](docs/launchd.md) ยท [(Linux)](docs/systemd.md) ## Companion plugin (optional) An optional Obsidian plugin at [`sweir1/obsidian-brain-plugin`](https://github.com/sweir1/obsidian-brain-plugin) exposes live Obsidian runtime state โ€” active editor, Dataview results, Bases rows โ€” over a localhost HTTP endpoint. When installed and Obsidian is running, `active_note`, `dataview_query`, and `base_query` light up. Install via BRAT with repo ID `sweir1/obsidian-brain-plugin`. Ship plugin and server at the **same major.minor** โ€” server v1.7.x pairs with plugin v1.7.x. Patch-version drift is fine. โ†’ Security model, capability handshake, Dataview / Bases feature coverage: [Companion plugin](docs/plugin.md) ## Troubleshooting Four most common: - **"Connector has no tools available"** in Claude Desktop โ€” usually the server crashed at startup. Check `~/Library/Logs/Claude/mcp-server-obsidian-brain.log`. Fix: `npm install -g obsidian-brain@latest`, quit Claude (โŒ˜Q), relaunch. - **`ERR_DLOPEN_FAILED` / `NODE_MODULE_VERSION` mismatch** โ€” `better-sqlite3` built against a different Node ABI. Fix: `PATH=/opt/homebrew/bin:$PATH npm rebuild -g better-sqlite3`. - **`Vault path not configured`** โ€” `VAULT_PATH` is unset. Set it in the `env` block of your client config or shell. - **Old version loading via `npx`** (your client still shows the previous release after a publish) โ€” stale npx cache. Fix: `rm -rf ~/.npm/_npx`, then restart your client. Keeping `@latest` in your config prevents this. โ†’ Full troubleshooting guide (watcher not firing, stale index, running multiple clients, timeouts, embedding-dim mismatch, log locations): [docs/troubleshooting.md](docs/troubleshooting.md) ## Recent releases - **v1.7.24** (2026-05-16) โ€” embeddings.md BYOM callout + 5 devDep bumps - **v1.7.23** (2026-05-16) โ€” BYOM Ollama auto-pull gate + logger sweep + SIGTERM unit test - **v1.7.22** (2026-05-15) โ€” structured stderr (NDJSON) + Ollama preparing-state + dependabot security bumps + SIGTERM drain integration test - **v1.7.21** (2026-04-27) โ€” install.sh vault-picker fix + auto `ollama pull` + docs/test polish - **v1.7.20** (2026-04-27) โ€” Ollama prefix-lookup bug + 13 audit polish items โ†’ Full changelog: [docs/CHANGELOG.md](docs/CHANGELOG.md) ยท Forward plan: [docs/roadmap.md](docs/roadmap.md) ยท Build from source: [docs/development.md](docs/development.md) ## Credits Thanks to [`obra/knowledge-graph`](https://github.com/obra/knowledge-graph) and [`aaronsb/obsidian-mcp-plugin`](https://github.com/aaronsb/obsidian-mcp-plugin) for the ideas and code this project draws on. Also [Xenova/transformers.js](https://github.com/xenova/transformers.js) (local embeddings), [graphology](https://graphology.github.io/) (graph analytics), and [sqlite-vec](https://github.com/asg017/sqlite-vec) (vector search in SQLite). ## Related projects - [`apple-notes-brain`](https://github.com/sweir1/apple-notes-brain) โ€” sibling MCP server for Apple Notes on macOS: read, write, and search with full Markdown round-trip in both directions. ## License [Apache License 2.0](./LICENSE) โ€” Copyright 2026 sweir1.