支持平台

目前支持以下平台的二进制部署:

Linux AMD64

适用于 x86_64 架构的 Linux 系统

Linux ARM64

适用于 ARM64 架构的 Linux 系统

您可以在 GitHub Releases 查看和下载最新的二进制文件。

部署步骤

1

创建目录并下载配置

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
2

调整 PID 文件路径(macOS 用户)

在 macOS 下,/var/run/mcp-gateway.pid 可能没有写入权限,需要调整路径。

sed -i 's|/var/run/mcp-gateway.pid|./data/mcp-gateway.pid|g' .env
3

下载二进制文件

根据您的系统架构选择合适的二进制文件:

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
4

启动服务

./mcp-gateway

配置说明

环境变量文件

下载的 .env 文件包含了所有必要的配置项。主要配置包括:

配置文件

  • 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: 管理端口(仅内部访问)

如需 Web 管理界面,建议同时部署 API Server 和 Web 前端,或使用 All-in-One Docker 部署方式。