#!/bin/sh # Nexivo MCP, installed and set up in one line, on a Mac (or Linux): # # curl -fsSL https://nexivo-link.pages.dev/ai/install.sh | sh # # It downloads nexivo-mcp-.tgz from this site, checks its SHA-256, # and installs it in ~/.nexivo-mcp/app/ with an npm cache of its # own. So it needs no admin password, and nothing from npm's global folder # or ~/.npm: either can belong to root on a Mac where `sudo npm` ever ran, # and then `npm install -g` fails with EACCES. Then it adds Nexivo MCP to # Claude Code and Claude Desktop, asking nothing: the computer, its password # and the Premium key are given to Claude in the chat. # # Run it again to update Nexivo MCP. To save a computer here instead of # giving its password in a chat: ... | sh -s setup set -eu VERSION="1.1.1" SHA256="b5ef9a9c2dfe5afc070a9e683818a8e7f3548c4cc9e90109450f05dd343a9eba" BASE="${NEXIVO_MCP_BASE:-https://nexivo-link.pages.dev/ai}" DIR="$HOME/.nexivo-mcp" APP="$DIR/app/$VERSION" BIN="$APP/node_modules/nexivo-mcp/bin/nexivo-mcp.mjs" say() { printf '%s\n' "$*"; } fail() { printf 'Nexivo MCP: %s\n' "$*" >&2 exit 1 } command -v node >/dev/null 2>&1 || fail "Node.js 20.11 or later is needed. On a Mac: brew install node ffmpeg (https://brew.sh), then run this again." node -e 'const [a, b] = process.versions.node.split(".").map(Number); process.exit(a > 20 || (a === 20 && b >= 11) ? 0 : 1)' || fail "Node.js $(node -v) is too old: 20.11 or later is needed. On a Mac: brew upgrade node, then run this again." command -v npm >/dev/null 2>&1 || fail "npm was not found beside Node.js. Reinstall Node.js (brew install node), then run this again." if ! command -v ffmpeg >/dev/null 2>&1 && [ ! -x /opt/homebrew/bin/ffmpeg ] && [ ! -x /usr/local/bin/ffmpeg ]; then say "Note: ffmpeg was not found, and Nexivo MCP needs it to see the screen. On a Mac: brew install ffmpeg" fi # Only this user reads what is in ~/.nexivo-mcp: it also holds the passwords. umask 077 if [ -f "$BIN" ]; then say "Nexivo MCP $VERSION is already installed." else rm -rf "$APP" mkdir -p "$APP" TGZ="$APP/nexivo-mcp-$VERSION.tgz" say "Downloading Nexivo MCP $VERSION..." curl -fsSL "$BASE/nexivo-mcp-$VERSION.tgz" -o "$TGZ" || fail "the download failed. Check this computer is online, then run this again." if command -v shasum >/dev/null 2>&1; then GOT=$(shasum -a 256 "$TGZ" | cut -d ' ' -f 1) else GOT=$(sha256sum "$TGZ" | cut -d ' ' -f 1) fi if [ "$GOT" != "$SHA256" ]; then rm -rf "$APP" fail "the download is not the file it should be (its SHA-256 is $GOT). Run this again; if it says this again, tell Nexivo." fi say "Installing..." npm install --prefix "$APP" --cache "$DIR/npm-cache" --no-audit --no-fund --update-notifier=false --loglevel=error "$TGZ" >/dev/null || fail "npm could not install it (its messages are above). Run this again; if it says this again, tell Nexivo." [ -f "$BIN" ] || fail "the install did not leave $BIN." # Older versions: Claude is moved to this one by setup, below. for old in "$DIR"/app/*; do [ "$old" = "$APP" ] || rm -rf "$old" done say "Installed in $APP." fi say "" if [ "${1:-}" = "setup" ]; then # Under `curl | sh` the keyboard is not stdin (the script is), so setup reads /dev/tty. if (exec < /dev/tty) 2>/dev/null; then exec node "$BIN" setup < /dev/tty fi fail "setup asks questions: run it in Terminal: node \"$BIN\" setup" fi exec node "$BIN" register