支持平台
目前支持以下平台的二进制部署:
您可以在 GitHub Releases 查看和下载最新的二进制文件。
部署步骤
创建目录并下载配置
mkdir -p unla/{configs,data}
cd unla/
curl -sL https://raw.githubusercontent.com/amoylab/unla/refs/heads/main/configs/apiserver.yaml -o configs/apiserver.yaml
curl -sL https://raw.githubusercontent.com/amoylab/unla/refs/heads/main/configs/mcp-gateway.yaml -o configs/mcp-gateway.yaml
curl -sL https://raw.githubusercontent.com/amoylab/unla/refs/heads/main/.env.example -o .env
调整 PID 文件路径(macOS 用户)
在 macOS 下,/var/run/mcp-gateway.pid
可能没有写入权限,需要调整路径。
sed -i 's|/var/run/mcp-gateway.pid|./data/mcp-gateway.pid|g' .env
下载二进制文件
根据您的系统架构选择合适的二进制文件:
Linux AMD64:
LATEST_VERSION=$(curl -s https://api.github.com/repos/amoylab/unla/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
curl -sL "https://github.com/amoylab/unla/releases/download/${LATEST_VERSION}/mcp-gateway-linux-amd64" -o mcp-gateway
chmod +x mcp-gateway
Linux ARM64:
LATEST_VERSION=$(curl -s https://api.github.com/repos/amoylab/unla/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
curl -sL "https://github.com/amoylab/unla/releases/download/${LATEST_VERSION}/mcp-gateway-linux-arm64" -o mcp-gateway
chmod +x mcp-gateway
配置说明
环境变量文件
下载的 .env
文件包含了所有必要的配置项。主要配置包括:
配置用于配置更新通知的方式(signal、api、redis 等)
配置文件
configs/apiserver.yaml
: API 服务器配置
configs/mcp-gateway.yaml
: MCP Gateway 核心配置
详细的配置说明请参考配置文档。
注意事项
二进制部署方式需要您自行管理服务的启动、停止和监控。建议在生产环境中使用进程管理工具如 systemd 或 supervisor。
systemd 服务配置示例
您可以创建 systemd 服务文件来管理 MCP Gateway:
[Unit]
Description=MCP Gateway
After=network.target
[Service]
Type=simple
User=mcpgateway
WorkingDirectory=/opt/unla
ExecStart=/opt/unla/mcp-gateway
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
将此文件保存为 /etc/systemd/system/mcp-gateway.service
,然后:
sudo systemctl daemon-reload
sudo systemctl enable mcp-gateway
sudo systemctl start mcp-gateway
防火墙配置
确保以下端口可访问:
5235
: MCP Gateway 主要服务端口
5335
: 管理端口(仅内部访问)
Responses are generated using AI and may contain mistakes.