npx skills add ...
npx skills add bitbonsai/mcpvault --skill obsidian
Activate when the user mentions their Obsidian vault, notes, tags, frontmatter, daily notes, backup, or sync. Route operations across MCP, Obsidian CLI/app actions, and git sync with safe defaults.
npx skills add bitbonsai/mcpvault --skill obsidian
Use the backend that best matches user intent:
MCP (default for vault data operations)
move_note, then explicitly repair backlinksObsidian CLI/App context (only when app context is needed)
CLI git (sync/backup workflows)
When a request is ambiguous, pick MCP first unless the user explicitly asks for sync/backup/git/app behavior.
Use MCP move_note for every note move or rename, even when Obsidian is running. Do not invoke the Obsidian CLI move command automatically: delayed link rewrites can apply stale byte offsets to notes edited after the move began, silently corrupting unrelated content (#176). Reconsider CLI moves only after an upstream fix has been independently retested.
Backlink preservation is an explicit, verifiable second step:
backlinks command may supplement discovery, but it does not replace the MCP search.move_note.|alias) and #heading / #^block-id suffixes while changing the target.search_notes returns at most 20 results. If a search reaches that cap, or the old basename is ambiguous, tell the user exhaustive backlink repair cannot be proven and ask before continuing with a broader scan.Report the move and backlink repair separately: which note moved, how many referring notes changed, and any stale references that remain.
patch_note rejects multi-match by default. With replaceAll: false, if oldString appears more than once the call fails and returns matchCount. Set replaceAll: true only when you mean it, or add surrounding context to make the match unique.
patch_note matches inside frontmatter. The replacement runs against the full file including the YAML block. A generic string like title: will match frontmatter fields. Include enough context to target the right occurrence.
patch_note forbids empty strings. Both oldString and newString must be non-empty and non-whitespace. To delete text, use newString with a single space or restructure the note with write_note.
search_notes returns minified JSON. Fields are abbreviated: p (path), t (title), ex (excerpt), mc (matchCount), ln (lineNumber), uri (obsidianUri). Hard cap of 20 results regardless of limit.
search_notes multi-word queries score terms individually AND as a phrase. Each term is OR-matched, so a document matching any term appears in results. The full phrase gets an additional scoring boost.
write_note auto-creates directories. Parent folders are created recursively. In append/prepend mode, if the note doesn't exist it's created. Frontmatter is merged (new keys override) in append/prepend; replaced entirely in overwrite.
delete_note requires exact path confirmation. confirmPath must be character-identical to path. No normalization, no trailing-slash tolerance. Mismatch silently fails with success: false.
move_file needs double confirmation. Both confirmOldPath and confirmNewPath must exactly match their counterparts. Use move_note for markdown renames (text-aware, no confirmation needed); use move_file only for binary files or when you need binary-safe moves.
manage_tags reads from two sources but writes to one. list merges frontmatter tags + inline #hashtags. add/remove only modify the frontmatter tags array. Inline tags are never touched.
read_multiple_notes never rejects. Uses allSettled internally. Failed files appear in the err array; successful ones in ok. Always check both. Hard limit of 10 paths per call.
| Error | Next step |
|---|---|
| patch_note "Found N occurrences" | Add surrounding lines to oldString to make it unique, or set replaceAll: true |
| delete_note / move_file confirmation mismatch | Re-read the note path with read_note or list_directory, then retry with the exact string |
| search_notes returns 0 results | Try single keywords instead of phrases, toggle searchFrontmatter, or broaden with partial terms |
read_multiple_notes partial err | Verify failed paths with list_directory, fix typos or missing extensions, retry only failed ones |
When the user asks to "sync", "backup", or "store my vault with git", use CLI git with this behavior:
Run a preflight before changing anything:
git availablegit config user.name and git config user.email are setIf preflight is incomplete, ask exactly one targeted question with a recommended default.
git pull --rebase now? (Recommended: Yes)"Safe sync sequence (never force push by default):
git add -Agit commit -m "vault sync: YYYY-MM-DD HH:mm" (skip commit if no changes)git pull --rebasegit pushgh is optional:
gh only for remote bootstrapping (create repo / set origin) when requested.gh for normal sync once remote is configured.Stop on conflicts and report clear next steps.
When the user asks for app-context operations (active file, open in editor, daily notes with templates, backlinks), use the Obsidian CLI directly via shell commands.
Run a preflight before first CLI use:
Resolve the CLI binary using the first match from these candidates:
| Priority | macOS | Linux | Windows |
|---|---|---|---|
| 1 | obsidian (PATH) | obsidian (PATH) | obsidian.exe or Obsidian.com (PATH) |
| 2 | /Applications/Obsidian.app/Contents/MacOS/obsidian-cli | — | — |
| 3 | /Applications/Obsidian.app/Contents/MacOS/Obsidian | — | — |
Obsidian 1.12.7+ installer bundles a dedicated
obsidian-clibinary (~10x faster than the legacy Electron-based CLI: ~25ms vs ~250ms per call). On macOS, after installing the 1.12.7+ installer, disable then re-enable the CLI in Settings > General > Advanced to update PATH registration. This replaces the old~/.zprofilePATH entry with a/usr/local/bin/obsidiansymlink pointing toobsidian-cli.On Linux, PATH registration creates a symlink at
/usr/local/bin/obsidian(or~/.local/bin/obsidianas fallback). On Windows, the installer places anObsidian.comterminal redirector alongsideObsidian.exe.Note: The priority table and stale PATH check are verified on macOS only. Linux and Windows may also bundle
obsidian-cliwith the 1.12.7+ installer, but this has not been confirmed. Contributions welcome via issue or PR.
Stale PATH check (macOS): If priority 1 resolved obsidian on PATH, check
whether it points to the fast binary or the slow Electron launcher:
| Resolved path | Meaning | Action |
|---|---|---|
/usr/local/bin/obsidian → obsidian-cli | 1.12.7 symlink registration | None — fast binary |
/Applications/.../MacOS/obsidian | Old ~/.zprofile entry (pre-1.12.7 registration or 1.12.7 installer without re-registering) | Check if obsidian-cli exists in the bundle |
If obsidian resolves to the MacOS directory (not /usr/local/bin) AND
/Applications/Obsidian.app/Contents/MacOS/obsidian-cli exists, tell the user:
"Obsidian 1.12.7+ is installed but PATH still points to the slower Electron
binary. In Obsidian, go to Settings > General > Advanced and disable then
re-enable the CLI to update PATH registration."
Continue with whichever priority matched — this is advisory, not blocking.
Check Obsidian is running: pgrep -xiq obsidian (macOS/Linux) or tasklist /FI "IMAGENAME eq Obsidian.exe" /NH (Windows)
If either fails, tell the user and fall back to MCP tools + obsidian:// URIs
Vault targeting: obsidian vault="VaultName" <command>. If OBSIDIAN_VAULT_NAME is set, use that explicit value. Otherwise run obsidian vaults, match the MCP vault path to a registered vault, and use its registered name. If no unique match exists, ask the user. Never infer the registered name from the folder basename.
Key commands:
Do not use obsidian move; follow Safe Note Rename Workflow with MCP move_note and explicit backlink repair.
Run obsidian help for the full command reference. The CLI evolves with Obsidian releases.
When to use CLI vs MCP:
move_note, repair and verify backlinks explicitly with the Safe Note Rename WorkflowLoad these only when needed, not on every invocation.