File size: 1,988 Bytes
cf30ded
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/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