Obsidian CLI MCP

v0.4.1
io.github.dariuscorvus/obsidian-cli-mcp Checked 2 days ago Published 3 months ago

Local MCP server for Obsidian Desktop via the official Obsidian CLI.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

note_read Read note

Read the full Markdown contents of a note by its vault-relative path.

ParameterTypeDescription
path *stringVault-relative path, e.g. 'Projects/Apollo.md'.

note_list List notes

List files in the vault, optionally filtered by folder and extension.

ParameterTypeDescription
extstringRestrict to a file extension, e.g. 'md'.
folderstringRestrict to a folder (vault-relative).
limitintegerMax number of files to return.
sortstringSort order.

vault_tags List tags

List all tags in the vault with their occurrence counts.

tasks_list List tasks

List tasks (checkboxes) in the vault. Scope to the whole vault, the daily note, or the active note.

ParameterTypeDescription
filterstringTask completion filter.
scopestringWhich notes to scan.

note_diff Diff note versions

Show a note's version history, or diff two versions. Omit from/to to list available versions.

ParameterTypeDescription
file *stringVault-relative path to the note.
fromintegerVersion number to diff from.
tointegerVersion number to diff to.

note_create Create note

Create a new note, optionally in a folder, from a template, with initial content and frontmatter.

ParameterTypeDescription
name *stringNote name (a '.md' extension is added if missing).
contentstringInitial Markdown content.
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.
folderstringDestination folder (vault-relative). Defaults to vault root.
frontmatterobjectFrontmatter keys to stamp on the new note.
overwritebooleanOverwrite if the note already exists.
templatestringObsidian template name to apply.

note_append Append to note

Append Markdown to a note, optionally under a specific heading.

ParameterTypeDescription
content *stringMarkdown to append.
path *stringVault-relative path to the note.
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.
headingstringIf set, append to the end of this heading's section.
inlinebooleanAppend without a leading newline (plain append only).

note_set_frontmatter Set note frontmatter

Patch a note's YAML frontmatter via processFrontMatter (never a raw rewrite). A null value removes a key.

ParameterTypeDescription
patch *objectKeys to set; a null value deletes the key.
path *stringVault-relative path to the note.
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.

daily_open Open daily note

Open today's daily note (creating it if needed).

ParameterTypeDescription
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.

daily_append Append to daily note

Append Markdown to today's daily note.

ParameterTypeDescription
content *stringMarkdown to append.
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.
inlinebooleanAppend without a leading newline.

note_replace_range Replace note text range

Replace a half-open text range in a vault note using zero-based UTF-16 line/ch positions. An optional expected value guards against stale reads.

ParameterTypeDescription
end *objectExclusive end position (zero-based line/ch).
path *stringVault-relative path to the note.
start *objectInclusive start position (zero-based line/ch).
text *stringReplacement text; may contain newlines.
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.
expectedstringOptional exact guard: the current text in the range must match this value.

note_insert_at Insert text at note cursor

Insert text at a zero-based UTF-16 line/ch cursor in a vault note. Optional surrounding context guards reject stale cursor positions.

ParameterTypeDescription
path *stringVault-relative path to the note.
position *objectInsertion cursor (zero-based line/ch).
text *stringText to insert at the cursor; may contain newlines.
contextAfterstringOptional exact text immediately after the cursor; rejects stale positions.
contextBeforestringOptional exact text immediately before the cursor; rejects stale positions.
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.

note_replace Replace note text

Compatibility alias for note_replace_range with the same positional and expected-text guards.

ParameterTypeDescription
end *objectExclusive end position (zero-based line/ch).
path *stringVault-relative path to the note.
start *objectInclusive start position (zero-based line/ch).
text *stringReplacement text; may contain newlines.
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.
expectedstringOptional exact guard: the current text in the range must match this value.

note_insert Insert note text

Compatibility alias for note_insert_at with the same cursor and context guards.

ParameterTypeDescription
path *stringVault-relative path to the note.
position *objectInsertion cursor (zero-based line/ch).
text *stringText to insert at the cursor; may contain newlines.
contextAfterstringOptional exact text immediately after the cursor; rejects stale positions.
contextBeforestringOptional exact text immediately before the cursor; rejects stale positions.
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.

file_import Import file into vault

Copy a local file from a configured import root into the vault. Destination names are collision-safe by default; source roots, size, destination policy, and dryRun are enforced.

ParameterTypeDescription
sourcePath *stringAbsolute local path to the file being imported.
collisionstringOverride the configured collision policy for this import.
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.
folderstringOptional vault-relative destination folder.
namestringOptional destination filename; defaults to the source filename.

attachment_import Import attachment into vault

Semantic alias for file_import for attachment-oriented callers; the same source, size, path, and collision guards apply.

ParameterTypeDescription
sourcePath *stringAbsolute local path to the file being imported.
collisionstringOverride the configured collision policy for this import.
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.
folderstringOptional vault-relative destination folder.
namestringOptional destination filename; defaults to the source filename.

note_attach Import and attach file to note

Import a local file into the vault and optionally insert a relative Obsidian embed into a note. The imported file is retained if the note insertion fails, with its recovery path in the error.

ParameterTypeDescription
note *stringVault-relative Markdown note to receive the embed.
sourcePath *stringAbsolute local path to the file being imported.
captionstringOptional embed caption, rendered as ![[file|caption]].
collisionstring
contextAfterstringOptional exact text immediately after the insertion cursor.
contextBeforestringOptional exact text immediately before the insertion cursor.
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.
embedbooleanInsert an Obsidian embed after importing the file.
folderstringOptional vault-relative destination folder for the imported file.
namestringOptional destination filename.
positionobjectOptional zero-based cursor for the embed insertion.

