-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathrun_mcp_sse.sh
More file actions
executable file
·60 lines (50 loc) · 2 KB
/
run_mcp_sse.sh
File metadata and controls
executable file
·60 lines (50 loc) · 2 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
# Exit on error
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
echo -e "${BLUE}╔══════════════════════════════════════════════════════╗${NC}"
echo -e "${BLUE}║ LangConnect MCP SSE Server Launcher ║${NC}"
echo -e "${BLUE}╚══════════════════════════════════════════════════════╝${NC}"
echo ""
# Check if uv is installed
if ! command -v uv &> /dev/null; then
echo -e "${RED}❌ Error: 'uv' is not installed.${NC}"
echo -e "${YELLOW}Please install uv first: https://github.com/astral-sh/uv${NC}"
exit 1
fi
# Check if .env file exists
if [ ! -f ".env" ]; then
echo -e "${RED}❌ Error: .env file not found.${NC}"
echo -e "${YELLOW}Please copy .env.example to .env and configure it.${NC}"
exit 1
fi
# Check if docker is running
if ! docker ps &> /dev/null; then
echo -e "${YELLOW}⚠️ Warning: Docker doesn't seem to be running.${NC}"
echo -e "${YELLOW}Make sure your API server is accessible at the configured URL.${NC}"
echo ""
fi
# Check if API is accessible
API_URL=$(grep "API_BASE_URL" .env | cut -d '=' -f2 | tr -d '"' | tr -d ' ')
if [ -z "$API_URL" ]; then
API_URL="http://localhost:8080"
fi
echo -e "${GREEN}🔍 Checking API server at $API_URL...${NC}"
if curl -s -f "$API_URL/health" > /dev/null 2>&1; then
echo -e "${GREEN}✅ API server is running!${NC}"
else
echo -e "${RED}❌ API server is not accessible at $API_URL${NC}"
echo -e "${YELLOW}Please make sure to run: docker compose up -d${NC}"
exit 1
fi
echo ""
echo -e "${GREEN}🚀 Starting MCP SSE Server...${NC}"
echo -e "${YELLOW}Note: You may need to authenticate with your Supabase credentials.${NC}"
echo ""
# Run the MCP SSE server
uv run python mcpserver/mcp_sse_server.py