cyanheads/obsidian-mcp-server
Read, write, search, and surgically edit Obsidian vault notes, tags, and frontmatter via MCP. STDIO or Streamable HTTP.
obsidian‑mcp‑server – A Machine‑Context‑Protocol (MCP) bridge to an Obsidian vault
What it is – A TypeScript/Node server that wraps the Obsidian Local REST API and exposes a catalog of MCP‑compatible tools and resources. An LLM‑orchestrator (Claude, Cursor, VS Code, etc.) can call these tools over STDIO or a streamable HTTP endpoint to read, search, and edit notes, tags, and front‑matter inside a local Obsidian vault.
Core capabilities (as defined in the README)
| Category | Tools / Resources | What you can do |
|---|---|---|
| Reading | obsidian_get_note, obsidian_list_notes, obsidian_list_tags, obsidian_list_commands, obsidian://vault/{+path} |
Fetch a note as raw markdown, full structured data, a document map, or a single section; list files recursively; enumerate tags with counts; discover command‑palette entries (opt‑in). |
| Searching | obsidian_search_notes |
Text substring search, JSONLogic‑based field queries, or BM25‑ranked Omnisearch (when the Omnisearch plugin is reachable). Results are paginated with opaque cursors. |
| Writing / Editing | obsidian_write_note, obsidian_append_to_note, obsidian_patch_note, obsidian_replace_in_note, obsidian_manage_frontmatter, obsidian_manage_tags |
Create new notes, append content, surgically patch a heading/block/front‑matter, run regex‑based replace, atomically get/set/delete a front‑matter key, add/remove/list tags (front‑matter or inline). |
| Destructive actions | obsidian_delete_note |
Deletes a note, but requires a round‑trip user confirmation before the actual DELETE is performed. |
| Command‑palette bridge | obsidian_execute_command, obsidian_list_commands |
(Optional) List and invoke any Obsidian command‑palette command. Disabled by default; enable with OBSIDIAN_ENABLE_COMMANDS=true. |
| Resources | obsidian://vault/{+path}, obsidian://tags, obsidian://status |
Direct URI‑style access to a note, the full tag index, and server status/auth information. |
How it works under the hood
- MCP framework – Built on
@cyanheads/mcp-ts-core, which handles tool registration, JSON‑RPC validation, error classification, and the MCP‑specific pagination spec. - Stateless proxy – Every tool call forwards to the Obsidian Local REST API plugin running inside the user's Obsidian desktop. No data is stored on the server itself.
- Transport options – The server can be run as a simple STDIO process (useful for local LLM‑agents) or as a streamable HTTP service (Docker image available on GHCR). Auth can be
none,jwt, oroauth. - Path‑policy gating – Optional environment variables (
OBSIDIAN_READ_PATHS,OBSIDIAN_WRITE_PATHS,OBSIDIAN_READ_ONLY) restrict which vault folders a tool may touch, with clearpath_forbiddenerrors that LLMs can react to. - Safety nets – Write tools return
previousSizeInBytes/currentSizeInBytesso an agent can detect accidental overwrites. Deletions require explicit confirmation; command‑palette access is opt‑in.
Typical use‑cases for AI agents
- RAG (retrieval‑augmented generation) – An LLM can call
obsidian_search_notesorobsidian_get_noteto pull relevant personal knowledge before answering a user query. - Dynamic note‑taking – After a conversation, the agent can
obsidian_write_noteorobsidian_append_to_noteto create a daily note, add a summary, or update a project log. - Tag‑driven organization –
obsidian_manage_tagslets an agent keep the tag taxonomy consistent across front‑matter and inline#tagsyntax. - Automated refactoring – Using
obsidian_patch_notetogether withobsidian_get_note's document‑map, an agent can locate a heading and move or replace its content without touching the rest of the file. - Controlled execution – In a secure deployment, the path‑policy can expose only a
scratch/folder for writes while allowing read‑only access to the whole vault, preventing the model from accidentally modifying important files.
Getting started (from the README)
- Install –
npm i -g obsidian-mcp-serveror pull the Docker imageghcr.io/cyanheads/obsidian-mcp-server. - Run –
Set# STDIO mode (default) npx obsidian-mcp-server # HTTP mode (example) docker run -p 8080:8080 \ -e OBSIDIAN_API_KEY=your-key \ ghcr.io/cyanheads/obsidian-mcp-serverOBSIDIAN_API_KEY(or other auth method) to let the server talk to the Obsidian Local REST API. - Enable optional features –
OBSIDIAN_ENABLE_COMMANDS=trueto expose command‑palette tools.OBSIDIAN_READ_ONLY=truefor a read‑only deployment.OBSIDIAN_WRITE_PATHS=projects/,scratch/to limit writes to specific folders.
- Connect an LLM client – Use the provided MCP install badges for Claude Desktop, Cursor, or VS Code, which automatically add the server as an MCP toolset.
Limitations & gotchas (as documented)
- Delete confirmation –
obsidian_delete_notecannot be performed by a pure‑stateless client; the client must be able to present the confirmation prompt and resend the answer. - Omnisearch dependency – BM25 search (
mode: "omnisearch") only works if the Obsidian Omnisearch plugin’s HTTP server is reachable at startup; otherwise the mode is omitted. - Tag listing is vault‑wide –
obsidian_list_tagsignores read‑path restrictions, so tag names from outside the allowed read scope can still be returned. - Section targeting ambiguity – When a heading name matches multiple paths, the server returns
ambiguous_sectionrather than guessing. - No persistent state – The server does not keep any cache; every call hits the local REST API, so performance depends on the underlying plugin.
TL;DR
obsidian-mcp-server is a lightweight, MCP‑compliant bridge that lets AI agents treat an Obsidian vault as a structured knowledge base. It offers 14 fine‑grained tools for reading, searching, and safely editing notes, plus optional command‑palette execution, all behind configurable path‑based permissions and optional authentication.
관련
- 프로젝트
- 프로젝트
- 프로젝트
- 프로젝트
- 프로젝트