| 123456789101112131415161718192021222324252627282930313233 |
- #!/usr/bin/env bash
- # 小智AI MCP Server 启动脚本(macOS/Linux)
- set -e
- cd "$(dirname "$0")"
- if [ ! -f .env ]; then
- echo "⚠️ 未发现 .env,已复制 .env.example 为 .env,请填入 MCP_ENDPOINT 后再启动"
- cp .env.example .env
- fi
- # 加载 .env
- set -a
- # shellcheck disable=SC1091
- source .env
- set +a
- if [ -z "${MCP_ENDPOINT:-}" ] || [[ "$MCP_ENDPOINT" == *"your_token_here"* ]]; then
- echo "❌ 请先在 .env 中填入真实的 MCP_ENDPOINT"
- exit 1
- fi
- # 安装依赖(首次)
- if [ ! -d .venv ]; then
- echo "🔧 创建虚拟环境并安装依赖..."
- python3 -m venv .venv
- .venv/bin/pip install -r requirements.txt
- fi
- # shellcheck disable=SC1091
- source .venv/bin/activate
- echo "🚀 启动 MCP Server,桥接到小智AI..."
- exec python mcp_pipe.py audio_server.py
|