Smart Connections MCP Server
Enables semantic search and knowledge graph exploration of Obsidian vaults using Smart Connections embeddings. Provides intelligent note discovery, similarity search, and connection mapping through natural language queries.
README
Smart Connections MCP Server
A Model Context Protocol (MCP) server that provides semantic search and knowledge graph capabilities for Obsidian vaults using Smart Connections embeddings.
Overview
This MCP server allows Claude (and other MCP clients) to:
- Search semantically through your Obsidian notes using pre-computed embeddings
- Find similar notes based on content similarity
- Build connection graphs showing how notes are related
- Query by embedding vectors for advanced use cases
- Access note content with block-level granularity
Features
🔍 Semantic Search
Uses the embeddings generated by Obsidian's Smart Connections plugin to perform fast, accurate semantic searches across your entire vault.
🕸️ Connection Graphs
Builds multi-level connection graphs showing how notes are related through semantic similarity, helping discover hidden relationships in your knowledge base.
📊 Vector Similarity
Direct access to embedding-based similarity calculations using cosine similarity on 384-dimensional vectors (TaylorAI/bge-micro-v2 model).
📝 Content Access
Retrieve full note content or specific sections/blocks with intelligent extraction based on Smart Connections block mappings.
Installation
Prerequisites
- Node.js 18 or higher
- An Obsidian vault with Smart Connections plugin installed and embeddings generated
- Claude Desktop (or another MCP client)
Setup
-
Clone the repository:
git clone https://github.com/msdanyg/smart-connections-mcp.git cd smart-connections-mcp -
Install dependencies:
npm install -
Build the TypeScript project:
npm run build -
Configure Claude Desktop:
Edit your Claude Desktop configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Add the following to the
mcpServerssection:{ "mcpServers": { "smart-connections": { "command": "node", "args": [ "/ABSOLUTE/PATH/TO/smart-connections-mcp/dist/index.js" ], "env": { "SMART_VAULT_PATH": "/ABSOLUTE/PATH/TO/YOUR/OBSIDIAN/VAULT" } } } }Important: Replace the paths with your actual paths:
- Update the
argspath to point to your builtindex.jsfile - Update
SMART_VAULT_PATHto your Obsidian vault path
- macOS:
-
Restart Claude Desktop
The MCP server will automatically start when Claude Desktop launches.
Available Tools
1. get_similar_notes
Find notes semantically similar to a given note.
Parameters:
note_path(string, required): Path to the note (e.g., "Note.md" or "Folder/Note.md")threshold(number, optional): Similarity threshold 0-1, default 0.5limit(number, optional): Maximum results, default 10
Example:
{
"note_path": "MyNote.md",
"threshold": 0.7,
"limit": 5
}
Returns:
[
{
"path": "RelatedNote.md",
"similarity": 0.85,
"blocks": ["#Overview", "#Key Points", "#Details"]
}
]
2. get_connection_graph
Build a multi-level connection graph showing how notes are semantically connected.
Parameters:
note_path(string, required): Starting note pathdepth(number, optional): Graph depth (levels), default 2threshold(number, optional): Similarity threshold 0-1, default 0.6max_per_level(number, optional): Max connections per level, default 5
Example:
{
"note_path": "MyNote.md",
"depth": 2,
"threshold": 0.7
}
Returns:
{
"path": "MyNote.md",
"depth": 0,
"similarity": 1.0,
"connections": [
{
"path": "RelatedNote.md",
"depth": 1,
"similarity": 0.82,
"connections": [...]
}
]
}
3. search_notes
Search notes using a text query (keyword-based, ranked by relevance).
Parameters:
query(string, required): Search query textlimit(number, optional): Maximum results, default 10threshold(number, optional): Relevance threshold 0-1, default 0.5
Example:
{
"query": "project management",
"limit": 5
}
4. get_embedding_neighbors
Find nearest neighbors for a given embedding vector (advanced use).
Parameters:
embedding_vector(number[], required): 384-dimensional vectork(number, optional): Number of neighbors, default 10threshold(number, optional): Similarity threshold 0-1, default 0.5
5. get_note_content
Retrieve full note content with optional block extraction.
Parameters:
note_path(string, required): Path to the noteinclude_blocks(string[], optional): Specific block headings to extract
Example:
{
"note_path": "MyNote.md",
"include_blocks": ["#Introduction", "#Main Points"]
}
Returns:
{
"content": "# Full note content...",
"blocks": {
"#Introduction": "Content of this section...",
"#Main Points": "Content of this section..."
}
}
6. get_stats
Get statistics about the knowledge base.
Parameters: None
Returns:
{
"totalNotes": 137,
"totalBlocks": 1842,
"embeddingDimension": 384,
"modelKey": "TaylorAI/bge-micro-v2"
}
Usage Examples
Once configured, you can ask Claude to use these tools naturally:
- "Find notes similar to my project planning document"
- "Show me a connection graph starting from my main research note"
- "Search my notes for information about [your topic]"
- "What's in my note about [topic]?"
- "Give me stats about my knowledge base"
Architecture
┌─────────────────────────────────────────────────────────────┐
│ Claude Desktop │
│ (MCP Client) │
└─────────────────────────┬───────────────────────────────────┘
│
│ MCP Protocol (stdio)
│
┌─────────────────────────▼───────────────────────────────────┐
│ Smart Connections MCP Server │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ index.ts (MCP Server + Tool Handlers) │ │
│ └────────────────┬────────────────────────────────────┘ │
│ │ │
│ ┌────────────────▼────────────────────────────────────┐ │
│ │ search-engine.ts (Semantic Search Logic) │ │
│ │ - getSimilarNotes() │ │
│ │ - getConnectionGraph() │ │
│ │ - searchByQuery() │ │
│ └────────────────┬────────────────────────────────────┘ │
│ │ │
│ ┌────────────────▼────────────────────────────────────┐ │
│ │ smart-connections-loader.ts (Data Access) │ │
│ │ - Load .smart-env/smart_env.json │ │
│ │ - Load .smart-env/multi/*.ajson embeddings │ │
│ │ - Read note content from vault │ │
│ └────────────────┬────────────────────────────────────┘ │
│ │ │
│ ┌────────────────▼────────────────────────────────────┐ │
│ │ embedding-utils.ts (Vector Math) │ │
│ │ - cosineSimilarity() │ │
│ │ - findNearestNeighbors() │ │
│ └─────────────────────────────────────────────────────┘ │
└─────────────────────────┬───────────────────────────────────┘
│
│ File System Access
│
┌─────────────────────────▼───────────────────────────────────┐
│ Obsidian Vault + .smart-env/ │
│ - smart_env.json (config) │
│ - multi/*.ajson (embeddings for 137 notes) │
│ - *.md (markdown note files) │
└─────────────────────────────────────────────────────────────┘
Technical Details
Embedding Model
- Model: TaylorAI/bge-micro-v2
- Dimensions: 384
- Similarity Metric: Cosine similarity
Data Format
The server reads from Obsidian's Smart Connections .smart-env/ directory:
smart_env.json: Configuration and model settingsmulti/*.ajson: Per-note embeddings and block mappings
Performance
- Load time: ~2-5 seconds for 137 notes
- Search: Near-instant (<50ms) using pre-computed embeddings
- Memory: ~20-30MB for embeddings + note index
Development
Build
npm run build
Watch Mode
npm run watch
Run Locally
export SMART_VAULT_PATH="/path/to/your/vault"
npm run dev
Project Structure
smart-connections-mcp/
├── src/
│ ├── index.ts # MCP server & tool handlers
│ ├── search-engine.ts # Semantic search logic
│ ├── smart-connections-loader.ts # Data loading
│ ├── embedding-utils.ts # Vector math utilities
│ └── types.ts # TypeScript type definitions
├── dist/ # Compiled JavaScript (generated)
├── package.json
├── tsconfig.json
└── README.md
Troubleshooting
"Smart Connections directory not found"
- Ensure your vault has the Smart Connections plugin installed
- Verify embeddings have been generated (check
.smart-env/multi/directory) - Check that
SMART_VAULT_PATHpoints to the correct vault
"Configuration file not found"
- Run Smart Connections in Obsidian at least once to generate configuration
- Check for
.smart-env/smart_env.jsonin your vault
"No embeddings found for note"
- Some notes may not have embeddings if they're too short (< 200 chars)
- Re-run Smart Connections embedding generation in Obsidian
Server not appearing in Claude Desktop
- Verify the configuration file syntax (JSON must be valid)
- Check the file paths are absolute paths, not relative
- Restart Claude Desktop completely
- Check Claude Desktop logs for error messages
License
MIT
Author
Daniel Glickman
Acknowledgments
- Built for use with Obsidian
- Integrates with Smart Connections plugin
- Uses Model Context Protocol by Anthropic
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。