Obsidian Brain MCP Server
io.github.sweir1/obsidian-brain
Semantic search, knowledge graph, and vault editing for Obsidian—no plugin required.
What is the Obsidian Brain MCP server?
The obsidian-brain MCP server gives Claude and other MCP clients semantic search, knowledge graph analysis, and editing capabilities over an Obsidian vault. It runs as a local Node process, reads markdown files directly from disk, and requires no plugin, API key, or hosted service—your vault content never leaves your machine.
obsidian-brain indexes your Obsidian vault with chunk-level semantic embeddings and graph analytics, then exposes 18 tools for searching, understanding connections, detecting themes, and editing notes. It works without Obsidian running, supports hybrid retrieval (semantic + BM25 full-text search), and includes PageRank and Louvain clustering for vault-wide analysis. Install via a single npm command or one-line script.
How to install Obsidian Brain
Copy-paste configuration for popular MCP clients.
VAULT_PATHrequiredAbsolute path to your Obsidian vault (or any folder of .md files).
DATA_DIRWhere to store the SQLite index + embedding cache. Defaults to $XDG_DATA_HOME/obsidian-brain or ~/.local/share/obsidian-brain.
EMBEDDING_PRESETPreset name: english (default, bge-small-en-v1.5), english-fast, english-quality, multilingual, multilingual-quality, multilingual-ollama. Ignored when EMBEDDING_MODEL is set.
EMBEDDING_MODELPower-user override: any transformers.js checkpoint or Ollama model id. Takes precedence over EMBEDDING_PRESET. Switching auto-reindexes.
EMBEDDING_PROVIDEREmbedding backend. 'transformers' (local, default) or 'ollama' (requires a running Ollama server).
OLLAMA_BASE_URLBase URL of a local Ollama server. Only used when EMBEDDING_PROVIDER=ollama.
OLLAMA_EMBEDDING_DIMOverride the embedding dimensionality when EMBEDDING_PROVIDER=ollama. If unset, the server probes the model on startup.
OLLAMA_NUM_CTXOverride Ollama's num_ctx for embed requests. Leave UNSET to let obsidian-brain auto-detect via `/api/show`'s `context_length` (e.g. nomic-embed-text=2048, bge-m3=8192, qwen3-embedding:0.6b=32 768). Setting this manually imposes a hard cap and may silently truncate longer inputs — see https://github.com/ollama/ollama/issues/14259. Ollama's own default is 2048 which truncates for any model trained on a larger context. See also https://github.com/ollama/ollama/issues/7008. Fallback when both env is unset AND /api/show is unreachable: 8192.
OBSIDIAN_BRAIN_OLLAMA_AUTO_PULLAuto-pull the configured Ollama model when /api/show returns 404 (model not present). Default ON — choosing an Ollama-backed preset is implicit consent to download its model. Streams /api/pull progress to stderr. Set to '0' to disable auto-pull entirely (master kill-switch) and fall back to the actionable error path (`HTTP 404 — try: ollama pull <model>`).
OBSIDIAN_BRAIN_OLLAMA_BYOM_AUTO_PULLOpt-in to auto-pull for BYOM (custom EMBEDDING_MODEL) Ollama models OUTSIDE Ollama's official `library/` namespace. Default OFF — third-party models (e.g. `user/custom-fork`, `myregistry.com/team/model`) require this env var to be set to `1` before they will auto-pull, to prevent silent downloads of arbitrary user-named artifacts. Preset-known models (via EMBEDDING_PRESET) and bare model ids in the official library (e.g. `qwen3-embedding:0.6b`, `library/llama3:8b`) continue to auto-pull by default per the existing OBSIDIAN_BRAIN_OLLAMA_AUTO_PULL behavior.
OBSIDIAN_BRAIN_NO_WATCHSet to '1' to disable the live chokidar file watcher. Useful on SMB/NFS vaults where FSEvents/inotify don't fire reliably — fall back to running `obsidian-brain index` on a schedule (launchd/systemd).
OBSIDIAN_BRAIN_NO_CATCHUPSet to '1' to skip the startup catchup reindex pass that picks up edits made while the server was down. The live file watcher still starts (via OBSIDIAN_BRAIN_NO_WATCH=1 to disable that separately), and first-time indexing on an empty DB is unaffected — this knob only governs the post-restart `enqueueBackgroundReindex` walk.
OBSIDIAN_BRAIN_WATCH_DEBOUNCE_MSPer-file reindex debounce for the live watcher, in milliseconds.
OBSIDIAN_BRAIN_COMMUNITY_DEBOUNCE_MSGraph-wide community-detection (Louvain) debounce for the live watcher, in milliseconds. Louvain is the only expensive op — batching it prevents per-edit CPU spikes.
OBSIDIAN_BRAIN_TOOL_TIMEOUT_MSPer-tool-call timeout in milliseconds. Tools exceeding this return an MCP error instead of hanging.
OBSIDIAN_BRAIN_MAX_CHUNK_TOKENSOverride the adaptive chunk-size budget (in tokens). When set, this beats the capacity probed from the model's tokenizer or Ollama /api/show. Use for debugging or for models with stale tokenizer configs.
OBSIDIAN_BRAIN_CONFIG_DIROverride the per-user config directory where obsidian-brain stores model overrides (`model-overrides.json`) and the user-fetched seed (`seed-models.json`). Default is `$XDG_CONFIG_HOME/obsidian-brain` on macOS/Linux (or `~/.config/obsidian-brain`) and `%APPDATA%/obsidian-brain` on Windows. Both files survive `npm update obsidian-brain` because they live outside the package.
OBSIDIAN_BRAIN_DEBUGSet to "1" to print a verbose synchronous startup trace to stderr — every preflight, createContext, server.connect, and shutdown step is logged with a monotonic timestamp. The LAST line before any silent failure tells you exactly which step the server reached. No-op when unset (no overhead). Use to diagnose silent-crash failure modes.
OBSIDIAN_BRAIN_LOG_FORMATSet to 'ndjson' for one-JSON-object-per-line stderr output (timestamp + level + message + structured fields). Default is human-readable plain text (`obsidian-brain: <message>`). Useful for piping logs into aggregators (Datadog, Loki, Vector, journald) that index structured fields.
Tools & capabilities
Tools this server exposes to the agent.
search— Semantic search with hybrid retrieval (embeddings + FTS5 BM25 via Reciprocal Rank Fusion) at chunk level.list_notes— List notes in the vault.read_note— Read the full content of a note.find_connections— Find connections and backlinks for a note.find_path_between— Find the shortest path between two notes in the knowledge graph.detect_themes— Detect themes and clusters in the vault using Louvain clustering.rank_notes— Rank notes by influence using PageRank and graph analytics.create_note— Create a new note in the vault.edit_note— Edit an existing note.apply_edit_preview— Preview edits before applying them.link_notes— Create links between notes.move_note— Move or rename a note.delete_note— Delete a note.active_note— Access the currently active note in Obsidian (requires companion plugin).dataview_query— Execute Dataview queries (requires companion plugin).base_query— Query Obsidian Bases (requires companion plugin).reindex— Manually trigger a vault reindex.index_status— Check the status of the vault index.
Use cases
- Search your vault semantically to find relevant notes by meaning, not just keywords.
- Analyze your knowledge graph to discover the most influential notes, bridging concepts, and thematic clusters.
- Automatically create and edit notes, add links, and organize your vault structure.
- Ask Claude to understand connections between ideas across your entire vault and suggest new links.
- Use local embeddings (Ollama) for high-quality semantic search without sending data to external APIs.
Obsidian Brain MCP server FAQ
obsidian-brain is an MCP server that connects Claude and other AI clients to your Obsidian vault. It provides semantic search, knowledge graph analysis (PageRank, Louvain clustering), and note editing—all running locally on your machine without requiring Obsidian to be open.
Yes. obsidian-brain is open-source under Apache 2.0 license. Installation is free via npm, and it uses local embeddings by default (no API keys or subscriptions required).
Run the one-line install script: `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/sweir1/obsidian-brain/main/scripts/install.sh)"` on macOS, or manually add it to your `claude_desktop_config.json` with `npx obsidian-brain@latest server` and set the `VAULT_PATH` environment variable.
No. obsidian-brain reads markdown files directly from disk, so Obsidian can be closed. An optional companion plugin unlocks live features like `active_note` and `dataview_query` when Obsidian is running.
By default, it uses local embeddings via transformers.js (~34 MB model download on first boot). You can also configure Ollama with models like `qwen3-embedding:0.6b`, `nomic-embed-text`, or `bge-m3` via the `EMBEDDING_PROVIDER` environment variable.
No. All processing—indexing, embedding, search, and editing—happens locally in a SQLite database on your machine. Your vault content never leaves your device.
README (reference)
Source of truth, from the repository.
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 Companion plugin →
sweir1/obsidian-brain-plugin(optional — unlocksactive_note,dataview_query,base_query)
Contents — Why · Quick start · What you get · How it works · Companion plugin · Troubleshooting · Recent releases
Why obsidian-brain?
- Works without Obsidian running — unlike Local REST API-based servers, obsidian-brain reads
.mdfiles 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
npxinstall — no clone, no build, no API key, no hosted endpoint. Vault content never leaves your machine.
Quick start
One-line install (macOS + Claude Desktop)
/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.
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):
{
"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 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.
→ Full env-var reference: Configuration → Model / preset / Ollama details: Embedding model → Migrating from aaronsb's plugin: Migration guide
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) —
active_note,dataview_query,base_query - Maintenance —
reindex,index_status
→ Arguments, examples, and response shapes: Tool reference
How it works
flowchart LR
Client["<b>MCP Client</b><br/>Claude Desktop · Claude Code<br/>Cursor · Jan · Windsurf · ..."]
subgraph OB ["obsidian-brain (Node process)"]
direction TB
SQL["<b>SQLite index</b><br/>nodes · edges<br/>FTS5 · vec0 embeddings"]
Vault["<b>Vault on disk</b><br/>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 → Live watcher behaviour + debounces: Live updates → Scheduled reindex (macOS launchd / Linux systemd): Scheduled indexing (macOS) · (Linux)
Companion plugin (optional)
An optional Obsidian plugin at 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
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_VERSIONmismatch —better-sqlite3built against a different Node ABI. Fix:PATH=/opt/homebrew/bin:$PATH npm rebuild -g better-sqlite3.Vault path not configured—VAULT_PATHis unset. Set it in theenvblock 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@latestin your config prevents this.
→ Full troubleshooting guide (watcher not firing, stale index, running multiple clients, timeouts, embedding-dim mismatch, log locations): docs/troubleshooting.md
Recent releases
<!-- GENERATED:recent-releases — auto-pulled from docs/CHANGELOG.md by scripts/gen-readme-recent.mjs. Edit CHANGELOG.md, then run `npm run gen-readme-recent`. -->- 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 · Forward plan: docs/roadmap.md · Build from source: docs/development.md
Credits
Thanks to obra/knowledge-graph and aaronsb/obsidian-mcp-plugin for the ideas and code this project draws on. Also Xenova/transformers.js (local embeddings), graphology (graph analytics), and sqlite-vec (vector search in SQLite).
Related projects
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 — Copyright 2026 sweir1.
Related MCP servers
Agentic API marketplace — search, provision, and call data sources with one Ozma key
View repository →
CloakBrowser MCP
Playwright MCP browser automation with CloakBrowser Chromium for humanized web testing and research.

On Board
Cross-platform shared memory and ticket coordination for AI agents across MCP clients.

Pursers
Coordinate AI-agent work on a local-first, owner-controlled MCP board

io.github.swisstruthorg/swiss-truth-mcp
Verified knowledge base for AI agents — stop hallucinations with certified facts.

SwitchWize MCP
Verified US rate, savings-gap, card, CD, and product-change tools with freshness and sources.
