-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
44 lines (35 loc) Β· 1.26 KB
/
start.sh
File metadata and controls
44 lines (35 loc) Β· 1.26 KB
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
39
40
41
42
43
44
#!/bin/bash
# Railway startup script for AGS SPARQL Agent MCP Server (Streamable HTTP)
set -e
echo "π Starting AGS SPARQL Agent MCP Server (Streamable HTTP)"
echo "π Environment:"
echo " PORT: ${PORT:-8000}"
echo " HOST: ${HOST:-0.0.0.0}"
echo " PWD: $(pwd)"
echo " Python version: $(python --version)"
# Check if required environment variables are set
if [ -z "$ANZO_SERVER" ]; then
echo "β οΈ Warning: ANZO_SERVER not set"
fi
if [ -z "$ANZO_USERNAME" ]; then
echo "β οΈ Warning: ANZO_USERNAME not set"
fi
if [ -z "$GRAPHMART_URI" ]; then
echo "β οΈ Warning: GRAPHMART_URI not set"
fi
# List files to debug
echo "π Directory contents:"
ls -la
echo "π src directory:"
ls -la src/
# Check Python packages
echo "π¦ Checking key packages:"
python -c "import mcp; print('MCP version:', mcp.__version__)" || echo "β MCP not found"
python -c "import asyncio; print('β
asyncio available')" || echo "β asyncio not found"
echo "π Starting Streamable HTTP server..."
echo "π MCP endpoint will be: http://${HOST:-0.0.0.0}:${PORT:-8000}/mcp"
# Start the server with explicit error handling
python src/ags_sparql_agent_server.py --host ${HOST:-0.0.0.0} --port ${PORT:-8000} || {
echo "β Server failed to start, exit code: $?"
exit 1
}