blob: b367cc0e0139b726d7cb57374c07441d9324b073 (
plain)
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
|
#!/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"
|