Skip to main content
Glama
obsidian-brain
by sweir1

obsidian-brain

npm version License: Apache 2.0 Node โ‰ฅ 20 GitHub stars

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 โ€” unlocks active_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 .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.

Related MCP server: obsidian-mcp-complete

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_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

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 ยท 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).

  • 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.

Available Tools

18 tools
active_noteA

Return the note currently open in Obsidian, including cursor position and selection. Requires the obsidian-brain companion plugin installed and Obsidian running against the same vault.

Inputs: no named parameters.

apply_edit_previewA

Apply a previously previewed edit. Pass the previewId returned by edit_note with dryRun: true. Previews expire after 5 minutes. Fails with a descriptive error if the target file changed since the preview was generated โ€” in that case, regenerate the preview and try again.

Inputs: previewId (required).

base_queryA

Evaluate an Obsidian Bases .base file and return its rows. Requires the obsidian-brain companion plugin installed, a recent Obsidian (1.10.0+) running against the same vault, and the Bases core plugin enabled (Obsidian โ†’ Settings โ†’ Core plugins โ†’ Bases). Obsidian does not yet expose a public API for headless Bases query execution (Plugin.registerBasesView() is a view-factory hook only). The plugin uses its own YAML parser + a whitelisted expression subset (Path B). See docs/plugin.md#bases for the full supported subset. Supported subset: tree ops (and/or/not), comparisons (==, !=, >, >=, <, <=), leaf boolean (&&, ||, !), file.{name, path, folder, ext, size, mtime, ctime, tags}, file.hasTag("x"), file.inFolder("x"), frontmatter dot-paths. Arithmetic (+, -, *, /, %), method calls other than hasTag/inFolder, function calls (today(), now(), etc.), regex literals, formulas:, summaries:, and this context references all return 400 unsupported_construct errors โ€” they ship in subsequent plugin patches as users hit them. Provide either file (vault-relative path to a .base file) or yaml (inline .base YAML source); view names which view inside the file to execute. Returns { view, rows, total, executedAt } โ€” rows contain {file: {name, path}, ...projected columns}, total is the pre-limit count. Default 30s timeout (override with timeoutMs). Timeout only cancels the HTTP wait; the plugin has no cancellation API, so a running evaluation keeps going inside Obsidian. Prefer a limit: in the view for open-ended queries over large vaults.

Inputs: view (required), file, yaml, timeoutMs.

create_noteA

Create a new note in the vault with a title, body, and optional YAML frontmatter. The new note is indexed immediately so semantic search and graph tools can find it. Auto-injects a title: field into frontmatter matching the note title unless frontmatter already has one.

Inputs: title (required), content (required), directory, frontmatter.

dataview_queryA

Run a Dataview DQL query against the vault. Requires the obsidian-brain companion plugin v0.2.0+ installed, Obsidian running against the same vault, and the Dataview community plugin enabled. Returns a normalized discriminated-union shape. kind='table' gives {headers, rows}. kind='list' gives {values}. kind='task' gives {items: [{task, text, path, line, tags, children, ...STask fields when task=true}]}. kind='calendar' gives {events: [{date, link, value?}]}. DQL reference: https://blacksmithgu.github.io/obsidian-dataview/queries/structure/. Default 30s timeout (override with timeoutMs). NOTE: timeoutMs only cancels the HTTP wait; Dataview has no cancellation API, so the query keeps running inside Obsidian to completion. Prefer LIMIT N in DQL for open-ended queries.

Inputs: query (required), source, timeoutMs.

delete_noteA

Permanently delete a note. Removes the file from disk AND its index rows (edges, embedding, node). Requires confirm: true to guard against accidents. When the delete removes inbound edges, the response is wrapped in a next_actions envelope suggesting a follow-up rank_notes(method=pagerank, minIncomingLinks=0) to spot newly orphaned notes.

Inputs: name (required), confirm (required), dryRun.

detect_themesA

List auto-detected topic clusters across the vault (served from the community-detection cache). Pass a theme id or label to drill into one cluster. To recompute with a different Louvain resolution, call reindex({ resolution: X }) first โ€” detect_themes itself is a read-only tool. Each returned cluster carries staleMembersFiltered โ€” the number of cached nodeIds that no longer exist in the vault and were dropped on this read. A positive value means the cached community row is lagging; the filter also regenerates summary so it stays consistent with the filtered nodeIds. Broken-wikilink stub targets are excluded by default; pass includeStubs: true to include them. When the overall vault graph has LOW modularity (<0.3), the response includes { warning, modularity } at the envelope top-level โ€” the clusters aren't clearly separable on this graph and may not reflect meaningful themes.

Inputs: themeId, includeStubs.

edit_noteA

Modify an existing note. Supports six edit modes: append (add to end; defensively inserts a leading newline if the source didn't end with one), prepend (insert after frontmatter if present, otherwise at file start), replace_window (find a block of text and replace it โ€” optionally fuzzy; fuzzy extends match to consume trailing .?! so the replacement has no doubled punctuation), patch_heading (insert or replace content under a specific heading; headingOp: 'before' | 'after' inserts immediately before/after the heading line โ€” use before on the NEXT heading to append to a section's end; headingOp: 'replace' with scope: 'section' (default) replaces to the next same-or-higher heading or EOF โ€” CAREFUL on the LAST heading, this consumes everything below including content separated by blank lines โ€” pass scope: 'body' to stop at the first blank line after the body; if the target heading text appears MORE THAN ONCE the call throws MultipleMatches listing each occurrence with its line number โ€” pass headingIndex: 0 | 1 | ... (0-indexed, top-to-bottom) to pick one), patch_frontmatter (set a single YAML key; pass value: null to clear โ€” or from XML-stringifying clients use valueJson: 'null' for true null, valueJson: 'true' for a real boolean, valueJson: '42' for a number, valueJson: '["a"]' for an array; valueJson wins over value when both are set), at_line (insert or replace at a 1-indexed line number that counts from file start including frontmatter lines). Pass edits (array) to apply multiple edits atomically โ€” all succeed or none are written.

