Obsidian Vault Search for Claude
Enables Claude to search and analyze Obsidian vault content using ripgrep with support for wiki links, backlinks, frontmatter properties, orphaned notes, and intelligent context detection showing which heading or property contains each match.
README
Obsidian Vault Search for Claude
This MCP server enables Claude to search file content using ripgrep - with extra features for Obsidian. It understands Obsidian-specific elements like wiki links, frontmatter properties, and provides intelligent context about where matches are found.
Available Tools
rg_search_notes
Search for text content within your notes with flexible scope options.
- Search all content, only frontmatter, or only note content
- Get smart context showing which frontmatter property or heading contains each match
- Filter by folder and control result limits
rg_search_links
Find and analyze links throughout your vault.
- Discover wiki links (
[[Note Title]]), markdown links, and external URLs - Filter links by URL patterns or title patterns
- Useful for finding broken links or analyzing your knowledge graph connections
rg_search_backlinks
Find all notes that link to a specific target note.
- Identify which notes reference a particular topic or note
- Understand the context around each backlink reference
- Discover how ideas connect across your vault
rg_search_recent_notes
Find notes modified within specific date ranges.
- Search by modification date using YYYY-MM-DD format
- Useful for reviewing recent work or finding notes from specific time periods
- Combine with other searches to find recent notes about specific topics
rg_search_orphaned_notes
Identify notes that have no incoming or outgoing links.
- Find isolated notes that might need better integration
- Discover forgotten content that could be connected to your knowledge graph
- Useful for vault maintenance and organization
Obsidian-Specific Capabilities
Smart Context Detection
When matches are found, Claude receives intelligent context:
- Frontmatter matches: Shows the property name (e.g.,
tags,project,status) - Content matches: Shows the nearest heading (e.g.,
## Project Ideas,### Meeting Notes) - Nested properties: Handles complex YAML structures in frontmatter
Link Understanding
- Wiki Links:
[[Note Title]]and[[Note Title|Display Text]] - Markdown Links:
[Display Text](note-file.md)and external URLs - Frontmatter Links: Links within YAML properties and lists
File Organization
- Folder Filtering: Limit searches to specific directories
- Date-Based Discovery: Find files by modification time
- Vault Structure: Understands Obsidian's file organization patterns
Additional Parameters
Most search tools support these common parameters:
Search Behavior
case_sensitive:trueorfalse(default: false)folder: Limit search to specific folder (e.g., "Daily Notes", "Projects/Active")max_results: Number of results to return (1-100, default: 15, automatically capped)smart_context: Include context detection (default: true, set to false for faster searches)
Search Scope (for rg_search_notes)
search_scope:"all"- Search everything (default)"content_only"- Skip frontmatter, search only note content"frontmatter_only"- Search only YAML frontmatter properties
Date Filtering (for rg_search_recent_notes)
start_date: Start date in YYYY-MM-DD format (e.g., "2024-01-15")end_date: End date in YYYY-MM-DD format (e.g., "2024-01-31")
Link Filtering (for rg_search_links)
link_type:"all","wiki_links","markdown_links", or"external_urls"url_pattern: Regex pattern to filter URLstitle_pattern: Regex pattern to filter link titles
Installation
Prerequisites
- Python 3.8 or higher
- ripgrep installed and available in PATH
- An Obsidian vault
Install ripgrep
Windows:
# Using winget (recommended)
winget install BurntSushi.ripgrep.MSVC
# Using chocolatey
choco install ripgrep
# Using scoop
scoop install ripgrep
macOS:
brew install ripgrep
Linux (Ubuntu/Debian):
sudo apt install ripgrep
Install the MCP Server
# Clone the repository
git clone https://github.com/kpetrovsky/kp-ripgrep-mcp.git
cd kp-ripgrep-mcp
# Install the package
pip install -e .
Configure Claude Desktop
Add this configuration to Claude Desktop:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"obsidian-search": {
"command": "python",
"args": ["-m", "rgrep_mcp.server"],
"env": {
"OBSIDIAN_VAULT_PATH": "/path/to/your/obsidian/vault"
}
}
}
}
Replace /path/to/your/obsidian/vault with your actual vault path.
Alternative Configuration
Environment Variable (all platforms):
export OBSIDIAN_VAULT_PATH="/path/to/your/obsidian/vault"
Configuration File:
Create ~/.rgrep-mcp.json:
{
"vault_path": "/path/to/your/obsidian/vault",
"default_case_sensitive": false,
"default_result_limit": 15
}
Troubleshooting
"ripgrep (rg) is not installed or not in PATH"
Verify ripgrep installation:
rg --version
If this command fails, reinstall ripgrep using the instructions above.
"No vault path configured" or "Vault path does not exist"
- Ensure
OBSIDIAN_VAULT_PATHenvironment variable is set correctly - Verify the path points to your Obsidian vault directory (contains .md files)
- Use absolute paths, not relative paths
- On Windows, use forward slashes or escape backslashes in JSON:
"C:/Users/Name/Vault"or"C:\\Users\\Name\\Vault"
Claude isn't finding expected results
- Verify search terms: Check that the content actually exists in your notes
- Check scope: Try
"search_scope": "all"first, then narrow down - Test with simple queries: Start with basic text searches before using complex patterns
- Check folder restrictions: If using the
folderparameter, ensure it contains the expected notes
Performance issues with large vaults
- Use folder filtering: Limit searches to specific directories when possible
- Reduce max_results: Start with smaller limits (5-10) for faster responses
- Disable smart_context: Set
"smart_context": falsefor faster searches when context isn't needed - Be specific: More targeted search terms are faster than broad queries
Date format errors
Use YYYY-MM-DD format for dates:
- ✅ "2024-01-15"
- ✅ "2024-12-31"
- ❌ "01/15/2024"
- ❌ "Jan 15, 2024"
Permission issues
- Ensure Claude Desktop has permission to access your vault directory
- On macOS, you may need to grant Full Disk Access to Claude Desktop in System Preferences
Example Usage
Ask Claude:
- "Find all notes containing 'machine learning' in my Research folder"
- "Show me notes I modified last week"
- "What notes link to my 'Project Ideas' note?"
- "Find notes with 'productivity' in the tags property"
- "Search for 'meeting' only in note content, not frontmatter"
License
MIT 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 模型以安全和受控的方式获取实时的网络信息。