-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_mcp.sh
More file actions
47 lines (42 loc) · 1.42 KB
/
Copy pathstart_mcp.sh
File metadata and controls
47 lines (42 loc) · 1.42 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
#!/usr/bin/env bash
# ============================================================
# ConvergeLoop MCP Server Launcher (Linux/macOS)
#
# Usage in MCP config JSON:
# {
# "mcpServers": {
# "convergeloop": {
# "command": "/path/to/ConvergeLoop/start_mcp.sh"
# }
# }
# }
#
# This script:
# 1. Locates project root (this script's directory)
# 2. Sets PYTHONPATH / PYTHONIOENCODING
# 3. Launches ConvergeLoop MCP Server
# ============================================================
set -euo pipefail
# --- 1. Locate project root (this script's directory) ---
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# --- 2. Detect Python interpreter ---
PYTHON_CMD=""
if [ -x "$PROJECT_ROOT/.venv/bin/python" ]; then
PYTHON_CMD="$PROJECT_ROOT/.venv/bin/python"
elif command -v python3 >/dev/null 2>&1; then
PYTHON_CMD="python3"
elif command -v python >/dev/null 2>&1; then
PYTHON_CMD="python"
else
echo "[ConvergeLoop] Error: Python interpreter not found." >&2
echo "Please install Python 3.10+ and add it to PATH, or create a .venv in project root." >&2
exit 1
fi
# --- 3. Set environment variables ---
export PYTHONPATH="$PROJECT_ROOT"
export PYTHONIOENCODING=utf-8
export PYTHONUTF8=1
# Switch to project root (so config files with relative paths can be found)
cd "$PROJECT_ROOT"
# --- 4. Launch ConvergeLoop MCP Server ---
exec "$PYTHON_CMD" -m convergeloop.mcp_server