Skip to main content
Glama
setup.shโ€ข3.47 kB
#!/bin/bash # Obsidian MCP Setup Script for macOS/Linux # Quick setup for Amp + Obsidian integration set -e echo "๐Ÿš€ Obsidian MCP Setup for Amp" echo "================================" echo "" # Check prerequisites echo "๐Ÿ“‹ Checking prerequisites..." # Check Node.js if ! command -v node &> /dev/null; then echo "โŒ Node.js not found. Please install Node.js v18+ from https://nodejs.org/" exit 1 fi NODE_VERSION=$(node -v | cut -d'v' -f2 | cut -d'.' -f1) if [ "$NODE_VERSION" -lt 18 ]; then echo "โŒ Node.js version $NODE_VERSION is too old. Please install v18 or newer." exit 1 fi echo "โœ… Node.js $(node -v) found" # Check if Obsidian is installed if [[ "$OSTYPE" == "darwin"* ]]; then if [ ! -d "/Applications/Obsidian.app" ]; then echo "โš ๏ธ Obsidian not found in /Applications. Please install from https://obsidian.md/" else echo "โœ… Obsidian found" fi fi # Prompt for MCP server path echo "" echo "๐Ÿ“ MCP Server Configuration" echo "----------------------------" read -p "Enter the absolute path to Obsidian-MCP directory: " MCP_PATH # Validate MCP path if [ ! -f "$MCP_PATH/index.js" ]; then echo "โŒ Cannot find index.js in $MCP_PATH" echo "Please ensure you've cloned the Obsidian MCP server:" echo " git clone https://github.com/Kynlos/Obsidian-MCP.git" echo " cd Obsidian-MCP" echo " npm install" exit 1 fi # Prompt for vault path echo "" echo "๐Ÿ“ Vault Configuration" echo "----------------------" read -p "Enter the absolute path to your Obsidian vault: " VAULT_PATH # Validate path if [ ! -d "$VAULT_PATH" ]; then echo "โŒ Vault path does not exist: $VAULT_PATH" read -p "Create this directory? (y/n): " CREATE_DIR if [ "$CREATE_DIR" = "y" ]; then mkdir -p "$VAULT_PATH" echo "โœ… Created vault directory" else echo "โŒ Setup cancelled" exit 1 fi fi # Create .env file echo "" echo "โš™๏ธ Creating configuration..." cat > .env << EOF # Obsidian MCP Configuration OBSIDIAN_VAULT_PATH=$VAULT_PATH OBSIDIAN_DEBUG=false EOF echo "โœ… Created .env file" # Determine Amp config directory if [[ "$OSTYPE" == "darwin"* ]]; then AMP_CONFIG_DIR="$HOME/.config/amp" else AMP_CONFIG_DIR="$HOME/.config/amp" fi # Create Amp config directory mkdir -p "$AMP_CONFIG_DIR" # Create MCP config with absolute path cat > "$AMP_CONFIG_DIR/mcp-config.json" << EOF { "mcpServers": { "obsidian": { "command": "node", "args": [ "$MCP_PATH/index.js" ], "env": { "OBSIDIAN_VAULT_PATH": "$VAULT_PATH" } } } } EOF echo "โœ… Created Amp MCP configuration at $AMP_CONFIG_DIR/mcp-config.json" # Test the configuration echo "" echo "๐Ÿงช Testing configuration..." if [ -f "$MCP_PATH/index.js" ]; then echo "โœ… Obsidian MCP server found and configured" else echo "โš ๏ธ Warning: MCP server file not found at expected location" fi # Success! echo "" echo "โœ… Setup Complete!" echo "==================" echo "" echo "Next steps:" echo "1. Restart Amp" echo "2. Test with: 'List my Obsidian vaults'" echo "3. Create a note: 'Create a note in Obsidian called Test'" echo "" echo "๐Ÿ“š Read the documentation:" echo " - README.md - Full setup guide" echo " - EXAMPLES.md - Usage examples" echo "" echo "Configuration saved to:" echo " - $AMP_CONFIG_DIR/mcp-config.json" echo " - .env (in current directory)" echo "" echo "Happy note-taking! ๐ŸŽ‰"

Latest Blog Posts

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/Kynlos/Obsidian-MCP'

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