summaryrefslogtreecommitdiff
path: root/setup_mcp.sh
diff options
context:
space:
mode:
Diffstat (limited to 'setup_mcp.sh')
-rwxr-xr-xsetup_mcp.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/setup_mcp.sh b/setup_mcp.sh
new file mode 100755
index 0000000..b367cc0
--- /dev/null
+++ b/setup_mcp.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+# 在私人服务器上配置调度端 MCP server
+set -euo pipefail
+cd "$(dirname "$0")"
+
+if [ ! -f .env ]; then
+ echo "请先配置 .env 文件: cp .env.example .env && vim .env"
+ exit 1
+fi
+
+set -a; source .env; set +a
+
+echo "[Setup] 安装 Python 依赖..."
+pip install -r requirements.txt
+
+echo "[Setup] 注册 dispatcher MCP server..."
+claude mcp add --transport stdio \
+ --env "API_SECRET=$API_SECRET" \
+ --env "BROKER_URL=${BROKER_URL:-http://127.0.0.1:8000}" \
+ dispatcher -- python3 "$(pwd)/mcp_dispatcher.py"
+
+echo "[Setup] 完成! MCP tools:"
+claude mcp list
+echo ""
+echo "接下来:"
+echo " 1. 启动 broker: ./start_broker.sh"
+echo " 2. 启动 dispatcher: ./start_dispatcher.sh"