obsidian-mcp
obsidian-mcp (Python)
一个用 Python 编写的 MCP(模型上下文协议)服务器,通过直接文件系统访问,让 LLM 客户端(如 Claude Desktop)能够读写本地 Obsidian 仓库(vault)——不需要 Obsidian Local REST API 插件,不需要 HTTP,也不需要认证令牌。
这是 obsidian-mcp(TypeScript)的 Python 移植版,功能等价,但有几处刻意为之的修复和简化——完整理由见 Plans/review-the-typescript-obsidian-mcp-parsed-shamir.md 和 ISA.md。
警告:此服务器对您的仓库具有读写权限。使用前请备份您的笔记(例如通过 git)。
环境要求
Python 3.11+
一个 Obsidian 仓库(一个至少被 Obsidian 打开过一次的目录,即包含
.obsidian/app.json)macOS 或 Linux(Windows 不受支持——见 ISA「超出范围」)
Related MCP server: Obsidian MCP Server
安装与运行
uv sync
uv run obsidian-mcp /path/to/your/vault [/path/to/another/vault ...]仓库名称根据每个目录的 basename 自动派生(转为小写,非字母数字字符变为连字符,重复时加数字后缀)。最多支持 10 个仓库;仓库路径之间不能互相嵌套。
Claude Desktop 配置
编辑 claude_desktop_config.json(macOS:~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"obsidian": {
"command": "uv",
"args": ["run", "--directory", "/path/to/py-obsidian-mcp", "obsidian-mcp", "/path/to/your/vault"]
}
}
}工具
read-note、create-note、edit-note(追加/前置/替换/删除)、delete-note(默认软删除到 .trash/)、move-note、create-directory、search-vault(内容/文件名/标签搜索,可选 max_results)、add-tags、remove-tags、rename-tag(整个仓库范围,保持层级结构)、list-available-vaults。
另外还暴露了一个 obsidian-vault:// 资源方案(仓库列表/信息)和一个 list-vaults 提示。
开发
uv sync --all-extras
uv run pytest -q
uv run ruff check src tests安全说明
每个工具都会校验目标路径保持在仓库范围内(
src/obsidian_mcp/utils/path_safety.py),包括感知符号链接的包含检查。TypeScript 原版存在一个已确认的 bug:这个包含检查实际上相当于空操作(一个异步验证函数被调用时没有
await)。本移植版的路径安全函数全部是同步的,从根本上防止了这类 bug 的发生。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables direct file system access to Obsidian vaults with auto-discovery, full-text search, and note operations. Supports reading, writing, and searching across Obsidian notes without requiring plugins or REST API.63,860MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Obsidian vaults through direct filesystem access, supporting note management, lightning-fast search with SQLite indexing, image analysis, tag/link management, and bulk operations.MIT
- FlicenseAqualityDmaintenanceEnables comprehensive management of Obsidian vaults with full CRUD operations, advanced search, link/tag extraction, backlinks discovery, frontmatter editing, and template-based note creation through natural language.16
- AlicenseAqualityDmaintenanceEnables AI assistants to interact with local Obsidian vaults through direct filesystem access for reading, creating, and managing notes. It features high-performance SQLite indexing for fast searches, regex support, and tools for organizing tags and links without requiring additional plugins.271MIT
Related MCP Connectors
Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.
Search your Obsidian vault to quickly find notes by title or keyword, summarize related content, a…
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ubahmapk/py-obsidian-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server