
Obsidian Semantic Search
io.github.DalecB由 GitHub 账号 DalecB 发布v0.2.1更新于 Oct 24, 2026
Read-only semantic search MCP server for Obsidian vaults using local Ollama embeddings.
概览
只读的 MCP 服务器,让助手使用本地 Ollama 嵌入对本地 Obsidian 笔记库进行语义搜索和读取。
- 可以做什么
- 以混合语义、关键词或向量排序搜索笔记,返回文件级匹配结果,含标题、片段和行号范围,解锁后可包含敏感文件夹。按库内相对路径读取整篇笔记或指定行范围。构建或更新外部 SQLite 索引,可增量执行或针对指定文件,并查看索引元数据与当前安全设置。
- 适用场景
- 适合需要让助手在 Obsidian 笔记库中找到并阅读正确笔记、但不允许写入、编辑、移动或删除笔记的场景,也适合希望嵌入和索引都留在本机的用户。适用于“哪篇笔记解释了这个决定”“我在哪里写过某个主题”这类检索问题。
- 运行要求
- 通过 npx 以 stdio 在本地运行,需要 Node.js 24 或更高版本、已拉取嵌入模型的 Ollama 服务(默认 bge-m3)以及一个 MCP 客户端。必须设置环境变量 OBSIDIAN_VAULT_ROOT 为笔记库绝对路径;可选变量包括索引目录、Ollama 地址、嵌入模型、排除目录和敏感目录。
安装
在 SourceWeft 中
- 打开 控制台中的 Obsidian Semantic Search,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Obsidian Semantic Search MCP
Read-only semantic retrieval for agents that need to find the right Obsidian note without write access.
[npm] [MCP Registry] [License] [Node.js]
한국어 · Quick Start · Why This Exists · How It Works
Your Obsidian vault is useful only if your agent can find the right note.
Keyword search misses context. Full write-capable Obsidian MCP servers expose more power than a retrieval agent needs. Obsidian plugins are great inside Obsidian, but they are not always the right boundary for Codex, Claude Desktop, Cursor, or any other MCP client.
This project is the narrow version:
No note writes. No cloud embeddings by default. No Obsidian plugin runtime. No sync service.
Status:
0.3.1early preview. The server is usable today, but ranking behavior and tool schemas may change before1.0.
What You Get
Example result shape:
Quick Start
Requirements:
- Node.js
>= 24 - Ollama
- An Obsidian vault
- An MCP client such as Codex, Claude Desktop, Cursor, or another stdio MCP client
Install the embedding model:
Print setup guidance:
Codex Setup
Add this to ~/.codex/config.toml:
Restart Codex, then run:
Claude Code Setup
Add the server at user scope so the personal vault path stays out of project .mcp.json files:
Start a new Claude Code session and run /mcp to confirm the server is connected. On native Windows, use -- cmd /c npx -y @dalecb/obsidian-semantic-mcp after the environment flags.
See Anthropic's Claude Code MCP documentation for scope and command details.
Claude Desktop / JSON MCP Client Setup
In Claude Desktop, open Settings → Developer → Edit Config. This opens ~/Library/Application Support/Claude/claude_desktop_config.json on macOS or %APPDATA%\Claude\claude_desktop_config.json on Windows. Merge the following server into mcpServers:
Fully quit and restart Claude Desktop. Cursor and other JSON-style stdio MCP clients can use the same mcpServers entry. On Windows, if npx is not found, use "command": "cmd" and prepend "/c", "npx" to args.
See the official local MCP server guide for Claude Desktop configuration and logs.
Why This Exists
This isn't aiming to be the most powerful Obsidian automation server. It aims to be the safest retrieval tool you can hand an agent.
Here's how it stacks up against the two tools it usually comes down to — a full-permission Obsidian MCP server (Local REST API based) and GBrain (a broader knowledge-compilation platform):
That trade is on purpose: give up writing, editing, and running inside Obsidian, and you get fewer moving parts and a smaller blast radius in return.
Use this if your agent should answer:
- "Which note explains this project decision?"
- "Find the file where I wrote about idempotency payload mismatch."
- "Show me the career notes related to this interview topic."
- "Search my vault, but do not mutate it."
Do not use this if you want an Obsidian UI plugin, automatic note generation, or write-capable vault automation.
Tools
index_status
Returns index metadata and safety settings.
index_vault
Builds or updates the external SQLite index.
Specific files:
search_notes
Searches notes with hybrid semantic and keyword ranking.
Modes:
hybrid: semantic vector + SQLite FTS5 + metadata boostssemantic: vector-first searchkeyword: FTS5 keyword search without embedding the query
read_note
Reads a note or line range by vault-relative path.
How It Works
Default storage:
The vault remains the source of truth. The SQLite database is a derived index and can be deleted/rebuilt.
Safety Model
The server reads your vault and never writes to it. Three layers decide what an agent can see.
1. Always denied (system / tooling). Never indexed, no override:
.obsidian/,.smart-env/,.claude/,.codex-*/- any hidden folder (name starts with
.) node_modules,cache,logs
2. Sensitive — denied by default, unlockable. Stays blocked even when a tool call passes include_sensitive: true, unless the server is started with OBSIDIAN_SEMANTIC_ALLOW_SENSITIVE=true. Defaults to 08_PersonalInfo/. Override the list with OBSIDIAN_SEMANTIC_SENSITIVE_PATHS (comma- or newline-separated folders):
3. Your own excludes — always denied. Folders you never want indexed, searched, or read. No unlock flag:
Which one do you want?
- "Don't index this at all" →
OBSIDIAN_SEMANTIC_EXCLUDE - "Keep it locked, but I can unlock it with a flag when I need to" →
OBSIDIAN_SEMANTIC_SENSITIVE_PATHS+OBSIDIAN_SEMANTIC_ALLOW_SENSITIVE
Additional guards:
- All paths are resolved through
realpath. - Path traversal and URL-encoded traversal are blocked.
- Symlinks that escape the vault root or point to a denied in-vault path are blocked.
search_notesandread_noteenforce the current exclusion settings on every call. With automatic indexing enabled, the next search also removes excluded stale rows from the index. Confirm the active lists withindex_status.
The local index stores snippets and embedding vectors. Treat it as a derived copy of your vault. See PRIVACY.md.
Indexing Strategy
The default is action-driven, not timer-based:
- The first
search_notesafter server start. - The first
search_notesafter a Markdown create, update, delete, or rename event. - The first
search_notesafter the embedding model or index format changes; this triggers a full rebuild. - An explicit
index_vaultcall.
The filesystem watcher only marks the index dirty. Indexing runs once, immediately before the next search, and concurrent searches share that work. If recursive watching is unavailable, the server falls back to an incremental scan before every search.
Disable automatic indexing with:
Then call index_vault { "mode": "incremental" } yourself. The legacy OBSIDIAN_SEMANTIC_STARTUP_INDEX=true remains supported, but is not the default because it does work even when no search follows.
Search Quality Evaluation
Create a JSON file containing queries and expected paths to compare keyword, semantic, and hybrid modes under the same conditions:
The command reports Recall@K and MRR. Avoid adding ranking complexity or embedding cost unless hybrid search measurably beats the keyword baseline.
Refresh the index with search_notes or index_vault before evaluating.
Development
Before publishing:
Confirm the package does not include data/, *.sqlite, or private vault files.
License
MIT
来源:README.md,提交 0e01b3a
工具
0版本历史
1- v0.2.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
