Skip to main content
Glama
obsidian-mcp

obsidian-mcp

by yanxue06

obsidian-mcp

Treat your Obsidian vault as a knowledge graph that AI agents can actually use.

A Model Context Protocol server that gives Claude — and any other MCP-compatible AI — graph-aware access to your notes. Backlinks, multi-hop traversal, Dataview queries, daily-note awareness, batch note creation, and safe rename-with-backlink-rewrite, exposed as 25 typed tools.

npm version CI License: MIT MCP TypeScript GitHub stars

Setup · What you can do · Tools · Configuration · FAQ


Why this exists

Most "Obsidian + AI" integrations expose read_file and write_file, then ask the model to figure out the rest. That works for a five-note vault. It collapses on a 5,000-note vault the moment you ask anything graph-shaped — "what connects these two ideas?", "what have I forgotten to follow up on?", "reorganize this folder." Each question becomes a chain of dozens of read_file calls, blowing through your context window before the model has even started thinking.

obsidian-mcp exposes the graph itself as tools:

  • get_note returns content + backlinks + forward links + tags + frontmatter in one call.

  • traverse_graph walks N hops out from any starting note in one call — forward, backward, or both — returning nodes and edges as a subgraph.

  • query_dataview passes Dataview DQL straight through, so the model can ask "all notes tagged #project where status != done sorted by due date" as a single typed query.

  • move_note renames a note and rewrites every incoming wiki-link so the graph survives the rename. This unblocks the entire "reorganize my vault" class of prompts that other servers can't safely do.

  • create_notes creates many notes in a single tool call — useful for bootstrapping an MOC plus its topical notes without paying N round-trips.

It's a small server (TypeScript, ~2,000 LOC, three runtime deps), runs locally over stdio, and works with Claude Desktop, Claude Code, Cursor, Cline, Continue, and Zed.

Related MCP server: obsidian-mcp-server

What you can do with it

Real prompts you can drop into Claude Desktop after installing:

Build an index note (Map of Content). Build me an index note for everything I've written about distributed systems. Use traverse_graph from "Distributed systems.md" with depth 2, cluster the neighbors thematically, and write the result to MOCs/Distributed Systems MOC.md. (MOC = Map of Content, a curated index note — Obsidian convention.)

Surface forgotten work. Find every note tagged #project where status != "done" and the due date is this week. (Single query_dataview call.)

Daily review. What's in my daily note today? Anything I forgot to follow up on from yesterday's note? Append my action items to today.

Inbox triage. Find all my orphan notes in Inbox/. For each one, read it, suggest where it belongs, and ask me before moving anything.

Bootstrap a topic. I just started studying transformer architectures. Use create_notes to scaffold a MOCs/Transformers MOC.md plus stub notes for "Self-attention", "Multi-head attention", "Positional encoding", and "Layer normalization", each linking back to the MOC.

Safe refactor. Rename "Atomic notes.md" to "Evergreen notes.md" using move_note. Update every backlink so nothing breaks.

Vault analytics. Run get_vault_stats and list_tags. Tell me my top 5 topics by note count, where I write most, and how my vault has grown.

Cross-domain synthesis. Walk 2 hops from "Working memory.md" and 2 hops from "Attention.md". Tell me which notes appear in both neighborhoods — those are my cross-cutting ideas.

If a workflow doesn't fit one of the existing tools, open an issue — the tool catalog below covers what's there today.

Setup

You need three things wired up: Obsidian running, the Local REST API plugin enabled, and your MCP client pointed at obsidian-mcp. The whole flow takes about a minute.

Step 1 — Install the Local REST API plugin in Obsidian

obsidian-mcp reaches your vault through the Local REST API community plugin. You only do this once per vault.

  1. In Obsidian, open Settings → Community plugins → Browse.

  2. Search for Local REST API, then Install and Enable it.

  3. Open the plugin's settings tab. Copy the API key shown at the top — you'll paste it into your MCP client config in Step 2.

