LO

lstpsche/obsidian-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

45 stars 16 forks 质量 87 趋势 20MIT

用于本地 Obsidian Vault 的快速 MCP 服务器,供 AI 代理使用

概览

一台高性能MCP服务器,允许AI代理对Obsidian保险库的完全读写权限。用Rust编写。作为单一二进制文件飞船。 现有的AI + Obsidian解决方案要求Obsidian应用运行社区插件(obsidian-local-rest-api)和MCP包装器(mcp-obsidian)。这很脆弱、缓慢,而且只能用REST API暴露的内容。 Obsidian-MCP 直接与文件系统通信。它原生理解 Obsidian 格式——维基链接、前置信息、标签、块引用、周期性笔记、完整图表。启动时快速构建内存索引,并通过文件系统监视器保持同步。最终形成一个无依赖的二进制文件,无论 Obsidian 是否开放都能正常工作。 把你的MCP客户端配置(Cursor、Claude Desktop等)加到手里,你就完成了——19个工具可以立即使用。 元数据和 BM25 索引会通过文件系统监视器立即更新。

概述(AI 翻译)

一台高性能MCP服务器,允许AI代理对Obsidian保险库的完全读写权限。用Rust编写。作为单一二进制文件飞船。

没有Obsidian插件。没有REST API。没有运行Obsidian。只有你的磁盘库。

为什么?

现有的AI + Obsidian解决方案要求Obsidian应用运行社区插件(obsidian-local-rest-api)和MCP包装器(mcp-obsidian)。这很脆弱、缓慢,而且只能用REST API暴露的内容。

Obsidian-MCP 直接与文件系统通信。它原生理解 Obsidian 格式——维基链接、前置信息、标签、块引用、周期性笔记、完整图表。启动时快速构建内存索引,并通过文件系统监视器保持同步。最终形成一个无依赖的二进制文件,无论 Obsidian 是否开放都能正常工作。

快速启动

把你的MCP客户端配置(Cursor、Claude Desktop等)加到手里,你就完成了——19个工具可以立即使用。

它能做什么

类别 能力
导航 列表文件,树状视图,保险库统计
阅读与写入 创建、阅读、覆盖、添加、前置、移动、删除笔记

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

obsidian-mcp

A high-performance MCP server that gives AI agents full read/write access to Obsidian vaults. Written in Rust. Ships as a single binary.

No Obsidian plugins. No REST API. No Obsidian running. Use a local folder or an SFTP vault.

Why?

Existing solutions for AI + Obsidian require the Obsidian app to be running with a community plugin (obsidian-local-rest-api) and an MCP wrapper (mcp-obsidian) on top. That’s fragile, slow, and limited to what the REST API exposes.

obsidian-mcp reads and writes vault files directly. It understands the Obsidian format natively — wikilinks, frontmatter, tags, block references, periodic notes, the full graph. Local folders use filesystem notifications; remote folders use SFTP reconciliation. Search indexes and embedding caches stay on the computer running the MCP server. Local vaults need only the binary; SFTP vaults also need a local OpenSSH client.

Quick Start

# Install
cargo install obsidian-mcp

# Run (stdio — for MCP clients that launch the process)
obsidian-mcp /path/to/your/vault

# Run (HTTP — shared server for multiple agents)
obsidian-mcp --http /path/to/your/vault

# Remote folder (OpenSSH keys/agent and known host configured locally)
obsidian-mcp sftp://vault-server/home/alice/notes

Add to your MCP client config (Cursor, Claude Desktop, etc.). Local vaults expose 19 tools before filtering. Remote vaults expose the same operations except open_in_obsidian, which requires a local Obsidian vault. See remote vault setup and behavior.

Optional authenticated clients

To give assistants different permissions on one local vault, run:

obsidian-mcp access setup /path/to/your/vault

Setup guides you through reader/editor access and shared folders, then creates a protected token and client configuration snippet. Follow its printed server, reconnect and connection-check commands. It generates Codex and Claude Code header-helper configuration formats. The Codex CLI 0.166.0 local app-server integration supports the generated helper; verify other installed clients separately.

Authentication is enabled only by an explicit --access-file PATH or OBSIDIAN_ACCESS_FILE setting. Existing unauthenticated HTTP, stdio, daemon and SFTP configurations keep their behavior when these settings are absent. Creating a profile does not change a running server or client configuration.

在 GitHub 查看完整 README

安装

npx @modelcontextprotocol/inspector cargo run # interactive testing (stdio)
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "obsidian": { "command": "obsidian-mcp", "args": ["/path/to/your/vault"] } } }