#!/bin/sh
# Public checks only. No key, authenticated tool, generation or account write.
set -eu
health=$(curl --silent --show-error --max-time 30 --output /dev/null --write-out '%{http_code}' https://mcp.usenativ.com/health)
guard=$(curl --silent --show-error --max-time 30 --output /dev/null --write-out '%{http_code}' https://mcp.usenativ.com/mcp)
printf 'Public health: HTTP %s (expected 200)\n' "$health"
printf 'MCP without credentials: HTTP %s (expected 401)\n' "$guard"
if [ "$health" != 200 ] || [ "$guard" != 401 ]; then
  printf 'Public preflight differs from expectations. Stop and investigate.\n' >&2
  exit 1
fi
printf 'Public preflight passed. Account authentication and MCP tool calls remain untested.\n'
