A powerful toolkit for indexing, searching, and serving Obsidian notes with natural language queries via ChromaDB and Model Context Protocol (MCP).
- Automatic Indexing: Watches your Obsidian vault and indexes Markdown files into overlapping content chunks for fast semantic search.
- Vector Search: Leverages ChromaDB to find relevant snippets or entire note contents for any query.
- MCP Server: Exposes search tools via the Model Context Protocol, compatible with AI-powered workflows.
- Flexible Setup: Supports vault autodiscovery or configuration via environment variables.
- Live Updates: Near real-time updates as your vault changes.
scanner.py— File watcher and content indexer for your Obsidian vaultdaz-obsidian-mcp.py— MCP server exposing semantic search tools (snippets/full article)search.py— Simple CLI search/test utilityobsidian_chromadb/— Directory where the vector store (ChromaDB) is kept
- Python 3.8+
- pip (
pip install -r requirements.txt— see below)
Dependencies:
chromadbwatchdogmcp(Model Context Protocol Python SDK)
Install with:
pip install chromadb watchdog mcpBy default, the indexer will try to auto-discover your vault (macOS conventions supported):
~/Documents/Obsidian/or~/Library/Mobile Documents/iCloud~md~obsidian/Documents/
Custom Vault: Set the environment variable before running:
export OBSIDIAN_VAULT_PATH=/path/to/your/ObsidianVaultpython scanner.pyThis script creates/updates the vector database in obsidian_chromadb/, performing full and incremental indexing as your .md files change.
python search.py- Check chunk counts
- Run basic test queries
- Preview sample indexed files
Instead of running the server manually, add the following command to your Claude Desktop, ChatGPT, or other MCP-compatible client as a tool/plugin configuration:
python daz-obsidian-mcp.py
This lets your chosen client/tool launch and interact with the server directly. See your platform's documentation for how to add a custom tool/command.
{
"tool": "search_snippets",
"arguments": { "query": "What is spaced repetition?", "limit": 5 }
}{
"tool": "search_full",
"arguments": { "query": "zettelkasten", "limit": 2 }
}- If you see "ChromaDB database not found", run
scanner.pyfirst. - To re-index everything: delete the
obsidian_chromadb/folder and metadata, rerun the indexer. - Chunking is overlapping; deduplication for full-text is handled simply by concatenation.
- UTF-8 Safety: Chunks are tokenized on byte-level but also respect character boundaries to avoid decode errors.
MIT License (c) 2024 — Your Name Here
⬆️ Add your own banner.jpg image at the top of this folder to complete the visual branding!
