Obsidian MCP Tools
A read-only toolkit for searching and analyzing Markdown note directories and Obsidian vaults through AI clients. It enables metadata extraction, full-text search, and natural language querying of note content, tags, and backlinks.
README
Obsidian Model Context Protocol Tools
A Model Context Protocol (MCP) server that allows MCP clients (Cursor, VSCode, Claude Desktop, etc.) to read and search any directory containing Markdown notes, such as an Obsidian vault.
This server exposes a rich, read-only toolkit of obsidian_-prefixed MCP tools for working with vault metadata (tags, links, frontmatter), filenames, and full-text content.
Prerequisites
- Node.js (v18 or higher)
- npm (comes with Node.js)
- An Obsidian vault or directory containing Markdown files
Installation
1. Clone the Repository
git clone https://github.com/dp-veritas/mcp-obsidian-tools.git
cd mcp-obsidian-tools
2. Install Dependencies
npm install
3. Build the Project
npm run build
This will compile the TypeScript code and create the dist/ directory with the executable files.
Configuration
After building, you need to add this server to your MCP client's configuration. The configuration format varies by client, but generally follows this pattern:
Quick Start: See
example-mcp-config.jsonfor Cursor/VSCode format, orexample-claude-desktop-config.jsonfor Claude Desktop format.
Configuration Format
Add an entry to your MCP client's configuration file (usually mcpServers or mcp.servers):
{
"mcpServers": {
"obsidian": {
"command": "node",
"args": ["/absolute/path/to/mcp-obsidian-tools/dist/index.js", "/path/to/your/vault"]
}
}
}
Important: Use absolute paths for both the server location and your vault path.
Path Formats Supported
The vault path can be:
- Absolute path:
/Users/username/Documents/MyVault - Relative path:
./my-vault(relative to current working directory) - Home directory shortcut:
~/Documents/MyVault
Example Configurations
For Cursor
Add to your Cursor MCP settings file (location varies by OS):
{
"mcpServers": {
"obsidian": {
"command": "node",
"args": ["/Users/username/path/to/mcp-obsidian-tools/dist/index.js", "/Users/username/Documents/MyVault"]
}
}
}
For VSCode
Add to your User Settings JSON (Ctrl+Shift+P → Preferences: Open User Settings (JSON)) or create .vscode/mcp.json:
{
"mcp": {
"servers": {
"obsidian": {
"command": "node",
"args": ["/Users/username/path/to/mcp-obsidian-tools/dist/index.js", "/Users/username/Documents/MyVault"]
}
}
}
}
For Claude Desktop
Add to Claude Desktop's MCP configuration file (location varies by OS). Claude Desktop configs can include a preferences section:
{
"preferences": {
"quickEntryShortcut": {
"accelerator": "Alt+Space"
}
},
"mcpServers": {
"obsidian": {
"command": "node",
"args": ["/Users/username/path/to/mcp-obsidian-tools/dist/index.js", "/Users/username/Documents/MyVault"]
}
}
}
Note: See
example-claude-desktop-config.jsonfor a complete Claude Desktop example. Seeexample-mcp-config.jsonfor Cursor/VSCode format.
Global Installation (Optional)
If you prefer to install globally so you can use it from anywhere:
npm install -g .
Then configure with:
{
"mcpServers": {
"obsidian": {
"command": "mcp-obsidian-tools",
"args": ["/path/to/your/vault"]
}
}
}
Available Tools
Once configured, the following MCP tools will be available:
-
obsidian_search_notes: Search for notes by filename (case-insensitive, supports simple regex / wildcards). Returns relative paths of matching.mdfiles. -
obsidian_read_notes: Read the contents of multiple notes by relative path. Each note is returned with its path header; failures are reported per-note. SetheadersOnly: trueto return only headings (lines starting with#) for quick title/structure extraction. -
obsidian_list_tags: Scan all Markdown files and list all tags (frontmattertagsand inline#tags) with occurrence counts. OptionalstartsWithfilter. -
obsidian_notes_by_tag: Given one or more tag names, return all note paths that contain those tags (frontmatter or inline). Optionalmatchof"any"or"all". -
obsidian_get_frontmatter: Return parsed YAML frontmatter as JSON for a given note path (e.g.author,tags,created). -
obsidian_backlinks: Given a target note path or name, list all notes that link to it, via Obsidian wikilinks ([[Note Name]]) or markdown links ([Display](path)). -
obsidian_search_content: Full-text search inside note contents (not filenames). Supports simple wildcard patterns; can return just paths or snippets with context. -
obsidian_query: Natural-language query over the vault, with optional date filtering based on frontmatter dates (e.g.created: YYYY-MM-DDTHH:MM:SS). -
obsidian_count_files: Count the total number of markdown files in the vault or a specific subfolder. Supports fuzzy folder lookup - if a folder like "History 101" isn't at the root, automatically searches the entire vault for matching folders. Returns total count and breakdown by immediate subfolders. SetincludeNames: trueto also get a list of file names (up to 100). Useful for understanding vault size, organization, and listing files in a folder.
All tools are read-only and are strictly confined to the vault directory (and its real/symlinked path) via path validation.
Example obsidian_query Prompts
Which of my entries concern the overton window?Show interview candidate notes I've logged from the last 6 monthsAny daily notes about board-related topics this month?
Troubleshooting
Server Not Starting
- Check paths: Ensure both the server path and vault path are absolute paths
- Verify build: Make sure you ran
npm run buildand thedist/directory exists - Check Node.js: Ensure Node.js v18+ is installed (
node --version)
Tools Not Appearing
- Restart client: After adding the configuration, restart your MCP client (Cursor/VSCode/Claude Desktop)
- Check logs: Look for error messages in your MCP client's logs
- Verify vault path: Ensure the vault path is correct and accessible
Permission Errors
- Check vault permissions: Ensure you have read access to the vault directory
- Check server permissions: Ensure the
dist/index.jsfile is executable (chmod +x dist/index.js)
Model Compatibility
Tool-calling quality depends on your LLM. Some models (especially smaller ones) may struggle to format correct parameters for MCP tools, particularly with:
- Complex natural language queries
- Non-English input
- Multiple parameters
If you encounter unexpected errors, try:
- Simplifying your query
- Using a larger/more capable model (i.e., Sonnet vs Haiku)
- Checking that your MCP client is in the correct mode (i.e., Agent or Plan Mode in Cursor)
Note: Complex cross-referencing queries (e.g., "How does X relate to Y across my vault?") may require 10-30+ tool calls as the model iterates through different search strategies. This is normal behavior, not a failure.
Development
To watch for changes during development:
npm run watch
License
See LICENSE file for details.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。