#!/bin/sh set -e BINARY_URL="https://slashnote.app/bin/slashnote-mcp" INSTALL_DIR="$HOME/.slashnote/bin" BINARY_PATH="$INSTALL_DIR/slashnote-mcp" CLAUDE_CONFIG_DIR="$HOME/Library/Application Support/Claude" CLAUDE_CONFIG="$CLAUDE_CONFIG_DIR/claude_desktop_config.json" echo "Installing slashnote-mcp..." # Create install directory mkdir -p "$INSTALL_DIR" # Download binary curl -fsSL "$BINARY_URL" -o "$BINARY_PATH" chmod +x "$BINARY_PATH" echo "Binary installed: $BINARY_PATH" # Configure Claude Desktop mkdir -p "$CLAUDE_CONFIG_DIR" if [ -f "$CLAUDE_CONFIG" ]; then # Check if slashnote is already configured if grep -q '"slashnote"' "$CLAUDE_CONFIG" 2>/dev/null; then echo "Claude Desktop already configured for SlashNote MCP." echo "Restart Claude Desktop to use the updated binary." echo "Done!" exit 0 fi # Add slashnote to existing config using python3 python3 << 'PYEOF' import json, os config_path = os.path.expanduser("~/Library/Application Support/Claude/claude_desktop_config.json") binary_path = os.path.join(os.path.expanduser("~"), ".slashnote", "bin", "slashnote-mcp") with open(config_path, "r") as f: config = json.load(f) if "mcpServers" not in config: config["mcpServers"] = {} config["mcpServers"]["slashnote"] = { "command": binary_path } with open(config_path, "w") as f: json.dump(config, f, indent=2) f.write("\n") PYEOF else # Create new config cat > "$CLAUDE_CONFIG" << EOF { "mcpServers": { "slashnote": { "command": "$BINARY_PATH" } } } EOF fi echo "Claude Desktop configured." echo "" echo "Restart Claude Desktop to activate SlashNote MCP." echo "Done!"