IMPORTANT

Obsidian must be running forobsidian-mcp to work. The plugin lives inside Obsidian; close the app and the server can't reach your vault.

Step 2 — Add obsidian-mcp to your MCP client

Pick your client below.

Open the config file (create it if it doesn't exist):

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • Linux: ~/.config/Claude/claude_desktop_config.json

Add the obsidian entry under mcpServers:

{
  "mcpServers": {
    "obsidian": {
      "command": "npx",
      "args": ["-y", "@yanxue06/obsidian-mcp"],
      "env": {
        "OBSIDIAN_API_KEY": "paste-your-key-here"
      }
    }
  }
}

Quit and reopen Claude Desktop. You should see a tool icon in the input area — click it to confirm the obsidian tools are listed.

Run once, from any directory:

claude mcp add obsidian -e OBSIDIAN_API_KEY=paste-your-key-here -- npx -y @yanxue06/obsidian-mcp

Then fully quit and reopen Claude Code (/mcp reconnect doesn't always re-spawn the child process). Verify with /mcp — obsidian should report ✓ Connected.

Add a new stdio MCP server with:

  • Command: npx

  • Args: -y @yanxue06/obsidian-mcp

  • Env: OBSIDIAN_API_KEY=paste-your-key-here

Refer to your client's MCP config docs for the exact field names. Any MCP-compatible client works.

Step 3 — Verify it's wired up

In your MCP client, ask:

"Run get_vault_stats and tell me how many notes I have."

If you get a number back, you're done. If you hit a connection error, check troubleshooting below.

Troubleshooting

Symptom

Likely cause / fix

ECONNREFUSED 127.0.0.1:27124

Obsidian isn't running, or the Local REST API plugin isn't enabled.

401 Unauthorized

Wrong API key. Re-copy it from the plugin's settings tab.

self signed certificate warning

Expected — the plugin uses a self-signed cert and OBSIDIAN_VERIFY_TLS defaults to false. Set it to true only if you've replaced the cert.

Failed to reconnect to obsidian after editing config

Fully quit and reopen the MCP client; in-place reconnect doesn't always re-spawn the child process.

Wrong vault is showing up

One server instance points at one running Obsidian instance. Switch vaults inside Obsidian, or register multiple MCP entries with different names.

Tool catalog

25 tools, organized by category. Bold rows are the differentiators that other Obsidian MCP servers don't expose.

Discovery — find what's in the vault

Tool

What it does

list_vault

All files (or one folder), markdown-only by default.

search_vault

Full-text or #tag search, with snippets.

query_dataview

Run a Dataview DQL query. Requires the Dataview plugin in the vault.

list_tags

Vault-wide tag inventory with usage counts and sample notes per tag.

get_vault_stats

Totals (files, notes), sampled word count, top folders, file extensions.

Reading — get content out

Tool

What it does

get_note

Content plus graph context — backlinks, forward links, tags, frontmatter — in one call. The flagship tool.

get_outline

Heading tree of a note. Use this instead of get_note when you only need to navigate.

get_active_note

The note currently focused in Obsidian.

get_daily_note

Today's daily / weekly / monthly / quarterly / yearly note.

Tool

What it does

get_backlinks

Notes that link to a given note, with snippets.

traverse_graph

Walk N hops from a note (forward, backward, or both). Returns nodes + edges.

find_orphans

Notes with no incoming links — forgotten ideas, candidates for cleanup.

find_broken_links

Wiki-links that don't resolve. Run this before bulk renames.

Writing — create and modify notes

Tool

What it does

create_note

New note with optional frontmatter and an auto-generated ## Related section of [[wiki-links]].

create_notes

Create many notes in a single call. Per-note errors are reported individually; pass stop_on_error: true to abort on the first failure. Pre-fetches the file listing once for the whole batch.

upsert_note

Idempotent create-or-update. Replaces body, with optional merge_frontmatter to keep existing keys not specified in this call.

update_note

Replace a note's full content.

append_to_note

Append markdown to the end of a note.

append_to_daily_note

Common pattern: agent logs what it did to today's daily.

patch_note

Insert content under a specific heading, block, or frontmatter field — without rewriting the rest.

move_note

Move/rename a note and update incoming wiki-links so the graph stays intact.

delete_note

Destructive — only used when explicitly asked.

UI / commands — drive Obsidian itself

Tool

What it does

open_note

Surface a note in Obsidian's workspace. Great closing move for an agent task.

list_commands

List every registered Obsidian command (built-in + plugin).

run_command

Execute any Obsidian command by id. Lets agents trigger any plugin action.

How it works

┌──────────────────┐    stdio (MCP)    ┌──────────────┐    HTTPS     ┌──────────────────┐
│ Claude / Cursor  │ ─────────────────► obsidian-mcp ────────────────►  Local REST API  │ ──► Vault
│ Cline / Zed / …  │                   │  (this repo) │              │ (Obsidian plugin)│
└──────────────────┘                   └──────────────┘              └──────────────────┘

obsidian-mcp is a thin layer over the Local REST API plugin. The plugin runs an HTTPS server inside Obsidian with full vault access; this server adapts that surface into the MCP protocol and adds graph-aware tools that Obsidian's REST API doesn't expose directly (backlinks, multi-hop traversal, orphan detection, safe rename, batch creation).

Everything is local. No data leaves your machine except the requests your MCP client makes to its model provider — and you control that.

Configuration

All config is via environment variables — set them in your MCP client config.

Variable

Required

Default

Notes

OBSIDIAN_API_KEY

yes

—

From Local REST API plugin settings.

OBSIDIAN_HOST

no

127.0.0.1

OBSIDIAN_PORT

no

27124 (https) / 27123 (http)

OBSIDIAN_PROTOCOL

no

https

The plugin defaults to HTTPS with a self-signed cert.

OBSIDIAN_VERIFY_TLS

no

false

Set to true if you've replaced the self-signed cert.

OBSIDIAN_TIMEOUT_MS

no

15000

Per-request timeout.

Performance & scale

Vault size

get_note (with backlinks)

traverse_graph depth=2

find_orphans

100 notes

~50ms

~150ms

~1s

1,000 notes

~150ms

~600ms

~6s

5,000 notes

~400ms

~2s

~25s*

*find_orphans and find_broken_links accept a sample_size parameter — bound them on large vaults to keep tool calls under the model's per-call timeout.

FAQ

Do I need to install an Obsidian plugin? Yes — the Local REST API plugin. It's the only sane way to talk to a running vault from outside. obsidian-mcp itself runs as a separate Node process started by your MCP client; you don't install another plugin in Obsidian for this.

Does it work if Obsidian is closed? No. The Local REST API runs inside Obsidian, so the app needs to be open.

Does it support multiple vaults? One server instance points at one running Obsidian instance. Run multiple MCP server entries (different names) if you switch vaults frequently. Multi-vault routing may come later.

Why HTTPS by default with OBSIDIAN_VERIFY_TLS=false? The plugin ships a self-signed cert. The traffic is loopback-only (127.0.0.1), so verification adds friction without a real security gain. If you've replaced the cert, set the flag.

Is this safe? The MCP server gives the model whatever access the API key grants — including delete and overwrite. Treat it like any agent with file write access: review what it's about to do, especially before bulk operations. move_note is designed for exactly this — making the safe path the default.

What about concurrency and crashes? No write-locking and no transaction semantics. If two agents touch the same file simultaneously, the loser's change is lost. move_note deletes the source after rewriting backlinks, and create_notes is best-effort per entry, so a crash mid-operation can leave partial state. Fine for interactive agent use; not appropriate for unattended batch jobs.

How do I debug? Run node dist/index.js directly with your env vars and the server prints connection status to stderr. Send JSON-RPC messages on stdin to test. The MCP Inspector (npm) is the easiest way to poke at tools manually.

Contributing

PRs welcome. See CONTRIBUTING.md for the dev loop, tool-authoring conventions, and code-style expectations.

Acknowledgements

  • Local REST API by @coddingtonbear — this entire project is downstream of it.

  • The Model Context Protocol team at Anthropic.

  • The Obsidian plugin community, who built the ecosystem this depends on.

License

MIT — see LICENSE.


Available Tools

25 tools
append_to_daily_noteAppend to daily noteB

Append markdown to the current daily (or weekly/etc.) note. Common pattern: agent logs what it just did at the end of the day.

Inputs: content (required), period.

append_to_noteAppend to a noteA

Append markdown to the end of an existing note. Creates the note if it doesn't exist.

Inputs: path (required), content (required).

create_noteCreate a noteA

Create a new note (fails if it already exists unless overwrite is true). Frontmatter is rendered as YAML. Use links to append a wiki-link section at the end. For creating many notes in one call, use create_notes. For idempotent create-or-update writes, use upsert_note.

Inputs: path (required), content, frontmatter, links, +1 more.

create_notesCreate multiple notes in one callA

Create many notes in a single tool call. Designed for bootstrapping a knowledge graph (MOC + topical notes) without paying N round-trips. Each entry follows the same schema as create_note. Per-note errors are reported individually; pass stop_on_error: true to abort on the first failure. Within a batch, later entries also fail if they target a path already created earlier in the same call.

Inputs: notes (required), stop_on_error.

delete_noteDelete a noteA

Delete a note from the vault. Destructive — only call when the user has explicitly asked to remove a file.

Inputs: path (required).

find_orphansFind orphan notesB

Find notes with no incoming links anywhere in the vault. Use to surface forgotten ideas or candidates for cleanup.

Inputs: folder, limit, sample_size.

get_active_noteGet currently open noteA

Return the note the user currently has focused in Obsidian. Useful for 'what am I looking at' style prompts.

Inputs: no named parameters.

get_daily_noteGet daily / periodic noteA

Fetch the user's current daily (or weekly/monthly/etc.) note. Returns content + frontmatter + tags. Requires the Periodic Notes or Daily Notes plugin in the vault.

Inputs: period.

get_noteGet note with graph contextA

Get a note's content plus its graph context: backlinks (who links to it), forward links (who it links to), tags, and frontmatter. Use the include array to control which context is fetched — backlinks are O(vault size) so omit them when unneeded.

Inputs: path (required), include, backlinks_limit.

get_outlineGet a note's heading outlineA

Return the heading structure of a note (level + text + line number). Use this instead of get_note when you only need to navigate to a section of a long note — it's much smaller in tokens.

Inputs: path (required).

get_vault_statsGet vault statisticsA

Get high-level stats about the vault: total notes, total words (sampled), top folders, file extensions. Useful for 'how big is my vault?' / 'where do I write the most?' prompts.

Inputs: sample_size, top_folders.

list_commandsList Obsidian commandsA

List every registered Obsidian command (built-in + plugin) with its id and human name. Use this before run_command to discover what's available — vaults differ based on installed plugins.

Inputs: filter, limit.

list_tagsList all tags in the vaultA

Return every tag used in the vault, with usage counts and a sample of notes per tag. Useful for 'what topics do I write about most?' or as a starting point for organizing.

Inputs: sample_size, min_count, sample_notes_per_tag.

list_vaultList vault filesB

List all files in the Obsidian vault. Use folder to scope to a subdirectory and markdown_only to filter to notes. Prefer this over guessing paths.

Inputs: folder, markdown_only, limit.

move_noteMove or rename a note (with backlink updates)A

Move a note from one path to another, optionally rewriting wiki-links so backlinks keep working. This is the safe way to rename notes — agents should not naively delete + create because that breaks the graph.

Inputs: from (required), to (required), update_backlinks, overwrite.

open_noteOpen a note in Obsidian's UIA

Surface a note in Obsidian's workspace (focuses an existing tab or opens a new one). Great for ending an agent task with 'and here's the result for you to review'.

Inputs: path (required), new_leaf.

patch_noteInsert content at a heading or blockA

Insert content relative to a heading, block reference, or frontmatter field — without rewriting the whole note. Example: append a bullet under '## Tasks' without touching the rest of the page.

Inputs: path (required), content (required), operation (required), target_type (required), +1 more.

query_dataviewRun a Dataview DQL queryA

Run a Dataview DQL query (LIST / TABLE / TASK) against the vault. Requires the Dataview plugin installed in the vault. Powerful for structured questions like 'all notes tagged #project where status != done sorted by due date'.

Inputs: dql (required).

run_commandRun an Obsidian commandA

Execute an Obsidian command by id (e.g. 'editor:toggle-bold', 'app:reload', 'graph:open'). Discover ids with list_commands. This is powerful — it lets the agent trigger any plugin action — so use only commands the user has approved.

Inputs: id (required).

search_vaultSearch the vaultA

Full-text search across all notes. Supports two modes: keyword (fast plain-text) and tag (find notes tagged with #X). For structured queries, use query_dataview.

Inputs: query (required), mode, context_length, limit.

traverse_graphTraverse the vault graphA

Walk the link graph starting from a note. Returns nodes (notes) and edges (links) up to depth hops away. Use direction=both for a neighborhood, forward for what a note depends on, backward for what depends on it. Cap with max_nodes on large vaults.

Inputs: start (required), depth, direction, max_nodes, +1 more.

update_noteReplace a note's contentA

Overwrite a note's full content. Prefer append_to_note or patch_note when only adding to a note — replacing wholesale is destructive.

Inputs: path (required), content (required).

upsert_noteCreate or update a noteA

Create a note if missing, replace it if it exists. Body is always fully replaced. Frontmatter is replaced by default; pass merge_frontmatter: true to keep existing frontmatter keys not specified in this call. Use this when you want an idempotent write — neither create_note (errors on existence) nor update_note (errors when missing) handle that on their own.

Inputs: path (required), content, frontmatter, links, +1 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 25 tools

    Disambiguation4/5

    Most tools target distinct actions, but there is slight overlap between get_note and get_backlinks (backlinks are also in get_note context) and between create_note, update_note, and upsert_note. However, clear descriptions mitigate confusion.

    Naming Consistency5/5

    All tool names follow a consistent snake_case pattern with verb_noun structure (e.g., append_to_note, find_broken_links, list_tags). No mixed conventions or vague verbs.

    Tool Count4/5

    25 tools is at the upper bound but justified for a comprehensive Obsidian MCP server covering notes, vault management, graph navigation, and plugin integration. Each tool earns its place.

    Completeness4/5

    Covers CRUD for notes, batch operations, vault statistics, search, graph analysis, and plugin commands. Minor gap: no dedicated tool to create a daily note (append assumes existing) or manage folders.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      A
      maintenance
      Standalone MCP server for Obsidian vaults - hybrid search (FTS5 + vector + reranking), files in agent-readable form (images, PDFs, canvases, HTML, scripts, data files), Kanban-aware tasks (Tasks-plugin + Dataview formats), structured memory with topic recall, fine-grained read/write tools, and link graph support. Run locally, self-host, or one-click deploy for remote access. OAuth 2.1.
      16
      34
      39
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Connects Claude.ai to your local Obsidian vault for full CRUD access, search, and daily note creation via the Model Context Protocol.
      14
      MIT
    • F
      license
      D
      quality
      D
      maintenance
      Enables Claude Desktop to securely search and retrieve knowledge from an Obsidian vault through a stateless MCP interface, with progressive disclosure and gated write capabilities.
      13
      -