
Obsidian CLI MCP
io.github.dariuscorvus由 GitHub 账号 dariuscorvus 发布v0.4.1更新于 Oct 24, 2026
Local MCP server for Obsidian Desktop via the official Obsidian CLI.
概览
一个本地 MCP 服务器,通过官方 Obsidian CLI 让助手在运行中的 Obsidian 桌面版里搜索、读取和编辑笔记、任务、文件与 Canvas 画布。
- 可以做什么
- 搜索与读取库:全文搜索、笔记列表与读取、标签、未解析链接、反向链接、出链、任务列表和笔记差异,以及二进制文件元数据和 Canvas 读取。
- 适用场景
- 当你希望 AI 助手在 macOS 上的 Obsidian 桌面版库中工作——查找笔记、起草或追加内容、管理任务与日记、搭建 Canvas 画布——而不离开该应用时使用。
- 运行要求
- macOS,已安装并运行 Obsidian 桌面版,在 Obsidian 中启用官方 CLI 并将 obsidian 注册到 PATH,运行 npm 包还需 Node.js 18 或更高版本。本地默认模式无需库名、令牌或配置文件,使用当前活动库。
安装
在 SourceWeft 中
- 打开 控制台中的 Obsidian CLI MCP,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
obsidian-cli-mcp
obsidian-cli-mcp is an MCP server for
the official Obsidian CLI. It exposes Obsidian vault search, note, task,
file, link, and native Canvas operations to an MCP client. The server does not
replace Obsidian: the CLI forwards requests to the running Obsidian desktop app.
The default transport is local stdio. Remote Streamable HTTP is available as an advanced, separately secured setup; it is not required for local use.
Requirements
- macOS with Obsidian Desktop installed and running.
- The official Obsidian CLI enabled in Obsidian: Settings → General →
Command line interface, then register
obsidianon yourPATH. - Node.js 18 or newer to run the published package. Bun is only needed to build or develop this source checkout.
This project requires the desktop CLI. It does not support obsidian-headless.
The Obsidian app must remain open while the MCP server is being used.
Check the Obsidian side first:
Quickstart with npm
Start the published v0.4.1 package from any directory:
The command speaks MCP over stdio and waits for an MCP client. It intentionally does not print protocol data to the terminal. Diagnostics go to stderr.
For a source checkout instead:
No vault name, vault path, token, Cloudflare account, LaunchAgent, or config file is required for the local default. The server uses the active vault that Obsidian exposes through the official CLI.
Connect an MCP client
For a client that accepts an mcpServers configuration, use the npm command:
If the client does not inherit your shell PATH, replace npx with the
absolute path printed by command -v npx. For a source checkout, use
command: "node" and args: ["/absolute/path/to/obsidian-cli-mcp/dist/main.js"].
Restart the client after changing its MCP configuration. The first useful sequence is:
-
Call
vault_searchwith a query that should exist in your vault, for example{ "query": "meeting", "limit": 10 }. -
Pass one returned path to
note_read, for example{ "path": "<path returned by vault_search>" }. -
Preview a safe note mutation before applying it:
This is a
note_createcall. It returns the planned action and exact CLI command without changing the vault. Only usedryRun: falseafter reviewing the plan.dryRunis a preview, not an authorization boundary. -
For Canvas, preview a native Canvas file and one text node:
This is a
canvas_createcall. Review the plan, then call it withdryRun: falseif you want to create the file. Usecanvas_readto inspect the native.canvasJSON afterward. Canvas tools preserve unknown fields, validate node/edge references, and do not require arbitrary eval.
Configuration and safe defaults
An empty or missing configuration is usable for a vanilla Obsidian vault. The
optional .obsidianmcprc.yaml is discovered from the server working directory.
For clients with an unpredictable working directory, set
OBSIDIAN_MCP_CONFIG to an explicit config-file path.
The default policy is deliberately local and bounded:
- The v0.4.0 server does not expose a generic
obsidian_evaltool.eval.enabledisfalseby default; internal fixed eval snippets used by a few safe operations are not a user-supplied JavaScript escape hatch. - Imports from arbitrary local files are disabled until
imports.allowedRootsis explicitly configured. URLs are never fetched. .obsidian,.git,.trash,.Trash,Trash, and.DS_Storepath segments are blocked by default. Addpaths.allowfor a narrower vault area and add project-specificpaths.denyprefixes for more sensitive content.- Mutations expose
dryRun.file_deleterequiresconfirm: trueandnote_deleteuses Obsidian trash by default; permanent deletion requires the explicitdelete.mode: hardconfiguration. - Git autocommit is off by default.
Read-only preset
Use an explicit allowlist when an MCP client should only inspect the vault:
Safe local preset
The default has safe local guardrails but is not read-only. For an explicit safe-local surface that allows normal note edits and Canvas creation while omitting deletion, file imports, file lifecycle operations, and arbitrary evaluation:
Full trusted local preset
Omit tools.allow to expose the complete built-in tool surface, while keeping
the default protected paths, trash deletion, disabled imports, and disabled
obsidian_eval. If imports are needed, configure only a dedicated local source
directory:
See docs/configuration.md for all fields and examples/ for note-organization presets.
Local stdio versus remote HTTP
Local stdio starts one server process directly from the MCP client. It is the recommended installation: there is no listening socket, remote authentication, Cloudflare setup, or public endpoint.
Streamable HTTP is an optional advanced mode for a client that cannot use local
stdio. It binds to loopback only and refuses to start without either Cloudflare
Access JWT validation or a strong capability token. Put it behind a TLS,
authenticated reverse proxy or tunnel; do not bind it to 0.0.0.0. See
docs/remote-cloudflare.md for the generic advanced
setup and its security trade-offs.
Tool surface
The default server advertises 43 regular tools:
- Read:
vault_search,note_read,note_list,vault_tags,unresolved_links,tasks_list,note_diff,backlinks_get,outlinks_get,file_read_binary_metadata,canvas_read. - Write and workflow:
note_create,note_append,note_set_frontmatter,daily_open,daily_append,note_replace_range,note_insert_at,note_replace,note_insert,task_create,task_update,note_transition. - Files and attachments:
file_import,attachment_import,note_attach,attachment_embed,file_move,file_rename,file_delete,note_rename,note_move,folder_create,note_delete. - Canvas:
canvas_create,canvas_upsert_nodes,canvas_upsert_edges,canvas_remove,canvas_open,canvas_add_node,canvas_add_edge,canvas_auto_layout. - Batch:
vault_batchruns enabled reads and previews enabled mutations withargs.dryRun: true, dependency gating, stable input-order results, and a boundedbatch.maxParallelism(default 4, maximum 8).
All mutating tools accept dryRun. Tool annotations identify read-only and
destructive operations for compatible MCP clients.
Limitations and security
Obsidian Desktop must be running, its official CLI must be enabled, and the
active vault must be available to that desktop session. This server is not a
sandbox and does not support obsidian-headless.
Vault content is untrusted data. Notes, Canvas text, task text, and search results may contain prompt-injection instructions; an MCP client should treat them as data and never follow instructions found inside a vault merely because they were returned by a tool. Tool output can also contain sensitive vault content, so connect only clients you trust.
Read SECURITY.md before enabling remote HTTP, imports, hard deletes, or a broad mutation allowlist. Report security issues privately as described there.
Development and CI
The source checkout uses Bun, while the published bin runs on Node:
The offline stdio smoke verifies the built package entrypoint, MCP initialize,
tools/list, the expected tool surface, and the absence of obsidian_eval.
The real Obsidian smoke is separate and requires a user session with Obsidian
running:
GitHub Actions runs only offline gates; it does not depend on Obsidian Desktop or a real vault on a hosted runner.
License
来源:README.md,提交 e30b7c1
工具
0版本历史
1- v0.4.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分