
用于与本地 Obsidian 笔记交互的简单 MCP 服务器
概览
Obsidian 的 MCP 服务器,提供安全、直接的文件系统访问保险库文件。 大多数现有的 Obsidian MCP 服务器依赖于 Obsidian REST API 插件,该插件要求:- 安装 Obsidian - 运行 - 配置 REST API 插件 该服务器直接处理磁盘上的 Obsidian 保险库文件,兼容使用 obsidian.nvim 的设置——这是一个 Neovim 插件,提供类似 Obsidian 的功能,无需 Obsidian 应用。 - 访问 Obsidian vaults——无需 Obsidian 应用——支持路径穿越预防和输入验证——支持执行时间跟踪和资源限制——包括正则表达式支持和基于标签的搜索——支持前置和内联标签解析 - : 新的发现-MOCS工具通过发现内容地图及其关联,提供了你保险库知识结构的高层地图。
概述(AI 翻译)
Obsidian 的 MCP 服务器,提供安全、直接的文件系统访问保险库文件。
为什么是这家服务器?
大多数现有的Obsidian MCP服务器依赖Obsidian REST API插件,该插件需要:
- 安装黑曜石
- Obsidian将被运行
- 需要配置的REST API插件
该服务器直接处理磁盘上的 Obsidian 保险库文件,兼容使用 obsidian.nvim 的设置——这是一个 Neovim 插件,提供类似 Obsidian 的功能,无需 Obsidian 应用。
Logseq和泡沫
任何 markdown 笔记文件夹都可以,所以服务器还会读取 Foam 工作区和基于文件的 Logseq 图表。指向工作区或图表文件夹。
| 工具 | 版本 | 状态 |
|---|---|---|
| 泡沫 | 任何 | 支持 |
| Logseq 文件图 | 0.10.x 及更早版本 | 支持 |
| Logseq 数据库图表 | 2.x | 不支持:页面存在数据库,而非 markdown 文件 |
对于Logseq图,服务器还读取:
tags::以及页面顶部的其他页面属性,作为标签和前置信息报告title::作为页面标题,回归文件名,a___b.md读作a/b- 多词
#[[tag name]]标签
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Obsidian MCP Server
MCP server for Obsidian that provides secure, direct file system access to vault files.
Why This Server?
Most existing Obsidian MCP servers rely on the Obsidian REST API plugin, which requires:
- Obsidian to be installed
- Obsidian to be running
- The REST API plugin to be configured
This server instead works directly with Obsidian vault files on disk, making it compatible with setups using obsidian.nvim - a Neovim plugin that provides Obsidian-like features without requiring the Obsidian app.
Logseq and Foam
Any folder of markdown notes works, so the server also reads Foam workspaces and file-based Logseq graphs. Point it at the workspace or graph folder.
| Tool | Version | Status |
|---|---|---|
| Foam | any | Supported |
| Logseq file graphs | 0.10.x and earlier | Supported |
| Logseq DB graphs | 2.x | Not supported: pages live in a database, not in markdown files |
For Logseq graphs the server also reads:
tags::and other page properties at the top of a page, reported as tags and frontmattertitle::as the page title, falling back to the file name, witha___b.mdread asa/b- multi-word
#[[tag name]]tags
It skips the copies Logseq keeps under logseq/bak/ and logseq/version-files/, as Logseq does.
Features
- Direct file system access to Obsidian vaults - no Obsidian app required
- Security-first design with path traversal prevention and input validation
- High performance with execution time tracking and resource limits
- Rich search capabilities including regex support and tag-based search
- Metadata support with frontmatter and inline tag parsing
Recent Updates
🎉 New Features
- 🗺️ MOC Discovery: New
discover-mocstool provides a high-level map of your vault’s knowledge structure by discovering Maps of Content and their relationships. Start here for 10x faster navigation! - Resource Links: Search results now include MCP resource links for direct note access
- Context Snippets in Search Results: Search results now include surrounding lines for better context understanding
- Match Highlighting: Search terms are highlighted with bold markers in results
- Improved Search Result Structure: Results are now grouped by file with match counts and snippets
Installation
npm install
Usage
Testing with MCP Inspector
# Replace /home/decoder/dev/obsidian/decoder with your vault path
安装
npx @modelcontextprotocol/inspector node src/index.js /home/decoder/dev/obsidian/decoder