Synology Docker MCP Server
Manage Docker containers and Docker Compose projects on a Synology NAS via SSH, with auto-privilege escalation and no direct Docker TCP exposure.
List containers (
synology_docker_ps): View all running Docker containers.View logs (
synology_docker_logs): Retrieve logs for a specific container, with configurable tail line count.Manage container lifecycle (
synology_docker_manage): Start, stop, restart, or remove individual containers.List Compose projects (
synology_project_list): Discover all Docker Compose projects in the configured Docker directory (/volume1/docker).Manage Compose projects (
synology_project_manage): Pull images, bring projects up, take them down, or restart them — fully compatible with Synology Container Manager.Read configuration files (
synology_read_file): Read files (e.g.,.env,docker-compose.yml), restricted to/volume1/docker.Write configuration files (
synology_write_file): Create or update configuration files, also restricted to/volume1/docker.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Synology Docker MCP Serverlist all running containers on my Synology"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Synology Docker MCP Server
(Scroll down for English version / 英文版本在下方)
🇨🇳 中文说明 (Chinese Version)
这是一个专门为群晖 (Synology NAS) 设计的 Model Context Protocol (MCP) 服务器。它旨在通过大语言模型直接管理、配置和调试群晖 Container Manager 中的 Docker 容器和 Docker Compose 项目。
✨ 核心功能与亮点
基于 SSH 的安全管理: 直接通过 SSH 与您的群晖 NAS 进行通信,安全执行原生命令,彻底免除对外暴露 Docker TCP 接口的风险。
自动提权系统 (Auto-Privilege Escalation): 自动注入凭证静默执行
sudo,完美解决群晖管理员账号在执行 docker 时常见的Permission Denied权限壁垒。群晖 Container Manager 完美兼容: 原生支持并强制使用
docker-compose -p标签,确保通过此 MCP 服务器启动或更新的项目能够与群晖自带网页端的项目界面完美同步(维持绿点健康状态)。全方位工具集:
synology_docker_ps: 查看所有运行中的容器。synology_docker_logs: 获取并追踪容器日志。synology_docker_manage: 控制容器的启动、停止、重启或移除。synology_project_list: 自动搜索并发现/volume1/docker/目录下的所有项目。synology_project_manage: 原生执行项目的 Pull、Up、Down 或 Restart 指令。synology_read_file/synology_write_file: 远程读取或修改.env与docker-compose.yml配置文件。
🔒 安全加固记录 (v1.1.0)
漏洞 | 修复方案 |
密码特殊字符展开( |
|
命令注入(容器名/项目名/路径拼接) | 所有用户输入经 |
action 参数未验证 | 代码层白名单校验,独立于 schema enum |
路径遍历( |
|
| 强制正整数,上限 10000,默认 100 |
SSH 连接无超时 | 添加 |
🚀 快速上手 (面向终端用户)
开启群晖 SSH 服务: 前往 控制面板 -> 终端机和 SNMP 并勾选 启动 SSH 功能。
接入 MCP 客户端 (例如 Claude Desktop 或 Cursor): 您不需要克隆代码或安装任何东西。只需将以下内容添加到客户端的 MCP 配置文件 JSON 中,客户端会自动通过
npx帮您拉取并运行最新版代码:{ "mcpServers": { "synology-docker": { "command": "npx", "args": [ "-y", "synology-docker-mcp" ], "env": { "NAS_HOST": "192.168.1.xxx", "NAS_PORT": "22", "NAS_USER": "your_admin_account", "NAS_PASSWORD": "your_admin_password", "NAS_DOCKER_DIR": "/volume1/docker" } } } }
🛠️ 本地开发 (面向开发者)
如果您希望修改此项目的源代码:
克隆并配置: 复制项目中的
.env.example并重命名为.env,填入您的 NAS 连接信息。安装依赖并构建:
npm install npm run build测试运行:
npm start
Related MCP server: Docker MCP Server
🇬🇧 English Version
This is a Model Context Protocol (MCP) server specifically designed to manage, configure, and debug Docker containers and Docker Compose projects on Synology NAS devices.
✨ Features & Highlights
SSH-Based Management: Communicates with your Synology NAS directly via SSH, ensuring secure execution of native commands without needing to expose the Docker TCP socket.
Auto-Privilege Escalation: Automatically injects credentials to run
sudosilently, bypassing thePermission Deniedissues commonly faced by Synology administrator accounts.Synology Container Manager Compatibility: Native support for
docker-compose -p, ensuring that projects started or updated via this MCP server perfectly align with the Synology Container Manager GUI (maintaining the green status indicator).Comprehensive Toolset:
synology_docker_ps: View all running containers.synology_docker_logs: Stream container logs.synology_docker_manage: Start, stop, restart, or remove containers.synology_project_list: Discover projects mapped in/volume1/docker/.synology_project_manage: Pull, up, down, or restart Docker Compose projects natively.synology_read_file/synology_write_file: Edit.envanddocker-compose.ymlconfigurations remotely.
🔒 Security Hardening (v1.1.0)
Vulnerability | Fix |
Password shell expansion ( | Replaced |
Command injection (container/project name/path concatenation) | All user inputs wrapped with |
Unvalidated | Code-level whitelist enforced independently of schema enum |
Path traversal (e.g. reading |
|
| Enforced positive integer, capped at 10000, defaults to 100 |
SSH connection hangs indefinitely | Added |
🚀 Setup Instructions
Enable SSH on Synology NAS: Go to Control Panel -> Terminal & SNMP and check Enable SSH service.
Configure Credentials: Copy
.env.exampleto.envand fill in your NAS connection details:NAS_HOST=192.168.1.xxx NAS_PORT=22 NAS_USER=your_admin_account NAS_PASSWORD=your_admin_password NAS_DOCKER_DIR=/volume1/dockerInstall Dependencies & Build:
npm install npm run buildConnect to MCP Client (e.g. Claude Desktop / Cursor): While you can use a local
nodepath if built locally, the highly recommended method is to usenpx(which pulls directly from npm, requiring no local cloning). Add the following to your MCP configuration JSON:{ "mcpServers": { "synology-docker": { "command": "npx", "args": [ "-y", "synology-docker-mcp" ], "env": { "NAS_HOST": "192.168.1.xxx", "NAS_PORT": "22", "NAS_USER": "your_admin_account", "NAS_PASSWORD": "your_admin_password", "NAS_DOCKER_DIR": "/volume1/docker" } } } }
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/hifishhe/Synology-Docker-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server