-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_http.sh
More file actions
45 lines (36 loc) Β· 1.3 KB
/
start_http.sh
File metadata and controls
45 lines (36 loc) Β· 1.3 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
45
#!/bin/bash
# Startup script for AGS SPARQL Agent MCP Server - Streamable HTTP Transport
set -e
echo "π Starting AGS SPARQL Agent MCP Server (Streamable HTTP Transport)"
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: http://${HOST:-0.0.0.0}:${PORT:-8000}/mcp"
echo "π‘ Connect using POST /mcp for requests"
# Start the Streamable HTTP server
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
}