Obsidian Native MCP
Provides tools for reading, searching, and surgically editing notes in Obsidian vaults with hash-based concurrency safety, structural awareness, and multi-vault support.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Obsidian Native MCP apply a patch to my weekly review to add the new goals"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
LLM-optimized MCP server for Obsidian vaults Surgical edits, hash-based concurrency safety, no whole-file rewrites.
A Model Context Protocol server that gives AI assistants (Claude Desktop, Cursor, Rovo Dev, etc.) direct, safe, context-efficient access to your Obsidian vaults.
Two ways to use it:
Obsidian plugin — 1-click install, auto-discovers vaults, settings UI for per-tool toggles, runs inside Obsidian over HTTP/SSE with a bearer token.
CLI — standalone Node binary, configured via env var or config file, speaks JSON-RPC over stdio with Content-Length framing.
Why Obsidian Native MCP
The defining design goal is minimize how many bytes the LLM has to push around per edit. Every read returns content plus cryptographic hashes; every write declares the precondition hash it expects. The result: most edits become tiny str_replaces or unified-diff patches instead of full file rewrites.
Feature | Obsidian Native MCP | Typical Obsidian MCP server |
Edit model |
| Read whole file → write whole file |
Concurrency safety | Cryptographic preconditions ( | None — silent clobbering |
Structural awareness | mdast-AST: code-fenced "headings" never treated as headings | Regex hacks that corrupt code blocks |
Frontmatter | Real YAML parser with nested key paths | Hand-rolled line matching |
Atomicity | Multi-file | None |
Permissions | Read-only mode + per-tool toggle + per-vault subdir allow/deny | All-or-nothing |
Audit trail | JSONL log with content hashes before/after every mutation | None |
Multi-vault | First-class | Usually one vault |
Related MCP server: obsidian-codex-mcp
Installation
Obsidian plugin (recommended)
Open Obsidian → Settings → Community Plugins → Browse
Search for "Native MCP" and install
Enable in Community Plugins
Open plugin settings: select which vaults to expose, optionally toggle per-tool permissions, copy the MCP URL
CLI (standalone)
npm install -g obsidian-native-mcpBuild from source
git clone https://github.com/usrivastava92/obsidian-native-mcp.git
cd obsidian-native-mcp
npm install
npm run buildConfiguration
Plugin
Auto-discovers all your Obsidian vaults from Obsidian's own config. Pick which to expose in plugin settings. Plugin also surfaces a bearer token and the MCP URL.
A Performance budgets section in plugin settings lets you cap long-running operations. All limits default to 0 = unlimited — raise or lower them freely without restriction.
Setting | Description |
Max files scanned | Max |
Max bytes read | Max raw bytes of file content read per call |
Max bulk ops | Max ops accepted by a single |
Deadline (ms) | Wall-clock time limit for long-walk tools (best-effort; checked once per file) |
CLI
Either an env var or a config file.
# Single vault
export OBSIDIAN_VAULT_PATHS=/Users/me/my-obsidian-vault
# Multiple vaults (semicolons on all platforms)
export OBSIDIAN_VAULT_PATHS=/Users/me/personal;/Users/me/workConfig file at ~/.config/obsidian-native-mcp/vaults.json:
{
"vaults": {
"personal": "/Users/me/personal-notes",
"work": "/Users/me/work-vault"
}
}Optional flags:
obsidian-native-mcp --read-only # all write tools disabled
obsidian-native-mcp --vault notes=/path # ad-hoc named vault
obsidian-native-mcp --config ./my.json # explicit config filePerformance budget env vars
All default to 0 (unlimited). Set any to a positive integer to cap that resource:
MCP_MAX_FILES_SCANNED=500 # files per search.content / vault.info call
MCP_MAX_BYTES_READ=10000000 # raw bytes per call (~10 MB)
MCP_MAX_BULK_OPS=50 # ops per bulk.apply call
MCP_DEADLINE_MS=30000 # wall-clock ms ceiling for long-walk toolsThese are defaults — they are never enforced as hard system limits. Set them to whatever makes sense for your vault and workflow.
Usage
Obsidian plugin
Add the URL from plugin settings to your claude_desktop_config.json:
{
"mcpServers": {
"obsidian-native-mcp": {
"url": "http://127.0.0.1:9789/sse?token=YOUR_TOKEN"
}
}
}CLI
{
"mcpServers": {
"obsidian-native-mcp": {
"command": "obsidian-native-mcp",
"env": {
"OBSIDIAN_VAULT_PATHS": "/Users/me/my-obsidian-vault"
}
}
}
}Tools
All tools accept an optional vault parameter; with a single vault configured, it's inferred. Every read returns hashes used by writes as preconditions.
Read tools
Tool | What it returns | Notes |
| All configured vaults | — |
| Stats per vault |
|
| Paged file listing |
|
| Find files by name | exact / substring / glob / regex |
| Full file content + | Use freely — guidelines/AGENTS.md/etc. |
| Line range + | Cheaper for big files |
| Heading skeleton + | Sub-KB even for 5000-line files |
| All matches (line, level, | Returns all — caller disambiguates |
| Block ref location + | Structural-type aware (list/table/paragraph) |
| Whole frontmatter or single nested key | YAML-aware |
| Tags from frontmatter + body | Code-fence aware |
| Outlinks, backlinks, or both | Typed: wiki/embed/header/block/markdown |
| Frontmatter + headings + tags + links + hashes | One-shot context dump |
| Paged full-text matches with per-line hashes |
|
Write tools — surgical primaries
Tool | Shape | Why |
|
| The default editing verb — quote what you see |
| Unified diff | Multi-hunk edits in one shot; context lines act as preconditions |
|
| Multi-edit, atomic per file |
Write tools — structural (when you have the address)
Tool | Notes |
| Requires |
| Optionally update wiki-link references |
| Requires |
| Renames a |
| Nested key path; YAML-safe round-trip |
| Nested key path |
| Requires |
| Insert at line N |
Write tools — whole-file & metadata
Tool | Notes |
| Create-only — errors if file exists |
| Whole-file rewrite — heavy, requires |
| Cheap, no read needed |
| Default |
| Defaults to |
Power & batch
Tool | Notes |
| Multi-file, multi-op batch. |
| Two-step: server returns proposal token + diff → caller confirms |
| Diff between two |
Per-call budget overrides (_budget)
vault.info, search.content, and bulk.apply all accept an optional _budget object that overrides the server-level config for that single call only. This lets an AI agent tighten or relax limits based on what it knows about the task:
{
"tool": "search.content",
"arguments": {
"query": "important term",
"directory": "Projects/",
"_budget": {
"maxFilesScanned": 200,
"maxBytesRead": 5000000,
"deadlineMs": 10000
}
}
}Field | Applies to | Description |
|
| Max |
|
| Max raw bytes to read this call (0 = unlimited) |
|
| Wall-clock limit in ms for this call (0 = no limit) |
|
| Max ops for this batch (0 = unlimited) |
When a budget is hit, the tool returns truncated: true with a hint and (for search.content) a nextOffset the agent can use to resume pagination. No error is thrown — the agent gets partial results and can decide what to do next.
Prompts
Place markdown in any vault's Prompts/ folder with mcp-tools-prompt in the frontmatter; Templater-style <% tp.mcpTools.prompt(name, hint) %> placeholders become MCP prompt arguments automatically.
Concurrency safety
Every read returns one or more hashes. Every write that operates on an existing range requires the matching expected_*_hash. If the file changed underneath you (a human edit in Obsidian, a parallel tool call, etc.), the write returns:
{
"ok": false,
"error": {
"code": "STALE_PRECONDITION",
"current_content_hash": "sha256:…",
"current_section_hash": "sha256:…"
}
}The model refreshes from the new hash and retries. No silent clobbering.
Permissions
Read-only mode — plugin toggle or CLI
--read-onlyflag disables every write tool.Per-tool toggle — disable individual tools (e.g., turn off
file.deletefor less-trusted clients).Per-vault subdir allow/deny — limit a client to a vault subtree.
Audit log
Every mutating call appends one JSONL line to <vault>/.obsidian/plugins/native-mcp/audit.log:
{
"ts": "2026-05-21T13:00:00Z",
"tool": "str_replace",
"vault": "notes",
"file": "Daily/2026-05-21.md",
"args_hash": "sha256:…",
"before_hash": "sha256:…",
"after_hash": "sha256:…",
"dry_run": false,
"ok": true
}Long-walk tools (search.content, vault.info) also emit telemetry fields:
{
"ts": "2026-05-21T13:00:01Z",
"tool": "search.content",
"vault": "notes",
"duration_ms": 412,
"files_scanned": 347,
"bytes_read": 2891024,
"truncated": true,
"abort_reason": "budget"
}Field | Description |
| Wall-clock time for the operation in milliseconds |
| Number of |
| Raw bytes of file content read before mdast parsing |
|
|
|
|
Rotates at 5 MB by default.
Security
Runs locally only — loopback (
127.0.0.1) for HTTP, stdio for CLI.HTTP transport requires a startup-generated bearer token in the SSE URL.
Origin header allowlist enforced; CORS is not
*.Request bodies capped at 5 MB; max-sessions and idle TTL applied.
Path-traversal protection on every vault-relative path.
Only vaults you explicitly select are accessible.
License
Available Tools
32 toolsapply_editsA
Apply a batch of str_replace edits to a single file in one round-trip. Edits applied in order against the running in-memory text; atomic (rolled back in memory if any edit fails).
Inputs: file (required), edits (required), vault, dry_run, +1 more.
apply_patchA
Apply a unified diff to a file. Context lines (' ' prefix) are validated verbatim per hunk — the diff IS the content precondition. expected_content_hash is optional belt-and-suspenders. Use this for multi-hunk surgical edits.
Inputs: file (required), patch (required), vault, dry_run, +1 more.
block.findB
Find a block-reference (^id) in a file. Returns line/structuralType/blockHash so block.replace can be called with the precondition.
Inputs: file (required), blockId (required), vault.
block.renameB
Rename a block reference (^old → ^new) on the same line, preserving line content.
Inputs: file (required), newId (required), blockId (required), expected_block_hash (required), +2 more.
block.replaceA
Replace the structural block referenced by ^id (paragraph/list-item/table-row/etc.) preserving the ^id marker. Requires expected_block_hash from block.find.
Inputs: file (required), blockId (required), content (required), expected_block_hash (required), +2 more.
bulk.applyA
Execute a batch of write operations. With atomic=true (default), all ops are first validated in dry-run mode against in-memory snapshots; the actual writes happen only if every op would succeed. If any post-validation write fails, best-effort restore is attempted.
Inputs: ops (required), vault, atomic, _budget, +1 more.
file.appendA
Append text to a file (creating it if missing). Cheap: no read of existing content required.
Inputs: file (required), content (required), vault, dry_run, +1 more.
file.createA
Create a NEW file with the given content. Errors if the file already exists; use file.replace for overwrite.
Inputs: file (required), content (required), vault, dry_run.
file.deleteA
Delete a file. Default trash=true → moved to /.obsidian/trash. Hard delete (trash=false) requires expected_content_hash.
Inputs: file (required), trash, vault, dry_run, +1 more.
file.diffB
(planned) Diff a file against a prior content_hash. Stubbed for v1.0 — requires history cache; returns NOT_FOUND until enabled.
Inputs: file (required), fromHash (required), vault, toHash.
file.findC
Find files by name (exact / substring / glob / regex).
Inputs: query (required), mode, limit, vault, +2 more.
file.listC
List files/directories in the vault, optionally recursively, with optional glob filter.
Inputs: glob, limit, vault, offset, +2 more.
file.moveA
Move or rename a file. Defaults to on_conflict='error' — never silently overwrites.
Inputs: to (required), from (required), vault, dry_run, +2 more.
file.readA
Read a file's full content. Returns content + content_hash + totalLines so subsequent surgical edits can use the hash as a precondition.
Inputs: file (required), vault.
file.read_rangeA
Read a line range from a file (1-based, inclusive). Returns the slice + rangeHash + contentHash for surgical follow-ups.
Inputs: to (required), file (required), from (required), vault.
file.replaceA
HEAVY: replace the entire content of a file. Prefer str_replace / apply_patch / heading.replace_body / block.replace / frontmatter.set / lines.replace for surgical edits. Requires expected_content_hash unless create_if_missing is true and the file does not exist.
Inputs: file (required), content (required), vault, dry_run, +2 more.
frontmatter.deleteA
Delete a (possibly nested) key from the file's frontmatter. No-op if key absent. Requires expected_frontmatter_hash when frontmatter exists.
Inputs: file (required), keyPath (required), vault, dry_run, +1 more.
frontmatter.getB
Read the frontmatter (or a nested key via dot-notation) from a markdown file.
Inputs: file (required), vault, keyPath.
frontmatter.setA
Set a (possibly nested via dot-notation) key in the file's frontmatter. Creates the frontmatter block if absent. Requires expected_frontmatter_hash unless file has no frontmatter yet.
Inputs: file (required), value (required), keyPath (required), vault, +2 more.
heading.findA
Find headings by leaf text OR by full Parent::Child::Leaf path. Returns ALL matches; surgical-edit tools require disambiguation when count > 1.
Inputs: file (required), heading (required), vault, delimiter.
heading.renameA
Rename a heading's text in place. Errors on missing/duplicate. Preserves heading level. Does NOT update backlinks (use bulk.apply for that).
Inputs: file (required), heading (required), newText (required), expected_section_hash (required), +3 more.
heading.replace_bodyA
Replace the BODY beneath a heading (not the heading line itself). Errors if heading missing or path is ambiguous. Requires expected_section_hash from heading.find/outline.
Inputs: file (required), content (required), heading (required), expected_section_hash (required), +3 more.
lines.insertA
Insert content before line N (1-based). Use line=totalLines+1 to append. No hash precondition required.
Inputs: file (required), line (required), content (required), vault, +1 more.
lines.replaceB
Replace a contiguous line range (1-based, inclusive). Requires expected_range_hash returned by file.read_range or outline (section_hash).
Inputs: to (required), file (required), from (required), content (required), +3 more.
links.getA
Return outlinks (from the given file) and/or backlinks (vault-wide search for refs targeting the file's basename).
Inputs: file (required), vault, direction.
metadata.readA
Read structural metadata for a file: frontmatter, headings, tags, link counts, total lines, content_hash.
Inputs: file (required), vault.
outlineA
Return the heading tree of a markdown file. Each entry includes path, level, line, end_line, section_hash, children_count, and (when applicable) duplicate_of[]. Use this to navigate large notes without reading them.
Inputs: file (required), vault, maxDepth.
search.contentA
Substring search across markdown files. Returns hits with surrounding context and per-line hashes (each hit can be surgically rewritten with str_replace).
Inputs: query (required), limit, vault, offset, +3 more.
str_replaceA
Surgical edit: replace a literal substring in a file. Default occurrence='unique' (errors on >1 match). Tiny payload in/out; preferred over file.replace for any edit smaller than the whole file.
Inputs: file (required), find (required), replace (required), vault, +3 more.
tags.listB
List tags found in a single file (when 'file' is supplied) or aggregated across the vault.
Inputs: file, vault, prefix.
vault.infoC
Get statistics for a single vault.
Inputs: vault, _budget.
vault.listA
List all configured vaults by name.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 32 tools
Each tool has a clearly distinct purpose. File operations, surgical edits, metadata queries, and vault management are all well-separated. Overlapping tools like multiple find functions are differentiated by target (e.g., block.find vs heading.find) or scope.
Most tools follow a domain.verb pattern (e.g., file.create, frontmatter.set). A few outliers like apply_edits or str_replace use a different convention, but they are still descriptive and do not cause confusion.
32 tools is on the higher side, but the Obsidian domain is rich: file management, frontmatter, headings, blocks, links, tags, search, vault info. Each tool serves a specific need, making the count reasonable for a full-featured MCP server.
The tool surface covers CRUD for files, frontmatter, headings, and blocks, plus querying for links, tags, and vault metadata. Planned features like file.diff are minor gaps; the server is highly comprehensive for Obsidian note management.
Maintenance
Related MCP Connectors
Hosted MCP server for Obsidian Sync vaults: read, search, edit notes. Not affiliated with Obsidian.
Cloud-hosted MCP server for durable AI memory
Remote MCP server for notes, tasks, kanban boards and docs - the Slates agentic workspace
AI memory governance & hallucination-blocking MCP server with verifiable knowledge cells.
Related MCP Servers
- AlicenseAqualityBmaintenanceFilesystem first MCP server for Obsidian vaults with an LLM-Wiki layer on top.6691 npm9Apache 2.0
- AlicenseAqualityCmaintenanceLocal-first MCP server for working with an Obsidian vault. No API key required1720MIT
- AlicenseNot gradedqualityDmaintenanceMCP server that implements Karpathy's LLM Wiki pattern for Obsidian vaults, enabling persistent knowledge storage and BM25 search across AI sessions.29 npm1MIT
- AlicenseAqualityCmaintenanceA filesystem-based MCP server for Obsidian vaults that enables LLMs to browse, search, read, write, and edit Markdown notes directly on disk without requiring Obsidian to be running.61CeCILL-B Free Software Agreement