obsidian-mcp-server
cyanheads · cyanheads/obsidian-mcp-server
MCP server cho phép agent đọc, tìm kiếm, ghi và chỉnh sửa ghi chú, tag và frontmatter trong Obsidian thông qua plugin Local REST API.
Read, write, search, and surgically edit Obsidian vault notes, tags, and frontmatter via MCP. STDIO or Streamable HTTP.
Xem trước
Bạn có thể làm gì với nó
- Nhờ agent tìm trong vault và tóm tắt các ghi chú liên quan
- Thêm ghi chú họp hoặc công việc vào đúng một heading trong ghi chú
- Quản lý hàng loạt tag và trường frontmatter trong các ghi chú
Kiểm tra an toàn
Không thấy dấu hiệu rủi ro trong các file đã quét.
Quét tự động các file trong repo. Luôn xem lại code trước khi chạy.
Trích từ README
obsidian-mcp-server Read, write, search, and surgically edit Obsidian vault notes, tags, and frontmatter via MCP. STDIO or Streamable HTTP. 14 Tools • 3 Resources
Overview
Obsidian vault notes over the Local REST API plugin. Read, search, and write notes, edit single headings, blocks, and frontmatter fields in place, and manage tags, with folder-scoped read/write permissions built in. Runs as a stdio process or a local Streamable HTTP server.
Tools
| Tool | Description |
|---|---|
obsidian_get_note | Read a note as raw content, full structured form, document map, or a single section |
obsidian_list_notes | List notes and folders under a vault path, recursively, with extension and name filters |
obsidian_list_tags | List vault tags with usage counts, most-used first |
obsidian_search_notes | Search by text, JSONLogic, or BM25-ranked Omnisearch when that plugin is reachable |
obsidian_write_note | Create a note, replace one section, or overwrite a whole file with overwrite: true |
obsidian_append_to_note | Append to a note (creating it if missing) or to one heading, block, or frontmatter field |
obsidian_patch_note | Append, prepend, or replace against one heading, block reference, or frontmatter field |
obsidian_replace_in_note | Literal or regex search-replace inside one note, body-only by default |
obsidian_manage_frontmatter | Get, set, or delete one frontmatter key |
obsidian_manage_tags | Add, remove, or list a note's tags in frontmatter, inline, or both |
obsidian_delete_note | Permanently delete a note, optionally after the user confirms (OBSIDIAN_DELETE_ELICITATION) |
obsidian_open_in_ui | Open a file in the Obsidian app, optionally in a new pane |
obsidian_list_commands | List command-palette commands (opt-in via OBSIDIAN_ENABLE_COMMANDS) |
obsidian_execute_command | Run a command-palette command by ID (opt-in via OBSIDIAN_ENABLE_COMMANDS) |
Resources
| Resource | Description |
|---|---|
obsidian://vault/{+path} | A note's content, frontmatter, tags, and file metadata |
obsidian://tags | Every vault tag with its usage count, as an uncapped snapshot |
obsidian://status | Plugin reachability, auth status, versions, and registered API extensions |
Note and tag data are also reachable through tools (obsidian_get_note, obsidian_list_tags); obsidian://status has no tool equivalent.
Capability reference
obsidian_get_note tool
targetis a vaultpath, theactivefile, or aperiodicnote (dailythroughyearly, optionaldate);formatiscontent,full,document-map, orsection, andfulltakesincludeLinks: truefor vault-internal outgoing linksresult.formatdiscriminates the payload; asectionread that matches several headings returns the first and lists every full path incandidates- A
pathwith no exact match but one case-insensitive match in its folder reads that file:result.pathis the real name,requestedPaththe one sent, and anoticenames both
obsidian_list_notes tool
- Walks from
path(default vault root) todepth1–20 (default 2), filtered byextensionandnameRegex(≤256 chars); a folder that failsnameRegexis not walked - Returns
entries[](file/directory),totals, andappliedFilters; the walk stops at 1,000 entries withexcluded.reason: "entry_cap", and a folder the depth limit stopped carriestruncated: true - With
OBSIDIAN_READ_PATHSset, a listing holds only readable entries and the folders leading to the scope; those folders are walked and accepted aspath
obsidian_list_tags tool
nameRegex(≤256 chars) andminCountnarrow the set, then tags are ranked by count and capped atlimit(default 200, max 10000); hierarchical parents count (work/tasksadds towork)- When the cap withholds tags, the response carries
truncated,shown, andcap - With
OBSIDIAN_READ_PATHSset, only tags from readable notes are listed, andcountis the number of readable notes carrying the tag or a tag nested under it
obsidian_search_notes tool
mode: "text"requires every whitespace-split token ofqueryas a case-insensitive substring of the filename or body (quotes are literal), shaped bycontextLength(default 100),pathPrefix, andmaxMatchesPerHit(default 10);mode: "jsonlogic"evaluates alogictree overpath,content,frontmatter.<key>,tags, andstat, withglob/regexptaking[PATTERN, VALUE]result.modediscriminates the payload; every mode reportstotalCountand pages vianextCursor, and a text hit clipped tomaxMatchesPerHitcarriestruncatedandtotalMatchesmode: "omnisearch"(BM25 ranking, quoted phrases,-exclusion,path:/ext:filters) is offered only when the Omnisearch plugin answered at startup; its 50-hit upstream cap setstruncated: true
obsidian_write_note tool
targetandcontent, with optionalsectionandcontentType(markdown/json); a whole-file write to an existing note fails withfile_existsunlessoverwrite: true- With
section, replaces only that heading, block, or frontmatter field and keeps the heading line; output reportscreated,sectionTargeted, and the resolvedsectionTarget
obsidian_append_to_note tool
- Without
section, appends to the file or creates it (created: true); withsection, appends to that heading, block, or frontmatter field of an existing note, andcreateTargetIfMissing: truecreates the section - A section append whose content is already at the target fails with
content_preexists; block targets add no separator, so startcontentwith a newline if you want one
obsidian_patch_note tool
operation: "append" | "prepend" | "replace"against onesectionof an existing note;patchOptionstakescreateTargetIfMissing, `applyIfContentPree