attachment_embed Import and embed attachment

Semantic alias for note_attach: import an attachment and embed it in a note with the same guards.

ParameterTypeDescription
note *stringVault-relative Markdown note to receive the embed.
sourcePath *stringAbsolute local path to the file being imported.
captionstringOptional embed caption, rendered as ![[file|caption]].
collisionstring
contextAfterstringOptional exact text immediately after the insertion cursor.
contextBeforestringOptional exact text immediately before the insertion cursor.
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.
embedbooleanInsert an Obsidian embed after importing the file.
folderstringOptional vault-relative destination folder for the imported file.
namestringOptional destination filename.
positionobjectOptional zero-based cursor for the embed insertion.

file_move Move vault file

Move a regular vault file to another vault-relative path with explicit collision policy.

ParameterTypeDescription
destination *string
path *string
collisionstring
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.

file_rename Rename vault file

Rename a vault file in its current folder with collision-safe naming.

ParameterTypeDescription
name *string
path *string
collisionstring
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.

file_delete Delete vault file

Delete one regular vault file. Requires confirm=true; dryRun can preview without confirmation.

ParameterTypeDescription
path *string
confirmboolean
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.

file_read_binary_metadata Read binary file metadata

Read MIME type, byte size, SHA-256, and supported image dimensions for a vault file.

ParameterTypeDescription
path *string

task_create Create task

Create a Markdown checkbox task in a note, optionally under a heading.

ParameterTypeDescription
note *stringVault-relative note receiving the task.
text *stringTask text.
checkedbooleanCreate the task as completed.
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.
headingstringOptional Markdown heading section to append under.
indentintegerNumber of leading spaces.

task_update Update task

Update one Markdown task at a zero-based line number. The optional expected line is an exact stale-read guard.

ParameterTypeDescription
line *integerZero-based line number of the task.
note *stringVault-relative note containing the task.
checkedbooleanNew completion state.
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.
expectedstringExact current task line; rejects stale updates when it differs.
textstringNew task text.

canvas_add_node Add Canvas node

Add one native Canvas node by type. Omitted IDs are deterministic from the requested node content.

ParameterTypeDescription
path *string
type *string
backgroundstring
backgroundStylestring
colorstring
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.
filestring
heightinteger
idstring
labelstring
subpathstring
textstring
urlstring
widthinteger
xinteger
yinteger

canvas_add_edge Add Canvas edge

Add one native Canvas edge between existing node IDs; endpoints are validated before writing.

ParameterTypeDescription
fromNode *string
path *string
toNode *string
colorstring
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.
fromEndstring
fromSidestring
idstring
labelstring
toEndstring
toSidestring

canvas_auto_layout Auto-layout Canvas

Deterministically lay out Canvas nodes using a dependency-free grid or hierarchical graph algorithm.

ParameterTypeDescription
path *string
algorithmstring
directionstring
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.
spacingXinteger
spacingYinteger
startXinteger
startYinteger

note_rename Rename note

Rename a note in place (new name). Backlinks are rewritten automatically.

ParameterTypeDescription
from *stringVault-relative path of the note to rename.
to *stringNew note name (basename, '.md' optional).
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.

note_move Move note

Move a note to another folder or path. Links are preserved.

ParameterTypeDescription
from *stringVault-relative path of the note to move.
to *stringDestination folder or vault-relative path.
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.

folder_create Create folder

Create a folder (and any missing intermediate folders) in the vault.

ParameterTypeDescription
path *stringVault-relative folder path to create.
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.

note_delete Delete note

Delete a note. Honors the configured delete.mode (trash by default, or permanent).

ParameterTypeDescription
path *stringVault-relative path of the note to delete.
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.

note_transition Transition note state

Move a note to a new lifecycle state, validated against a configured workflow. Sets the workflow's frontmatter property if the transition is allowed.

ParameterTypeDescription
path *stringVault-relative path to the note.
to *stringTarget state.
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.
workflowstringWorkflow name (required only if several are configured).

canvas_read Read Canvas

Read and validate a native Obsidian .canvas file, returning structured nodes and edges.

ParameterTypeDescription
path *stringVault-relative path ending in .canvas.

canvas_create Create Canvas

Create a native Obsidian .canvas file, optionally with initial nodes and edges. Existing files are not overwritten unless overwrite is true.

ParameterTypeDescription
path *stringVault-relative destination path ending in .canvas.
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.
edgesarrayInitial native Canvas edges.
nodesarrayInitial native Canvas nodes.
overwritebooleanExplicitly allow replacing an existing file.

canvas_upsert_nodes Upsert Canvas nodes

Add or partially update native Canvas nodes by stable ID. Existing nodes, edges, top-level fields, and unknown node fields are preserved.

ParameterTypeDescription
nodes *arrayNode patches keyed by stable id.
path *stringVault-relative path ending in .canvas.
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.

canvas_upsert_edges Upsert Canvas edges

Add or partially update native Canvas edges by stable ID. Existing unaddressed edges are preserved and endpoints must reference nodes.

ParameterTypeDescription
edges *arrayEdge patches keyed by stable id.
path *stringVault-relative path ending in .canvas.
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.

canvas_remove Remove Canvas items

Remove explicitly named node and/or edge IDs. Removing a node also removes every incident edge deterministically.

ParameterTypeDescription
path *stringVault-relative path ending in .canvas.
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.
edgeIdsarrayEdge IDs to remove.
nodeIdsarrayNode IDs to remove.

canvas_open Open Canvas

Open a native Obsidian .canvas file through the existing Obsidian CLI file-opening function.

ParameterTypeDescription
path *stringVault-relative path ending in .canvas.
dryRunbooleanPreview the change without applying it: returns the planned action and the exact CLI command.