Exposes your Obsidian Smart Connections vector database to enable semantic search across your vault, find related notes, and retrieve context blocks for RAG queries using the existing embeddings from the Smart Connections plugin.
Smart Connections MCP Server
Exposes your Obsidian Smart Connections vector database to Claude Code via Model Context Protocol (MCP).
What This Does
Instead of using text-based Grep, Claude Code can now perform semantic search across your vault:
semantic_search: Find notes by meaning, not keywords
find_related: Get related notes (like Smart Connections sidebar)
get_context_blocks: Get best context for RAG queries
Architecture
Installation
Quick Install (Recommended)
The script will:
✅ Install UV package manager (if needed)
✅ Create virtual environment
✅ Install all dependencies
✅ Auto-detect your Obsidian vault
✅ Configure
~/.mcp.json✅ Verify installation
Manual Installation
1. Install UV
2. Create Virtual Environment and Install Dependencies
Important dependencies:
mcp>=1.0.0- Official Model Context Protocol SDKsentence-transformers>=2.2.0- For semantic searchnumpy<2.0.0- Version 1.x required (2.x breaks compatibility)torch>=2.0.0andtransformers>=4.30.0- ML dependencies
3. Configure Claude Code
Add to ~/.mcp.json:
Note: Use the virtual environment Python, not system Python!
4. Verify Installation
Expected output:
Migration to New Machine
See for detailed migration guide.
Quick migration:
Important: Keep this MCP server in a separate repository from your Obsidian vault. See DEPLOYMENT.md for rationale and best practices.
Troubleshooting
If you see timeout issues, see TROUBLESHOOTING.md.
Usage Examples
Semantic Search
Old way (Grep):
New way (Semantic Search):
Find Related Notes
Like Smart Connections sidebar:
Get Context for RAG
Build context for complex queries:
How It Works
Reads existing embeddings from
.smart-env/multi/*.ajsonNo re-indexing needed - uses Smart Connections' work
Same model (BGE-micro-v2) for query encoding
Cosine similarity to rank results
Returns JSON with file paths, similarity scores, metadata
Tools Provided
semantic_search
Returns:
find_related
get_context_blocks
Returns actual text content (not just paths) for RAG.
Performance
Initial load: ~2-3 seconds (loads 3,249 embeddings)
Query time: ~100-200ms (cosine similarity across all embeddings)
Memory: ~50MB (cached embeddings)
Troubleshooting
See
Common Issues
Server Timeout on claude mcp list
Symptoms: Connection hangs, no response after 30+ seconds
Fixes:
Ensure using virtual environment Python (not system Python)
Verify NumPy version is <2.0.0:
uv pip list | grep numpyCheck server starts manually:
OBSIDIAN_VAULT_PATH="/path/to/vault" .venv/bin/python server.py
Import Errors
Error: ImportError: numpy.core.multiarray failed to import
Fix: Reinstall with NumPy 1.x:
No Results Returned
Check
.smart-env/multi/has .ajson filesVerify Smart Connections is enabled in Obsidian
Lower
min_similaritythreshold (try 0.2 instead of 0.3)
Wrong Results
Smart Connections may need to re-index
Check embedding model matches (BGE-micro-v2)
Restart server to reload embeddings
Development
Update embeddings:
Smart Connections auto-updates
.smart-env/MCP server reads on startup (restart to refresh)
Future: Add file watcher for auto-reload
Add new tools:
Edit handle_request() in server.py
License
MIT - Use freely for personal PKM workflows
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
Enables Claude to perform semantic search across your Obsidian vault using Smart Connections vector database. Provides meaning-based search, related note discovery, and context retrieval for RAG queries instead of basic keyword matching.