#!/bin/sh # Cloud for Bots installer: checks your key, then adds the MCP server to Claude Code. # Usage: curl -fsSL https://cloudforbots.com/install.sh | sh -s -- YOUR_KEY set -e KEY="${1:-$CFB_KEY}" URL="https://cloudforbots.com/mcp" if [ -z "$KEY" ]; then echo "Usage: curl -fsSL https://cloudforbots.com/install.sh | sh -s -- YOUR_KEY"; echo "Get a free key: https://cloudforbots.com/#free"; exit 1; fi case "$KEY" in mb_*) ;; *) echo "That does not look like a Cloud for Bots key (they start with mb_)."; exit 1;; esac command -v curl >/dev/null 2>&1 || { echo "curl is required."; exit 1; } echo "Checking your key..." OUT=$(curl -fsS -m 20 "$URL" -H "Authorization: Bearer $KEY" -H "content-type: application/json" -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' || true) case "$OUT" in *'"sandbox"'*) echo "Key works.";; *) echo "Could not reach Cloud for Bots with that key. Check it and try again."; exit 1;; esac if command -v claude >/dev/null 2>&1; then claude mcp remove --scope user cloud-for-bots >/dev/null 2>&1 || true claude mcp add --scope user --transport http cloud-for-bots "$URL" --header "Authorization: Bearer $KEY" >/dev/null echo "Added to Claude Code (all projects). Check with: claude mcp list" echo "Next: open Claude Code and paste the first-win prompt from https://cloudforbots.com/start" else echo "Claude Code was not found, so nothing was installed." echo "For other apps, copy the config for your app at https://cloudforbots.com/#free" fi