Fleet
fleet
Docker 生产管理 CLI + MCP 服务器
在单台服务器上管理 Docker Compose 应用 —— 提供 systemd 编排、nginx 路由、age 加密密钥、健康监控、依赖跟踪、Git 工作流以及用于 AI 辅助运维的 MCP 服务器。
架构
graph TD
CLI["fleet CLI"]
TUI["TUI Dashboard"]
MCP["MCP Server"]
BOT["fleet-bot (Go)"]
CLI --> Core
TUI --> Core
MCP --> Core
BOT -->|"via MCP"| Core
subgraph Core["Core Modules"]
Registry["Registry"]
Docker["Docker Compose"]
Systemd["systemd"]
Nginx["nginx"]
Secrets["Secrets Vault"]
Health["Health Checks"]
Git["Git / GitHub"]
Deps["Dependency Monitor"]
end
Docker --> Containers["Containers"]
Systemd --> Services["systemd Services"]
Nginx --> Proxy["Reverse Proxy"]
Secrets --> Vault["vault/*.age"]
Secrets --> Runtime["/run/fleet-secrets"]
Health --> Alerts["Telegram / iMessage"]每个 Docker Compose 应用都通过其 compose 路径、域名、端口和容器名称进行注册。Fleet 会生成 systemd 单元,确保应用在开机时按正确顺序启动。密钥在静态存储时使用 age 进行加密,并在启动时解密到 tmpfs 中。
Related MCP server: coolify-mcp
安装
npm install -g @matthesketh/fleet需要 Node.js 20+、Docker Compose v2、systemd、nginx 和 age。详情请参阅完整安装指南。
核心功能
部署与管理应用 -- fleet deploy <app-dir> 可一键注册、构建并启动应用。使用 start、stop、restart 和 logs 控制服务。
加密密钥 -- 基于 age 加密的保险库,支持自动备份、预密封验证、漂移检测和原子回滚。启动时解密至 tmpfs —— 密钥从不触碰磁盘。
Nginx 路由 -- 使用 fleet nginx add 生成代理、SPA 或 Next.js 服务器块。支持自动配置测试和重载。
健康监控 -- 通过 fleet health 提供三层检查(systemd + 容器 + HTTP)。watchdog 命令以 cron 方式运行,并在失败时发送警报。
依赖扫描 -- 检测所有已注册应用中过期的包、CVE(通过 OSV)、Docker 镜像更新以及运行时 EOL。
Git 工作流 -- 将应用接入 GitHub,通过 CLI 管理分支、PR 和发布。
交互式仪表盘 -- 直接运行 fleet 即可启动带有实时状态的全屏 TUI。
查看 CLI 参考 获取完整命令列表。
密钥流程
graph LR
Import["fleet secrets import"]
Set["fleet secrets set"]
Import --> Encrypt["age encrypt"]
Set --> Encrypt
Encrypt --> Vault["vault/*.age"]
Vault -->|"boot / fleet secrets unseal"| Decrypt["age decrypt"]
Decrypt --> Runtime["/run/fleet-secrets (tmpfs)"]
Runtime -->|"env_file / secrets"| Containers["Docker Containers"]
Runtime -->|"fleet secrets seal"| Encrypt
Vault -.->|"drift detection"| Runtime密钥可导入或单独设置,使用 age 加密并存储在保险库中。在启动时(或手动触发),它们会被解密到 Docker 容器引用的 tmpfs 挂载点。密封操作会将运行时更改写回保险库。漂移检测会对比保险库与运行时状态,以捕获未保存的更改。
部署流程
graph TD
Deploy["fleet deploy app-dir"]
Deploy --> Register{"Already\nregistered?"}
Register -->|No| Add["Register app"]
Register -->|Yes| Build
Add --> Build["docker compose build"]
Build --> Start{"Service\nrunning?"}
Start -->|No| StartSvc["systemctl start"]
Start -->|Yes| Restart["systemctl restart"]
StartSvc --> Healthy["App deployed"]
Restart --> HealthyMCP 服务器
Fleet 通过 Model Context Protocol 暴露了 36 个工具,用于 AI 辅助的服务器管理。运行 fleet mcp 启动 stdio 服务器,或将其安装到 Claude Code 中:
sudo fleet install-mcp工具涵盖了全方位功能:应用生命周期、密钥、nginx、Git、健康检查和依赖监控。查看 MCP 文档 获取完整工具列表。
fleet-bot
一个 Go 语言编写的配套机器人 (bot/),提供通过 Telegram 或 iMessage 进行的远程服务器管理。它运行 Claude Code 会话,并可访问 fleet 的 MCP 工具以实现免提操作。
查看 机器人文档 获取设置说明。
开发
git clone https://github.com/wrxck/fleet.git
cd fleet
npm install
npm test # vitest
npm run build # compile TypeScript to dist/
npm run dev # run with tsx (no build needed)许可证
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Build, deploy, and host full-stack web apps from any MCP client. DB, auth, storage, cron included.
Create, deploy, and operate MCP servers directly from your GitHub repositories.
Deploy full-stack apps with databases, storage, backups, logs, scaling, and rollback. 74 MCP tools.
Hosting for AI agents: your AI client deploys Docker apps to live HTTPS URLs over MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA comprehensive MCP server that provides advanced Docker operations through a unified interface with 16 MCP tools and 25+ CLI aliases, enabling secure container lifecycle management, multi-container orchestration, registry publishing, and system maintenance.75 npm15ISC
- AlicenseAqualityBmaintenanceMCP server for managing a self-hosted Coolify instance. Provides full REST CRUD, deploy/watch capabilities, and an optional host-ops tier for live log streaming, SSH, Docker, and database access.228 npmMIT
- AlicenseBqualityDmaintenanceAn AI-powered MCP server for managing Docker infrastructure, enabling creation, deployment, and lifecycle management of containerized services with automated DNS and SSL.10MIT
- AlicenseCqualityDmaintenanceA production-ready MCP server providing comprehensive DevOps capabilities for the Internet Computer blockchain, enabling AI agents to authenticate, manage canisters, handle finances, and build/deploy projects.36MIT