#!/bin/sh # FastMesh Universal SDK & MCP Superbus Installer (https://sdk.fastmesh.dev) # Version: 1.0.0 # Connects MCP-compatible coding editors, terminals, and autonomous AI agents # to 46+ deterministic *.fastmesh.dev engines (<2.5 KB MCP tool surface). # Privacy: Strict Zero Data Resale. Security: Never writes secret files. # Support: support@fastmesh.dev set -eu FASTMESH_MCP_URL="${FASTMESH_MCP_URL:-https://mcp.fastmesh.dev/mcp}" FASTMESH_PAY_URL="${FASTMESH_PAY_URL:-https://pay.fastmesh.dev}" FASTMESH_MAX_COST_MICROS="${FASTMESH_MAX_COST_MICROS:-100000}" MODE="auto" usage() { cat <<'EOF' FastMesh Universal SDK Installer (sdk.fastmesh.dev) Usage: curl -fsSL https://sdk.fastmesh.dev/install.sh | sh curl -fsSL https://sdk.fastmesh.dev/install.sh | sh -s -- --print-config curl -fsSL https://sdk.fastmesh.dev/install.sh | sh -s -- --check Options: --print-config Print portable MCP client JSON configuration and exit --check Detect local runtimes (npx, uvx, python3) without launching --launch Start the stdio MCP server immediately using detected runtime --help Show this help text Environment variables (optional): FASTMESH_API_KEY Optional prepaid bearer key (never printed) FASTMESH_MCP_URL Superbus MCP URL (default: https://mcp.fastmesh.dev/mcp) FASTMESH_MAX_COST_MICROS Hard per-call budget cap in micro-USD (default: 100000) EOF } while [ "$#" -gt 0 ]; do case "$1" in --print-config) MODE="config" ;; --check) MODE="check" ;; --launch) MODE="launch" ;; --help|-h) usage; exit 0 ;; *) printf 'Unknown option: %s\n' "$1" >&2; usage >&2; exit 2 ;; esac shift done DETECTED="none" if command -v npx >/dev/null 2>&1; then DETECTED="npx" elif command -v uvx >/dev/null 2>&1; then DETECTED="uvx" elif command -v python3 >/dev/null 2>&1; then DETECTED="python3" fi print_config() { case "$DETECTED" in npx) cat <&2 exit 1 ;; esac fi printf '\nPaste this MCP configuration into your coding editor or agent runtime:\n\n' print_config printf '\nQuickstart commands:\n' printf ' Node.js : npx -y fastmesh-mcp search verify\n' printf ' Python : uvx fastmesh-mcp search verify\n' printf ' Top-up : %s\n' "$FASTMESH_PAY_URL"