#!/usr/bin/env bash # # Registers the External MCP proxy with Claude Desktop. # # ./install.sh install, or update an existing entry # ./install.sh --dry-run show what would change, write nothing # ./install.sh --name staffngo-staging --config ./config.staging.yml # # This only locates node and hands over to install.mjs, which holds the logic — the same one the # PowerShell script uses, rather than a second implementation that would drift from it. set -euo pipefail here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" node_path="${NODE_PATH_OVERRIDE:-}" if [ -z "$node_path" ]; then if ! node_path="$(command -v node)"; then echo " ERROR node was not found on PATH. Install Node.js, or set NODE_PATH_OVERRIDE." >&2 exit 1 fi fi # Resolve to the real executable: the path is recorded in Claude's configuration, and Claude Desktop # starts the process itself, outside any shell that would resolve a symlink or an alias. if command -v readlink >/dev/null 2>&1; then node_path="$(readlink -f "$node_path" 2>/dev/null || echo "$node_path")" fi exec "$node_path" "$here/install.mjs" --node "$node_path" "$@"