mcp-voice-agent / scripts /start_server.sh
AdarshRajDS
feat: intial mcp voice agent
cf30ded
#!/usr/bin/env bash
# ─────────────────────────────────────────────────────────────────────────────
# scripts/start_server.sh
#
# Starts the MCP search server after ensuring:
# 1. .env file exists
# 2. uv environment is synced
# 3. Documents are indexed
#
# Usage:
# chmod +x scripts/start_server.sh
# ./scripts/start_server.sh
# ─────────────────────────────────────────────────────────────────────────────
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT_DIR"
# ── Check .env ────────────────────────────────────────────────────────────────
if [ ! -f ".env" ]; then
echo "❌ .env file not found."
echo " Copy the template and fill in your values:"
echo " cp .env.example .env"
exit 1
fi
# ── Sync uv deps ──────────────────────────────────────────────────────────────
echo "πŸ“¦ Syncing dependencies with uv..."
uv sync
# ── Index documents ───────────────────────────────────────────────────────────
echo "πŸ“š Indexing documents..."
uv run index-docs
# ── Start server ──────────────────────────────────────────────────────────────
echo "πŸš€ Starting MCP server..."
uv run mcp-server