Skip to main content
Glama

Smart Connections MCP Server

by dan6684
install.sh•5.29 kB
#!/bin/bash set -e echo "šŸš€ Setting up Smart Connections MCP..." echo "" # 1. Install UV if needed if ! command -v uv &> /dev/null; then echo "šŸ“¦ Installing UV package manager..." curl -LsSf https://astral.sh/uv/install.sh | sh export PATH="$HOME/.local/bin:$PATH" else echo "āœ“ UV already installed" fi # 2. Create virtual environment if [ -d ".venv" ]; then echo "āœ“ Virtual environment exists" else echo "šŸ“¦ Creating virtual environment..." uv venv fi # 3. Install dependencies echo "šŸ“¦ Installing dependencies..." uv pip install -r requirements.txt echo "" echo "āœ“ Python dependencies installed" echo "" # 4. Detect vault path echo "šŸ” Looking for Obsidian vault..." # Try common locations VAULT_CANDIDATES=( "$HOME/Library/Mobile Documents/iCloud~md~obsidian/Documents" "$HOME/Documents/Obsidian" "$HOME/Obsidian" ) VAULT_PATH="" for candidate in "${VAULT_CANDIDATES[@]}"; do if [ -d "$candidate" ]; then # Find first directory with .obsidian folder FOUND=$(find "$candidate" -maxdepth 2 -name ".obsidian" -type d 2>/dev/null | head -1) if [ -n "$FOUND" ]; then VAULT_PATH=$(dirname "$FOUND") break fi fi done if [ -z "$VAULT_PATH" ]; then echo "āš ļø Could not auto-detect Obsidian vault" echo "" read -p "Enter full path to your Obsidian vault: " VAULT_PATH if [ ! -d "$VAULT_PATH" ]; then echo "āŒ Error: Vault path does not exist: $VAULT_PATH" exit 1 fi fi echo "āœ“ Found vault: $VAULT_PATH" # Verify it's an Obsidian vault if [ ! -d "$VAULT_PATH/.obsidian" ]; then echo "āš ļø Warning: $VAULT_PATH does not appear to be an Obsidian vault (.obsidian folder not found)" read -p "Continue anyway? (y/N): " CONFIRM if [ "$CONFIRM" != "y" ] && [ "$CONFIRM" != "Y" ]; then echo "Aborted." exit 1 fi fi # 5. Get current directory (absolute path) MCP_DIR=$(pwd) PYTHON_PATH="$MCP_DIR/.venv/bin/python" # Verify Python exists if [ ! -f "$PYTHON_PATH" ]; then echo "āŒ Error: Python not found at $PYTHON_PATH" echo " Virtual environment may not have been created correctly." exit 1 fi echo "" echo "šŸ“ Configuration:" echo " MCP Server: $MCP_DIR" echo " Python: $PYTHON_PATH" echo " Vault: $VAULT_PATH" echo "" # 6. Create/update MCP config MCP_CONFIG="$HOME/.mcp.json" # Check if config exists if [ -f "$MCP_CONFIG" ]; then echo "āš ļø Existing MCP config found at $MCP_CONFIG" echo " Creating backup at $MCP_CONFIG.backup" cp "$MCP_CONFIG" "$MCP_CONFIG.backup" # Check if smart-connections already exists if grep -q '"smart-connections"' "$MCP_CONFIG"; then echo "āš ļø smart-connections server already configured" read -p "Overwrite existing configuration? (y/N): " OVERWRITE if [ "$OVERWRITE" != "y" ] && [ "$OVERWRITE" != "Y" ]; then echo "" echo "ā„¹ļø Skipping MCP config update." echo " Manual configuration required. Add this to $MCP_CONFIG:" echo "" cat <<EOF { "mcpServers": { "smart-connections": { "command": "$PYTHON_PATH", "args": ["$MCP_DIR/server.py"], "env": { "OBSIDIAN_VAULT_PATH": "$VAULT_PATH" } } } } EOF exit 0 fi fi # TODO: Properly merge JSON (for now, just append) echo "āš ļø Note: Automatic config merging not yet implemented" echo " You may need to manually merge configurations" fi # Create new config (simple version - overwrites existing) echo "šŸ“ Writing MCP configuration..." cat > "$MCP_CONFIG" <<EOF { "mcpServers": { "smart-connections": { "command": "$PYTHON_PATH", "args": ["$MCP_DIR/server.py"], "env": { "OBSIDIAN_VAULT_PATH": "$VAULT_PATH" } } } } EOF echo "āœ“ MCP configuration written to $MCP_CONFIG" echo "" # 7. Verify installation echo "šŸ” Verifying installation..." echo "" if command -v claude &> /dev/null; then claude mcp list EXIT_CODE=$? if [ $EXIT_CODE -eq 0 ]; then echo "" echo "āœ… Installation complete and verified!" echo "" echo "šŸ“š Next steps:" echo " 1. Open Obsidian and ensure Smart Connections plugin is enabled" echo " 2. Let Smart Connections index your vault (may take a few minutes)" echo " 3. Try semantic search in Claude Code!" echo "" echo "šŸ“– Documentation:" echo " - README.md - Usage examples" echo " - TROUBLESHOOTING.md - Debug guide" echo " - DEPLOYMENT.md - Migration guide" else echo "" echo "āš ļø Installation complete but verification failed" echo " Run 'claude mcp list' to check connection status" echo " See TROUBLESHOOTING.md for help" fi else echo "āš ļø 'claude' command not found - cannot verify" echo " Install Claude Code to verify the setup" echo "" echo "āœ… Installation files configured successfully!" fi echo ""

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dan6684/smart-connections-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server