run.sh 539 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env bash
  2. set -euo pipefail
  3. PORT="${PORT:-8550}"
  4. # Ensure we're running from the project root.
  5. ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  6. cd "$ROOT_DIR"
  7. echo "Starting atlas2-mcp on port ${PORT}..."
  8. mkdir -p logs
  9. LOG_FILE="logs/server.log"
  10. PID_FILE="logs/server.pid"
  11. # Detach (background) and persist PID + logs.
  12. nohup uvicorn app.main:app \
  13. --host 0.0.0.0 \
  14. --port "${PORT}" \
  15. >"${LOG_FILE}" 2>&1 &
  16. echo $! >"${PID_FILE}"
  17. echo "atlas2-mcp started (pid $(cat "${PID_FILE}")), logging to ${LOG_FILE}."