跳到正文
Skillpedia
● 免费开源💻 本地🔑 需要 API 密钥办公与效率

Obsidian MCP Server

让你的智能体读取、写入、搜索和编辑 Obsidian 笔记库中的笔记、标签和 frontmatter。

702 GitHub 星标作者 cyanheads许可证 Apache-2.0更新于 23天前

如何安装

这个 MCP 是本地的:在你的电脑上运行。

适用于电脑上安装的应用(Claude Desktop、Claude Code、Cursor、VS Code 等)。选择你的应用:

粘贴到终端:

claude mcp add obsidian -e OBSIDIAN_API_KEY="<你的值>" -- npx -y obsidian-mcp-server

需要填写的内容

名称用途必填
OBSIDIAN_API_KEYBearer token for the Obsidian Local REST API plugin (Settings → Community Plugins → Local REST API).是
OBSIDIAN_BASE_URLBase URL of the Obsidian Local REST API. Default: http://127.0.0.1:27123 (enable "Non-encrypted (HTTP) Server" in plugin settings). Use https://127.0.0.1:27124 for the always-on HTTPS port (self-signed cert; pair with OBSIDIAN_VERIFY_SSL=false).否
OBSIDIAN_VERIFY_SSLWhether to verify the TLS certificate on the Obsidian endpoint. Default false because the plugin uses a self-signed cert.否
OBSIDIAN_REQUEST_TIMEOUT_MSPer-request timeout in milliseconds.否
OBSIDIAN_ENABLE_COMMANDSOpt-in flag for the command-palette pair (obsidian_list_commands + obsidian_execute_command). Off by default — Obsidian commands are opaque and can be destructive.否
OBSIDIAN_READ_PATHSOptional comma-separated vault-relative folder allowlist for reads. Prefix-based with implicit recursion; case-insensitive; backslashes read as slashes, repeated and trailing slashes and '.' segments dropped, and names normalized to Unicode NFC; an entry naming the vault root ('.') is rejected at startup. Unset = full vault. Write paths are implicitly readable. Example: 'public/,projects/'.否
OBSIDIAN_WRITE_PATHSOptional comma-separated vault-relative folder allowlist for writes. Same syntax as OBSIDIAN_READ_PATHS. Unset = full vault, or the read scope when reads are restricted; paths in OBSIDIAN_DENY_PATHS stay denied. Example: 'projects/,scratch/'.否
OBSIDIAN_DENY_PATHSOptional comma-separated vault-relative paths withheld from reads and writes. Same syntax as OBSIDIAN_READ_PATHS. Wins over both allowlists; denied paths are left out of listings, search results, and tag counts. Unset = nothing denied. Example: 'private/,journal/therapy/'.否
OBSIDIAN_READ_ONLYGlobal read-only kill switch. When true, every write is denied regardless of OBSIDIAN_WRITE_PATHS, and the command-palette pair is suppressed (commands can mutate). Useful for shared or public-facing deployments.否
OBSIDIAN_DELETE_ELICITATIONOpt-in delete confirmation. When true, obsidian_delete_note asks the user to confirm each delete through an elicitation round (the client must support elicitation), and HTTP startup requires a stateful session unless OBSIDIAN_READ_ONLY=true disables the tool. Off by default — the delete runs on the first call, bounded by OBSIDIAN_WRITE_PATHS and OBSIDIAN_READ_ONLY.否
OBSIDIAN_OMNISEARCH_URLOverride URL for the Omnisearch plugin HTTP server. Unset derives from OBSIDIAN_BASE_URL host with port 51361. Required only if the Omnisearch plugin is not on the default port.否
MCP_LOG_LEVELSets the minimum log level for output (e.g., 'debug', 'info', 'warn').否

好了!现在试试

重启应用,把下面任意一条请求粘贴到聊天里:

把今天的待办事项添加到我每日笔记的“任务”标题下。
列出我最常用的标签。

简介

这个服务器通过 Local REST API 插件把你的智能体连接到 Obsidian 笔记库。智能体可以读取和搜索笔记、创建或编辑笔记,原位修改某个标题、块或 frontmatter 字段,并管理标签。你可以限制它能读取或写入的文件夹。

它能做什么

  • obsidian_get_note:读取笔记
  • obsidian_search_notes:按文字、JSONLogic 或 Omnisearch 搜索
  • obsidian_write_note:创建或替换笔记,或替换其中一个章节
  • obsidian_append_to_note 和 obsidian_patch_note:向标题或字段添加内容
  • obsidian_replace_in_note:在笔记内搜索并替换
  • obsidian_manage_frontmatter 和 obsidian_manage_tags:编辑 frontmatter 和标签
  • obsidian_list_notes 和 obsidian_list_tags:浏览笔记库

什么时候用

  • ›当你想让智能体把会议记录添加到正确的标题下时
  • ›当你想同时为许多笔记添加标签或搜索时
  • ›当你想更新每日笔记或定期笔记时

你需要准备

Obsidian,并安装 Local REST API 插件及其 API 密钥(OBSIDIAN_API_KEY)。可通过 npx 或 Docker 运行。

搭配的技能

⭐ Skillpedia MCP · 免费你的智能体自己找到合适的技能安装我们的 MCP,智能体需要时会在 15,000+ 个技能中搜索。免费安装 →

常见问题

它免费且开源吗?

仓库中有许可证文件,没有列出价格。

它需要哪个插件?

Obsidian Local REST API 插件。

我能限制它能访问的内容吗?

可以。OBSIDIAN_READ_PATHS、OBSIDIAN_WRITE_PATHS、OBSIDIAN_DENY_PATHS 和 OBSIDIAN_READ_ONLY 可以设置边界。

它能删除笔记吗?

能,默认无需确认。设置 OBSIDIAN_DELETE_ELICITATION=true 可以要求你确认。

它能运行 Obsidian 命令吗?

只有开启 OBSIDIAN_ENABLE_COMMANDS 后才可以。

它支持哪些传输方式?

STDIO 或 Streamable HTTP。

如果不能用

  • ›请确认 Obsidian 已打开,并且已启用 Local REST API 插件。
  • ›请确认 OBSIDIAN_API_KEY 与插件设置中的密钥一致。
  • ›读取 obsidian://status 资源,检查插件是否可访问以及认证是否正常。

每周 5 个新技能,1 分钟读完。