Inputs: name (required), mode, content, search, +14 more.

find_connectionsA

Find notes linked to (from or to) a given note, up to N hops. Optionally return the full subgraph instead of a flat list. Response is wrapped as {data, context} where context.next_actions suggests follow-ups like clustering a dense neighbourhood via detect_themes or tracing a path to the furthest neighbour via find_path_between. Broken-wikilink stub neighbours are excluded by default; pass includeStubs: true to include them.

Inputs: name (required), depth, returnSubgraph, includeStubs.

find_path_betweenA

Find link paths between two notes. Returns all simple paths up to maxDepth edges, optionally including their shared neighbors. Broken-wikilink stub nodes are excluded by default โ€” they are degree-1 dead ends in the undirected graph and will block legitimate paths if left in. Pass includeStubs: true to include them.

Inputs: from (required), to (required), maxDepth, includeCommon, +1 more.

index_statusA

Report the current state of the vault index: embedder model + dim, count of notes / chunks indexed, chunks skipped during the last reindex (if any), advertised vs discovered max tokens, last reindex reasons, whether a reindex is currently in flight, and the last init error. Read-only โ€” does not mutate anything.

Inputs: no named parameters.

list_notesA

List notes in the vault. Optionally filter by directory prefix or by frontmatter tag. Pass includeStubs: false to exclude unresolved wiki-link targets (nodes with frontmatter._stub: true) and see only real on-disk notes.

Inputs: directory, tag, limit, includeStubs.

move_noteA

Rename or move a note. Inbound wiki-links in other notes are rewritten in place immediately (bare [[old]], [[old|alias]], ![[old]] embeds, and [[old#heading]]/[[old^block]] suffixes all handled). If the note's frontmatter has a title: field matching the old basename, it's auto-rewritten to the new basename (custom titles and missing titles are left alone). Response includes linksRewritten: { files, occurrences }.

Inputs: source (required), destination (required), dryRun.

rank_notesA

Rank notes by importance: 'influence' (densely-connected hubs), 'bridging' (notes that connect otherwise-separate topic clusters), or both. Credibility guards (I): by default, influence excludes notes with fewer than minIncomingLinks: 2 incoming edges โ€” this filters out random-orphan noise that makes PageRank feel meaningless on personal vaults. Pass minIncomingLinks: 0 to see the unfiltered ranking. Bridging scores are normalized by graph size (divided by n*(n-1)/2) so values compare across vaults of different sizes โ€” a bridging score of 0.5 means the same thing in any vault. Broken-wikilink stub targets are excluded by default; pass includeStubs: true to include them.

Inputs: metric, limit, themeId, includeStubs, +1 more.

read_noteA

Read a note's content. Brief mode (default) returns title + metadata + linked-note titles; full mode returns full content + edge context. Full mode also reports truncated: true when the body exceeded maxContentLength (default 2000 chars) and was sliced. Response is wrapped as {data, context} where context.next_actions suggests follow-ups like creating missing linked notes or exploring outgoing connections.

Inputs: name (required), mode, maxContentLength.

reindexA

Re-index the vault: re-embeds notes whose mtime changed, prunes orphan stubs, and re-runs community detection only when something actually changed. Pass resolution to force a Louvain rerun and tune cluster granularity (0.5 = fewer/broader clusters, 2.0 = more/finer); without it, a no-op vault skips Louvain entirely.

Inputs: resolution.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelogโ€ฆ

    TDQS

    A4.2/5.0

    Scored across 18 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: note CRUD, linking, search, graph analysis, indexing, and specialized queries. Even overlapping areas like search and dataview_query are delineated by their descriptions. No two tools appear to do the same thing.

    Naming Consistency5/5

    All tool names follow a consistent snake_case verb_noun pattern (e.g., create_note, find_path_between). No mixed conventions or inconsistencies.

    Tool Count5/5

    18 tools is slightly above the typical 3-15 range, but each tool addresses a distinct aspect of vault interaction, such as note management, linking, searching, graph analysis, and indexing. The count is well-justified for the domain's complexity.

    Completeness4/5

    The tool surface covers core note operations (CRUD, search, linking, graph analysis, indexing) and includes specialized query systems (Bases, Dataview). Minor gaps exist (e.g., bulk operations, attachment management), but the set is comprehensive for typical agent workflows.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      Headless semantic MCP server for Obsidian, Logseq, Dendron, Foam, and any markdown folder. Features built-in hybrid semantic search, surgical AST editing, template scaffolding, zero-config local embeddings, and workflow tracking.
      5
      109 npm
      12
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Local-first MCP server for Obsidian vaults with 66 tools for reading, writing, searching, and managing notes, tasks, graphs, and more. Works without Obsidian running and requires no plugins.
      66
      MIT
    • A
      license
      A
      quality
      A
      maintenance
      Standalone MCP server for Obsidian vaults - hybrid search (FTS5 + vector + cross-encoder reranking), images and PDFs in agent-readable form, Kanban-aware tasks (Tasks-plugin + Dataview formats), structured memory with topic recall, fine-grained read/write tools for optimal token efficiency, and link graph support. Run locally, self-host, or one-click deploy for remote access. OAuth 2.1.
      16
      33
      38
      MIT