From 8ebc6c53077a4826109f2ceb4c5625efe6b6522e Mon Sep 17 00:00:00 2001 From: haoyuren <13851610112@163.com> Date: Tue, 31 Mar 2026 23:27:05 -0500 Subject: Claude Bridge Server - broker, dispatcher, multi-user support --- setup_mcp.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 setup_mcp.sh (limited to 'setup_mcp.sh') 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" -- cgit v1.2.3