obsidian-mcp
Wraps the Obsidian CLI to allow an LLM agent to interact with a running Obsidian instance, enabling read/write notes, search, manage frontmatter, navigate links, run plugins, and more.
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-mcp search my vault for notes tagged 'meeting'"
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-mcp
MCP server that wraps the official Obsidian CLI so an LLM agent can drive a running Obsidian instance — read/write notes, search, manage frontmatter, navigate links, run plugins, and more.
This server is a thin, comprehensive wrapper. Every tool maps 1:1 to an obsidian CLI command.
Prerequisites
Obsidian must be running. The CLI talks to the live app over IPC; it does not read the vault on disk directly.
Register the CLI binary. In Obsidian: Settings → General → Command line interface → Register CLI. Obsidian will add
obsidianto yourPATH.Verify:
obsidian versionprints the CLI version.
Related MCP server: Vault Cortex Obsidian MCP Server
Install
Two paths depending on whether you want to build it yourself or grab a pre-published version from npm.
Option A — Clone & build (works today)
Clone the repo and build locally, then point Claude Code at the built file:
git clone https://github.com/yuchichang/obsidian-mcp.git
cd obsidian-mcp
npm install
npm run buildRegister it with Claude Code (one command):
# Add (user scope — available across all projects)
claude mcp add -s user obsidian -- node /absolute/path/to/obsidian-mcp/dist/index.js
# Remove
claude mcp remove obsidian
# List configured servers
claude mcp list-s user registers it for your whole user account. Use -s project to commit it to the repo's .mcp.json instead, or -s local for the current project only (default).
Or write it into .mcp.json manually:
{
"mcpServers": {
"obsidian": {
"command": "node",
"args": ["/absolute/path/to/obsidian-mcp/dist/index.js"]
}
}
}Option B — Install from npm (zero-build)
Prerequisite: the package must already be published to npm. The maintainer publishes once via
npm publish; all subsequent users get it vianpxautomatically. If you forked this repo and want this flow under your own scope, changenameinpackage.jsonto@<your-npm-username>/obsidian-mcp, thennpm publish.
Once published, no clone or build needed:
claude mcp add -s user obsidian -- npx -y @yuchichang/obsidian-mcpOr in .mcp.json / Claude Desktop's claude_desktop_config.json:
{
"mcpServers": {
"obsidian": {
"command": "npx",
"args": ["-y", "@yuchichang/obsidian-mcp"]
}
}
}Override the CLI path
If obsidian isn't on PATH, set the OBSIDIAN_CLI env var. Works with either install path:
{
"mcpServers": {
"obsidian": {
"command": "node",
"args": ["/absolute/path/to/obsidian-mcp/dist/index.js"],
"env": {
"OBSIDIAN_CLI": "C:/Users/you/AppData/Local/Obsidian/obsidian.cmd"
}
}
}
}Tools
Vault & files
Tool | Wraps |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Frontmatter properties
Tool | Wraps |
|
|
|
|
|
|
Search
Tool | Wraps |
|
|
|
|
Tags & links
Tool | Wraps |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Daily notes
Tool | Wraps |
|
|
|
|
|
|
Plugins
Tool | Wraps |
|
|
|
|
|
|
|
|
Developer / advanced
Tool | Wraps | Notes |
|
| ⚠️ Runs arbitrary JS inside Obsidian. Treat as destructive. |
|
| Returns base64 PNG. |
|
| |
|
|
Meta
Tool | Wraps |
| reports the persistent topic → folder map for a vault |
| binds a topic to a folder (no prompt) |
| removes a topic from the persistent store |
| lists root-level notes with preview for bulk-organize |
| validates + applies a routing plan (dry-run supported) |
|
|
|
|
Conventions
Targeting a note — file-targeting tools accept either:
file— wikilink-style note name (e.g."My Note"), orpath— vault-relative file path (e.g."Folder/My Note.md").
Multi-vault setups — every tool accepts an optional
vaultparameter. When omitted, the most recently focused vault is used.Output format — list/search/metadata tools default to JSON for easy machine parsing.
Sensitive operations & user confirmation
The following tools are gated behind a user-confirmation step:
Tool | Reason |
| Removes data (especially with |
| Renames + rewrites wikilinks across the vault. |
| Removes frontmatter data. |
| Bulk-rewrites tags across every note. |
| Grants a community plugin code execution. |
| Runs arbitrary JavaScript inside Obsidian. |
How the gate works:
MCP elicitation (preferred). If the connected client supports the
elicitationcapability (Claude Code does), the server sends anelicitation/createrequest and the client shows the user a Proceed? prompt with the action and target spelled out. Onlyaccept + confirm: trueproceeds.Explicit
confirm: trueparameter. Every sensitive tool's input schema includes an optionalconfirm: boolean. Passingconfirm: trueskips the elicitation prompt — use this only when the caller has already obtained user approval.Refusal fallback. If the client doesn't support elicitation and
confirm: truewas not provided, the tool returns anisErrorresult that names the action and instructs the caller to retry withconfirm: true.
Bypass for batch / automation
OBSIDIAN_MCP_AUTO_CONFIRM=1Set this env var (in your MCP client's env block) to skip every confirmation prompt. Use only in fully-trusted automation contexts.
Topic → folder routing (vault-aware, persistent)
The MCP runs a per-vault topic store at ~/.obsidian-mcp/<vault>/topic-map.json. It learns where each topic of note belongs and reuses that decision next time.
Agent: create_note(path="kungpao.md", topic="recipe-chinese", vault="MyVault")
↓
MCP: is "recipe-chinese" already in the store?
├── yes → use the stored folder, increment usage, write
└── no → scan vault for similar folders ("Recipes/Chinese", "食譜/中式" …)
→ MCP elicits the user: "Where should 'recipe-chinese' notes live?
Suggestions: ..."
→ user types or picks a folder
→ MCP records the route, then writesWhat lives where, and why:
The persistent store, not env vars, is the source of truth — the MCP is the only thing that sees vault state across sessions, so storing the conventions there is what gives this layer its leverage.
The user is asked once per topic; subsequent notes for the same topic land silently.
Folders are auto-created by the Obsidian CLI as deep as needed — no
mkdirfrom the MCP.
Resolution order
Condition | Action | |
1 |
| Used as-is, topic ignored. |
2 |
| Reuse stored folder, increment usage. |
3 |
| Treat as pre-decided; record in store. |
4 |
| Scan vault, prompt user, record answer. |
5 |
| Auto-create |
6 | No topic, no folder | Write at vault root. |
Topic-store tools
Tool | What it does |
| Show the learned map for a vault, sorted by usage. |
| Bind |
| Forget a topic from the store (existing notes untouched). |
Theory pointers
Faceted folder routing here is the simplest slice of a much larger idea. Worth reading if you want to push further:
Ranganathan, S.R. (1933) Colon Classification — PMEST facets
Ranganathan, S.R. (1931) Five Laws of Library Science
Tiago Forte (2022) Building a Second Brain — PARA method (actionability axis)
Niklas Luhmann (1981) "Kommunikation mit Zettelkästen" — graph-over-tree
Bates, M.J. (1989) "The design of browsing and berrypicking"
Bulk organize root notes
When the vault root accumulates loose .md files, a caller LLM can sweep them into the right subfolders in three steps:
Scan — list root notes with metadata + body preview:
// tool: obsidian_scan_root { "ignore": ["Daily/*", "*.excalidraw.md"] }Classify (caller side) — the LLM reads each preview and proposes a routing plan:
[ { "path": "WebRTC 連線建立流程.md", "target_folder": "webrtc", "topic": "webrtc", "reason": "covers signaling/SDP/ICE" }, { "path": "舊筆記.md", "target_folder": "Notes", "topic": "misc" } ]Apply — dry-run first to preview, then call again with
dry_run: false:// tool: obsidian_organize_apply { "plan": [...], "dry_run": true } // → { "summary": { "will_move": 2, "will_create_folders": 1, ... }, "items": [...] } { "plan": [...], "dry_run": false, "confirm": true } // → moves files, creates new folders as needed, registers topic→folder mappings
Per-entry failure isolation: a single move failure marks that entry status: "failed" without aborting the rest of the batch. Successful moves with a topic field are recorded in the persistent topic store, so future single-note writes for that topic auto-route.
Long content & argv limits
The Obsidian CLI does not (yet) support reading parameter values from stdin or from files — every value travels on the command line. That collides with platform limits:
Platform | Practical command-line limit |
Windows (cmd.exe) | ~8,191 chars total |
macOS / Linux |
|
To stay safe, the server automatically chunks long writes:
Tool | Chunking strategy |
| First chunk via |
| Sequential |
|
|
| Resolves the daily note path, then chunked append. |
| Not chunked — JS can't be split. Returns an error suggesting the script-via-note workaround. |
Splits happen at line boundaries when possible; oversized single lines fall back to UTF-8-safe character boundaries. Reassembled content is byte-identical to the original.
Configure the per-call byte threshold (defaults: 6,000 on Windows, 100,000 elsewhere):
OBSIDIAN_MCP_MAX_ARG_BYTES=4000If a chunk in the middle of a multi-chunk write fails, the server returns isError with a clear message stating which chunks made it to disk so the caller can recover.
Develop
npm run dev # tsc --watch
npm run inspect # launch MCP Inspector against the built server
node scripts/smoke-test.mjs # initialize + tools/list smoke testHow it works
runObsidian() (src/exec.ts) shell-quotes arguments, invokes the obsidian binary via child_process.exec, and parses stdout. Most read-style tools request format=json; results are parsed to structuredContent for clients that consume structured tool output, while still returning a text representation in content.
Tool registry lives in src/tools.ts — adding a new wrapped command is a single entry there.
Reference
Obsidian CLI: https://obsidian.md/help/cli
MCP spec: https://modelcontextprotocol.io
Available Tools
34 toolsobsidian_append_noteAppend to a noteA
Appends markdown content to the end of an existing note.
Inputs: content (required), vault, file, path.
obsidian_create_noteCreate a new noteB
Creates a new note. name is the path (relative to the vault root), with or without the .md extension.
Inputs: name (required), vault, content, template.
obsidian_daily_appendAppend to today's daily noteA
Appends content to today's daily note (creates it if missing).
Inputs: content (required), vault.
obsidian_daily_pathGet today's daily note pathARead-only
Returns the file path of today's daily note.
Inputs: vault.
obsidian_daily_readRead today's daily noteARead-only
Returns the content of today's daily note.
Inputs: vault.
obsidian_delete_noteDelete a noteADestructive
Moves a note to the system trash. Set permanent: true to bypass trash and delete immediately (irreversible).
Inputs: vault, file, path, permanent, +1 more.
obsidian_dev_consoleGet console outputARead-only
Returns recent console messages from Obsidian DevTools.
Inputs: vault.
obsidian_dev_errorsGet JavaScript errorsARead-only
Returns recent JS errors from the Obsidian DevTools console.
Inputs: vault.
obsidian_dev_screenshotCapture Obsidian screenshotARead-only
Returns a base64-encoded PNG screenshot of the running Obsidian window.
Inputs: vault.
obsidian_disable_pluginDisable a pluginBIdempotent
Disables a community plugin by id.
Inputs: id (required), vault.
obsidian_enable_pluginEnable a pluginAIdempotent
Enables a community plugin by id.
Inputs: id (required), vault, confirm.
obsidian_evalEvaluate JavaScript in ObsidianADestructive
Runs arbitrary JavaScript inside the running Obsidian instance with access to the app object. DANGEROUS: can read/modify any vault data and execute side effects. Use only when no narrower tool fits.
Inputs: code (required), vault, confirm.
obsidian_files_with_tagList files with a tagARead-only
Lists every note tagged with the given tag.
Inputs: tag (required), vault.
obsidian_get_backlinksGet backlinksARead-only
Returns notes that link to the target note.
Inputs: vault, file, path.
obsidian_get_linksGet outgoing linksARead-only
Returns the outgoing wikilinks from a note.
Inputs: vault, file, path.
obsidian_get_metadataGet note metadataARead-only
Returns metadata for a note (frontmatter, tags, links, file stats) as JSON.
Inputs: vault, file, path.
obsidian_get_propertiesGet note frontmatter propertiesARead-only
Returns the YAML frontmatter properties of a note as JSON.
Inputs: vault, file, path.
obsidian_helpShow CLI helpARead-only
Shows the underlying obsidian help output — useful when a command behaves unexpectedly.
Inputs: all.
obsidian_list_filesList notes in vaultARead-only
Lists every note in the vault. Returns JSON by default. Useful as a first step to discover what exists.
Inputs: vault, format.
obsidian_list_foldersList folder treeARead-only
Displays the vault folder structure as a tree.
Inputs: vault, format.
obsidian_list_orphansList orphan notesARead-only
Finds notes that have no incoming wikilinks.
Inputs: vault.
obsidian_list_pluginsList installed pluginsARead-only
Lists installed community + core plugins with enabled state.
Inputs: vault.
obsidian_list_tagsList all tagsARead-only
Lists every tag used in the vault, with usage counts.
Inputs: vault.
obsidian_list_unresolvedList unresolved linksARead-only
Finds wikilinks that point to non-existent notes.
Inputs: vault.
obsidian_move_noteMove or rename a noteADestructive
Moves or renames a note. Wikilinks across the vault are updated automatically.
Inputs: to (required), vault, file, path, +1 more.
obsidian_prepend_notePrepend to a noteA
Inserts content near the top of a note (after frontmatter, if present).
Inputs: content (required), vault, file, path.
obsidian_read_noteRead note contentARead-only
Returns the full markdown content of a note.
Inputs: vault, file, path.
obsidian_reload_pluginHot-reload a pluginAIdempotent
Reloads a plugin's code (useful during plugin development).
Inputs: id (required), vault.
obsidian_remove_propertyRemove a frontmatter propertyCDestructiveIdempotent
Removes a frontmatter property from a note.
Inputs: name (required), vault, file, path, +1 more.
obsidian_rename_tagBulk rename a tagBDestructive
Renames a tag across every note in the vault.
Inputs: old (required), new (required), vault, confirm.
obsidian_searchFull-text searchARead-only
Full-text search across the vault. Returns matching files.
Inputs: query (required), vault, limit.
obsidian_search_contextSearch with surrounding contextARead-only
Full-text search that returns surrounding lines of context for each hit.
Inputs: query (required), vault, limit.
obsidian_set_propertySet a frontmatter propertyBIdempotent
Sets a frontmatter property on a note. Creates the frontmatter block if missing.
Inputs: name (required), value (required), vault, file, +1 more.
obsidian_versionGet Obsidian CLI versionARead-only
Returns the version of the Obsidian CLI binary in use.
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 34 tools
Most tools have distinct purposes, but there is some potential confusion between obsidian_search and obsidian_search_context, and between obsidian_get_backlinks and obsidian_get_links. Overall, descriptions are clear enough for an agent to differentiate.
All tools follow a consistent 'obsidian_verb_noun' snake_case pattern, making it predictable and easy to infer function from name.
With 34 tools, the server is over-scoped for typical MCP usage. While it covers many aspects of Obsidian, the high number suggests potential for splitting into specialized servers, and many tools (e.g., development utilities) may be unnecessary for most agents.
The tool set covers core note operations, search, tags, links, and daily notes well, but lacks explicit tools for creating folders, deleting tags, or handling attachments, leaving notable gaps in domain coverage.
Related MCP Connectors
Search your Obsidian vault to quickly find notes by title or keyword, summarize related content, a…
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Search, read, and safely update Markdown notes in your connected Phasoric knowledge vaults.
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Related MCP Servers
- FlicenseCqualityDmaintenanceProvides LLM agents with comprehensive access to Obsidian vaults via the official Obsidian CLI bridge. It enables users to read, search, and modify notes, tasks, properties, and plugins while the Obsidian desktop app is running.5416-
- AlicenseAqualityAmaintenanceStandalone MCP server for Obsidian vaults - hybrid search (FTS5 + vector + cross-encoder reranking), images and PDFs in agent-readable form, Kanban-aware tasks (Tasks-plugin + Dataview formats), structured memory with topic recall, fine-grained read/write tools for optimal token efficiency, and link graph support. Run locally, self-host, or one-click deploy for remote access. OAuth 2.1.163338MIT
- AlicenseAqualityDmaintenanceProvides AI agents with Obsidian vault operations via the official CLI, including reading, writing, searching notes, and managing files, with security and concurrency protections.7MIT
- AlicenseAqualityDmaintenanceEnables interaction with Obsidian vaults through the official Obsidian CLI, allowing note management, search, and vault operations without plugins or API keys.21MIT