obsidian-cli-mcp
Provides full control of an Obsidian vault through the Obsidian CLI, enabling reading, searching, writing notes, link-safe moves/renames, property management, and querying Bases and templates.
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-cli-mcp create a new note titled 'Meeting Notes' in my daily folder"
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.
obsidian-cli-mcp
An MCP server that gives Claude and other MCP clients full control of a running Obsidian vault through the official Obsidian CLI (Obsidian 1.12+), with fast direct filesystem reads where correctness allows it.
Companion project to things-for-mac-mcp.
What makes this different?
Most Obsidian MCP servers either talk to a community REST plugin or read the vault folder directly. The first requires installing and trusting a plugin. The second silently breaks wikilinks the moment it moves or renames a file, because only Obsidian knows about every link, alias, and embed pointing at it.
This server routes every operation by capability:
Typical filesystem-only MCPs | obsidian-cli-mcp | |
Full-text search across thousands of notes | Fast | Fast (filesystem) |
Move or rename a note | Breaks every inbound link | Link-safe (Obsidian CLI) |
Backlinks, aliases, unresolved links | Guesswork | Obsidian's own resolver |
Bases queries, template variables | Impossible | Runtime evaluation via the app |
Writes land in Obsidian's index and file recovery | No | Yes |
iCloud evicted files | Read as empty notes | Detected, read through Obsidian |
Requires a community plugin | Sometimes | No |
The architecture mirrors its sibling project exactly:
things-for-mac-mcp | obsidian-cli-mcp | |
Fast reads | SQLite direct | Filesystem direct |
Authoritative writes | AppleScript | Obsidian CLI |
Convenience creates | URL scheme | Obsidian CLI |
The rule behind the split: bulk reads go to the filesystem because they need throughput, and anything that moves, renames, deletes, or depends on link resolution or app state goes through the CLI because it needs Obsidian's knowledge. The filesystem adapter structurally cannot mutate the vault, it exports no writing function at all.
Related MCP server: obsidianMCP
Requirements
macOS, Windows, or Linux desktop with Obsidian 1.12 or later
The Obsidian CLI enabled: Obsidian, Settings, General, Command line interface
Obsidian must be running. The CLI is a client to the app, not a standalone binary. This is desktop only, mobile is not supported.
Node.js 18 or later
Installation
git clone https://github.com/jabaho9523/obsidian-cli-mcp.git
cd obsidian-cli-mcp
npm install
npm run buildConnect to an MCP client
Claude (Desktop / Code)
Add to claude_desktop_config.json (Claude Desktop) or run claude mcp add (Claude Code):
{
"mcpServers": {
"obsidian": {
"command": "/absolute/path/to/node",
"args": ["/absolute/path/to/obsidian-cli-mcp/dist/index.js"],
"env": {
"OBSIDIAN_VAULT": "YourVaultName"
}
}
}
}Use the absolute path to node, not the bare word. GUI-launched apps do not inherit your shell's PATH, so "command": "node" fails silently in many clients. Find yours with which node.
Set OBSIDIAN_VAULT if you have more than one vault. The CLI otherwise targets whichever vault was focused last, which is a terrible property for automated writes. With a single vault the server pins it automatically at startup.
Configuration
Variable | Default | Purpose |
|
| Path to the Obsidian CLI binary |
| auto-pinned if exactly one vault exists | Vault name every command targets |
| auto-detected via the CLI | Vault folder for the filesystem adapter |
|
| Per-command timeout in ms |
| unset | Set to |
| unset | Set to |
Guardrails
Three tiers, enforced before the binary is ever spawned:
Tier 1, free: reads, searches, and additive writes (
create_note,append_note,append_daily,set_property,update_task,capture).Tier 2, requires
confirm: truein the tool call:delete_note,move_note,rename_note,remove_property,run_obsidian_command, and through the passthrough:history:restore,publish:*,plugin:enable/disable/reload,theme:*,snippet:*,sync,sync:restore,reload,template:insert,workspace:save/delete. Any call carrying anoverwriteorpermanentflag is escalated to tier 2 as well.Tier 3, blocked unless the server runs with
OBSIDIAN_MCP_ALLOW_DANGEROUS=1:eval,restart,plugin:install,plugin:uninstall,plugins:restrict,devtools,dev:cdp,dev:debug,dev:mobile, anddelete_notewithpermanent: true.
An honest note on what these are. Tier 2 is a speed bump against accidental calls, not security: the calling model can set confirm: true itself. Tier 3 is a real boundary, because only whoever configures the server environment can unlock it. If you point an autonomous agent at a vault you care about, run with OBSIDIAN_MCP_READONLY=1, which rejects every mutating command before dispatch regardless of tier.
Link-safe moves and renames
The single most important rule in this project: files are never moved, renamed, or deleted through the filesystem. Obsidian updates every wikilink in the vault when it performs the operation. A plain mv does not.
Before, with Projects/Roadmap.md linked from three notes:
Weekly Review.md: Progress on [[Roadmap]] is on track.
Team Notes.md: See [[Roadmap#Q3]] for the plan.
Index.md: - [[Roadmap|2026 roadmap]]After move_note with to: "Archive/2026 Roadmap.md":
Weekly Review.md: Progress on [[2026 Roadmap]] is on track.
Team Notes.md: See [[2026 Roadmap#Q3]] for the plan.
Index.md: - [[2026 Roadmap|2026 roadmap]]All three links updated, including the heading anchor and the alias, because Obsidian did the move. A filesystem move would have left three broken links and no error.
Why hybrid? The performance rationale
Every CLI invocation is one full IPC round trip through the running Obsidian app. That is correct but slow: reading 2,000 notes via obsidian read is 2,000 round trips, minutes of wall time. Reading them from disk is one directory walk, well under a second on any SSD.
So bulk reads (search, listings, tag and property scans, exports, digests) hit the filesystem, and the CLI is reserved for what only Obsidian can answer (links, aliases, Bases, templates, app state) and for every write. To compare on your own vault, time search_notes against the passthrough obsidian_cli with ["search", "query=..."].
Troubleshooting
"Obsidian is not running." The most common failure. The CLI needs the app open and fully loaded. Start Obsidian and retry.
"Could not find the Obsidian CLI binary." Enable the CLI in Obsidian under Settings, General, Command line interface, or point OBSIDIAN_BIN at the binary.
Timeouts on the first command. A cold Obsidian start can exceed the 20s default. Raise OBSIDIAN_MCP_TIMEOUT.
Notes read as missing or the server falls back to the CLI a lot. If your vault lives in iCloud with Optimize Mac Storage on, evicted files exist only as .name.icloud stubs. The server detects these and reads them through Obsidian, which re-downloads them, instead of reporting empty notes. Bulk scans skip evicted files and say so in their output.
Writes land in the wrong vault. You have multiple vaults and no OBSIDIAN_VAULT set. The server warns about this on stderr at startup. Pin one.
Tools do not appear in the client. Check the client's MCP logs, and check the absolute node path issue above.
Staying up to date
git pull && npm install && npm run buildThe server checks for updates at startup, at most once per 24 hours, caching the result in ~/.config/obsidian-cli-mcp/update-check.json. It fails silently offline and prints a single stderr line when a newer version exists.
Tools (39 total)
Read tools (18)
Tool | Adapter | Description |
| Filesystem, CLI fallback | Read a note by wikilink-style name or exact path |
| Filesystem | Full-text search with folder, case, context, and limit options |
| Filesystem | List files, filtered by folder and extension |
| Filesystem | List folders |
| CLI | Path, size, created and modified dates |
| Filesystem | Heading tree with line numbers |
| CLI | Inbound links, resolved by Obsidian |
| CLI | Outbound links |
| Filesystem | All tags with counts, frontmatter and inline |
| Filesystem | Vault-wide frontmatter keys with counts |
| Filesystem | One frontmatter key on one note |
| CLI | Vault name, path, stats |
| CLI | Recently opened files |
| CLI | All .base files |
| CLI | Run a Bases view query, evaluated by the app |
| CLI | Templates in the configured folder |
| CLI | Template content, optionally with variables resolved |
| Filesystem | Words and characters, excluding frontmatter |
Write tools (16)
All writes go through the CLI. Every one requires an explicit file or path target, none can fall through to the currently active file.
Tool | Guard tier | Description |
| 1, 2 with | Create a note, optionally from a template |
| 1 | Append content |
| 1 | Prepend content after frontmatter |
| 1 | Read today's daily note |
| 1 | Append to today's daily note |
| 1 | Prepend to today's daily note |
| 1 | Path of today's daily note |
| 1 | Set a frontmatter property |
| 2 | Remove a frontmatter property |
| 2 | Link-safe move |
| 2 | Link-safe rename |
| 2, 3 with | Delete to trash, or permanently |
| 1 | List markdown tasks with refs |
| 1 | Toggle or set task status by ref or line |
| 1 | Open in the Obsidian UI, navigation only |
| 2 to execute | List or run command palette commands, including plugin commands |
run_obsidian_command is the widest door in the server: it reaches every command palette action, including those registered by community plugins. It is exposed deliberately and gated at tier 2.
Workflow tools (4)
Tool | Description |
| Timestamped append to today's daily note, the highest frequency operation in practice |
| Aggregate a date range of daily notes into one document |
| Export a folder as JSON, Markdown, or CSV, inline or to a file outside the vault |
| Orphans, dead ends, unresolved links, and empty notes in one report. Deliberately scoped to the link graph |
Escape hatch (1)
Tool | Description |
| Run any CLI command. Takes |
MCP Resources
Client support for resources varies, Claude Desktop does not currently surface them.
Resource | Content |
| Vault info |
| Today's daily note |
| All tags with counts |
| Recently opened files |
| Notes with no inbound links |
| Any note by vault-relative path |
MCP Prompts
Prompt | Purpose |
| Summarize a daily note, surface open tasks, suggest follow-ups |
| Walk the vault health report and propose link-safe fixes |
| Turn pasted material into a note using an existing template |
| Summarize a week of daily notes into a digest note |
Architecture
src/
├── index.ts MCP server entry, stdio transport
├── config.ts Environment configuration
├── adapters/
│ ├── cli.ts execFile wrapper, vault injection, error contract
│ └── filesystem.ts Read-only vault access, iCloud stub detection
├── tools/
│ ├── common.ts Shared note loading with CLI fallback
│ ├── read.ts 18 read tools
│ ├── write.ts 16 write tools
│ ├── workflow.ts 4 composite tools
│ └── passthrough.ts obsidian_cli escape hatch
├── resources/
│ └── vault.ts MCP resources
├── prompts/
│ └── workflows.ts MCP prompts
└── utils/
├── guardrails.ts Tier policy, readonly allowlist
├── markdown.ts Frontmatter, headings, tags, word counts
├── output.ts Truncation at 60,000 characters
└── update-check.ts Daily update checkTests run against a stub binary that scans its full argv and can be told to fail, hang, or emit oversized output, so the whole suite passes with no Obsidian installed:
npm testSupport
Issues and feature requests: GitHub issues.
More from the author
things-for-mac-mcp, the sibling MCP server for Things 3
License
MIT
Available Tools
39 toolsappend_dailyAppend to daily noteA
Append content to today's daily note, creating it from the daily template if needed.
Inputs: content (required), inline.
append_noteAppend to noteC
Append content to the end of a note through Obsidian.
Inputs: content (required), file, path, inline.
captureCaptureA
Append a timestamped line to today's daily note. The fastest way to log a thought, a task, or an event without building the string yourself.
Inputs: text (required), timestamp.
create_noteCreate noteA
Create a new note through Obsidian so it lands in the index immediately. Does not open the note in the UI. Overwriting an existing note requires overwrite plus confirm: true.
Inputs: name, path, confirm, content, +2 more.
daily_digestDaily digestA
Aggregate daily notes across a date range into one document, read from the filesystem. Defaults to the last 7 days. Requires daily note filenames containing an ISO date (YYYY-MM-DD).
Inputs: to, from, include_frontmatter.
delete_noteDelete noteA
Delete a note through Obsidian. Goes to the trash by default and requires confirm: true. Permanent deletion additionally requires the server to run with OBSIDIAN_MCP_ALLOW_DANGEROUS=1.
Inputs: file, path, confirm, permanent.
export_notesExport notesA
Export a folder of notes as JSON, Markdown, or CSV, read from the filesystem. Returns the export inline, or writes it to output_path outside the vault.
Inputs: folder, format, confirm, output_path.
get_backlinksGet backlinksA
Notes that link to the given note, resolved by Obsidian itself so aliases and unresolved links are handled correctly.
Inputs: file, path, counts.
get_daily_pathGet daily note pathB
Vault-relative path of today's daily note.
Inputs: no named parameters.
get_note_infoGet note infoA
Metadata for one note via Obsidian: path, size, created and modified dates.
Inputs: file, path.
get_outgoing_linksGet outgoing linksC
Links going out from the given note, resolved by Obsidian.
Inputs: file, path.
get_outlineGet outlineB
Heading tree of a note, with heading levels and line numbers.
Inputs: file, path.
get_propertiesGet propertiesA
All frontmatter property keys used across the vault, with usage counts, scanned from the filesystem.
Inputs: sort, limit.
get_recentsGet recent filesB
Recently opened files, from Obsidian app state.
Inputs: no named parameters.
get_tagsGet tagsB
All tags in the vault with usage counts, from frontmatter and inline tags, scanned from the filesystem.
Inputs: sort, limit.
get_vault_infoGet vault infoB
Vault name, path, and file, folder, and size stats from Obsidian.
Inputs: info.
get_word_countGet word countB
Word and character count for a note, excluding frontmatter.
Inputs: file, path.
list_basesList basesB
List all .base files in the vault.
Inputs: no named parameters.
list_foldersList foldersC
List folders in the vault from the filesystem.
Inputs: total, folder.
list_notesList notesB
List files in the vault from the filesystem, optionally filtered by folder and extension.
Inputs: ext, total, folder.
list_tasksList tasksA
List markdown tasks, vault-wide or in one note. Each task has a ref (path:line) usable with update_task.
Inputs: file, path, total, filter, +1 more.
list_templatesList templatesA
List templates from the configured template folder in Obsidian.
Inputs: no named parameters.
move_noteMove noteA
Move a note to a new location through Obsidian, which updates every wikilink in the vault that points at it. Never move notes with plain filesystem operations, that silently breaks links. Requires confirm: true.
Inputs: to (required), file, path, confirm.
obsidian_cliObsidian CLI passthroughA
Run any command against the Obsidian vault via the official Obsidian CLI. Escape hatch for the long tail not covered by the typed tools. Obsidian must be running on this Mac.
Syntax Parameters take a value with = e.g. "query=meeting notes" Flags are bare words e.g. "todo", "total", "counts" Multiline content uses \n and \t inside the value file= resolves like a wikilink, path= is exact from the vault root Omitting file and path targets the currently active file, avoid this for writes
Vault targeting is handled automatically: a vault= token is prepended unless you pass your own.
Examples ["search", "query=quarterly review", "limit=10"] ["tasks", "todo", "verbose"] ["backlinks", "file=Main Notes", "counts"] ["files", "folder=Journal", "total"] ["help"] for the full command list, ["help", "tasks"] for one command
State-changing commands (delete, move, rename, plugin toggles, themes, snippets, publish, command execution) require confirm: true. A few (eval, restart, plugin install and uninstall, devtools) are blocked unless the server runs with OBSIDIAN_MCP_ALLOW_DANGEROUS=1.
Inputs: args (required), vault, confirm, timeout_ms.
open_noteOpen noteA
Open a note in the Obsidian UI. Navigation only, changes nothing.
Inputs: file, path, newtab.
prepend_dailyPrepend to daily noteA
Prepend content to today's daily note, after any frontmatter.
Inputs: content (required), inline.
prepend_notePrepend to noteB
Prepend content to a note, after any frontmatter, through Obsidian.
Inputs: content (required), file, path, inline.
query_baseQuery baseA
Run a Bases query through Obsidian, which evaluates filters and formulas at runtime. Returns the rows of a view in the chosen format.
Inputs: file, path, view, format.
read_dailyRead daily noteA
Read today's daily note. Creates nothing.
Inputs: no named parameters.
read_noteRead noteB
Read the full content of a note. Reads from the filesystem for speed, falls back to the Obsidian CLI when the name only resolves via aliases or the file is evicted by iCloud.
Inputs: file, path.
read_propertyRead propertyC
Read one frontmatter property from one note.
Inputs: name (required), file, path.
read_templateRead templateB
Read a template. With resolve, Obsidian expands template variables like {{date}} and {{title}}.
Inputs: name (required), title, resolve.
remove_propertyRemove propertyB
Remove a frontmatter property from a note. Requires confirm: true.
Inputs: name (required), file, path, confirm.
rename_noteRename noteB
Rename a note through Obsidian, which updates every wikilink in the vault that points at it. Requires confirm: true.
Inputs: name (required), file, path, confirm.
run_obsidian_commandRun Obsidian commandA
List or execute command palette commands, including those registered by community plugins. Without id, lists available command ids. With id, executes that command against the running app, which requires confirm: true. This reaches everything a user could do from the command palette, use it deliberately.
Inputs: id, filter, confirm.
search_notesSearch notesA
Full-text search across all markdown notes in the vault, from the filesystem for speed. Returns matching lines with file paths and line numbers.
Inputs: query (required), case, path, limit, +1 more.
set_propertySet propertyC
Set a frontmatter property on a note through Obsidian.
Inputs: name (required), value (required), file, path, +1 more.
update_taskUpdate taskA
Mark a task done or todo, toggle it, or set a custom status character. Target by ref (path:line, from list_tasks) or by file or path plus line.
Inputs: ref, file, line, path, +2 more.
vault_healthVault healthA
Link graph health in one call: orphans (no incoming links), dead ends (no outgoing links), unresolved links, and empty notes. Link data comes from Obsidian, empty notes from a filesystem scan. Deliberately scoped to the link graph.
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 39 tools
Most tools target a distinct resource+action pair (notes, properties, tasks, links, daily notes, bases), and descriptions are explicit about reads vs writes. A few pairs blur: capture vs append_daily (both write to today's daily note), read_daily vs read_note, and run_obsidian_command vs obsidian_cli (both are generic action executors). get_daily_path is also trivially derivable from other daily tools.
The dominant pattern is snake_case verb_noun (create_note, get_outline, list_notes, remove_property, update_task). Deviations exist: bare verbs (capture), noun-only (obsidian_cli), noun_noun (vault_health, daily_digest), and daily tools drop the '_note' suffix (read_daily, append_daily). Still readable and mostly predictable.
39 tools is well past a comfortable surface for one vault server; several are niche or redundant (get_daily_path, capture, get_recents, read_daily alongside read_note). The typed tools plus an unrestricted obsidian_cli escape hatch also duplicates capability rather than replacing it, inflating the count further.
Coverage is broad: note lifecycle (create/read/append/prepend/move/rename/delete), frontmatter properties, tasks, links, search, templates, bases, export, and vault health. Gaps are modest: no section/heading-level replace or patch edit, no folder creation/removal, and no attachment handling, all of which are workable via the escape hatch.
Related MCP Connectors
Notes and memory assistant: one Markdown vault that Claude, ChatGPT and any MCP client can share.
Hosted MCP server for Obsidian Sync vaults: read, search, edit notes. Not affiliated with Obsidian.
Let ChatGPT and Claude read and edit files, search and run commands on your own computer.
Remote MCP gateway for 20-folder Obsidian vaults in TOON format (-36.7% to -45% LLM tokens).
Related MCP Servers
- AlicenseAqualityCmaintenanceGive Claude (and any MCP client) real agent access to your Obsidian vault — graph traversal, Dataview queries, daily-note awareness, and more.2512 npm1MIT
- FlicenseNot gradedqualityDmaintenanceProvides Claude with read, search, and write access to an Obsidian vault through MCP tools.-
- AlicenseAqualityCmaintenanceA local MCP connector that lets Claude read, write and search any Obsidian vault directly from disk.20MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables bidirectional interaction with Obsidian vaults, allowing reading, writing, and organizing notes through Claude.MIT