ugnas-mcp
Provides tools for managing Docker on a UGREEN NAS over SSH, including containers (list, inspect, logs, start, stop, restart, remove), images (list, pull, remove), networks (list, inspect, create, remove, connect, disconnect), and Docker Compose operations.
Click on "Deploy 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., "@ugnas-mcpcheck my NAS system status and list running Docker containers"
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.
ugnas-mcp
npx -y ugnas-mcpA generic MCP (Model Context Protocol) server for UGREEN NAS devices running UGOS, talking to the NAS over SSH (with SFTP for file transfers).
Unlike most existing UGREEN NAS integrations, nothing here is hard-coded — no fixed IPs, subnets, usernames, or share names. Every target-specific value comes from your config, so the same server works for anyone's NAS.
What it does
Organized the way a NAS owner actually thinks about daily operations:
Group | Tools | Mutating? |
Connection & system |
| read-only |
Docker |
| start/stop/restart/pull/remove/create/compose are gated |
Files & data |
| thumbnail/mkdir/copy/move/remove/upload/download/sync are gated |
Backup |
| create/restore/schedule are gated |
Networks |
| read-only |
39 tools total. system.pools reports mdadm array + degradation state, LVM volume/logical/physical
volumes, btrfs devices, block devices, and filesystems.
files.find searches a directory tree by name glob and/or extension (returns path, size, modified
time). files.thumbnail renders a preview of an image or a video frame with ffmpeg on the NAS and
downloads it locally — read-only with respect to your NAS data (only a /tmp scratch file is written
and removed), but writing the thumbnail to the local machine is gated: the first call returns a
dry-run plan, and you confirm with the token to write the local file. Requires ffmpeg on the NAS
(present on UGOS by default).
files.list and files.find prefer GNU coreutils flags (ls --time-style=long-iso, find -printf);
when those are unavailable (BusyBox), they fall back to ls -1p and find -exec stat so they keep
working — with size/mtime zeroed out for plain ls where BusyBox can't report them.
files.sync and the rsync fallback
files.sync uses rsync for fast, resumable NAS↔NAS copies, with --delete mirroring and an
rsync --dry-run pre-flight. rsync is not installed on UGOS by default, so:
Default (
fallback: "refuse") — if rsync is missing, the dry-run plan still shows the rsync command but adds anotetelling you how to install rsync (Entware:opkg install rsync) or how to turn on the fallback. Nothing runs until you confirm.Opt in (
fallback: "cp") — the tool instead falls back to a built-incp -acopy. The plan'snoteexplains this, andwarningscall out what the fallback can't do: no--deletemirroring, no rsync--dry-run, andextraArgsare ignored.
So you opt in per call by passing fallback: "cp". Nothing changes unless you ask for it.
Related MCP server: mcp-openmediavault
Safety model — dry-run first, then confirm
Every mutating tool has two phases:
Call without a token → returns a dry-run plan: the exact shell commands it would run, a human summary, any warnings, and a short-lived
confirmationToken.Call again with
confirmToken→ the token is validated (action-bound, single-use, expires in 10 minutes) and the exact commands captured at plan time are executed.
Read-only tools never need a token. This makes "copy my data", "pull this image", or "restart that container" reviewable before anything changes.
All user-supplied values (paths, container names, image tags) are POSIX-shell-quoted before being interpolated into a remote command, so they cannot break out into arbitrary command execution.
At confirm time, the arguments of the confirming call are cross-checked against the plan-time arguments captured in the token: if they differ, the tool refuses and asks you to re-run for a fresh plan (so a stale token can never execute a differently-argued action).
Configuration
The server reads a JSON config from ~/.ugnas-mcp/config.json (override with the
UGNAS_MCP_CONFIG environment variable). See config.example.json.
{
"name": "home-nas",
"host": "192.168.1.50",
"port": 22,
"username": "admin",
"auth": { "type": "key", "privateKeyPath": "~/.ssh/id_ed25519" },
"defaultShare": "/volume1",
"commandTimeoutMs": 60000
}Field | Required | Notes |
| yes | IP or hostname of the NAS. |
| no | SSH port, default |
| yes | SSH user. |
| yes |
|
| no | Base directory for relative tool paths, default |
| no | The directory the SFTP subsystem is rooted at. On UGOS, SFTP is chrooted to the share root, so an exec path like |
| no | When set, the SSH host key is pinned and enforced (e.g. |
| no | Per-command timeout, default |
Environment-variable overrides
Useful for CI or secret injection. Env values win over the file:
UGNAS_HOST=192.168.1.50
UGNAS_PORT=22
UGNAS_USER=admin
UGNAS_KEY_PATH=~/.ssh/id_ed25519 # or UGNAS_AUTH_TYPE=password + UGNAS_PASSWORD
UGNAS_DEFAULT_SHARE=/volume1
UGNAS_HOST_KEY_SHA256=SHA256:...Relative vs absolute paths
File/backup tools accept either. An absolute path is used as-is; a relative path is joined onto
defaultShare:
files.list("media") -> /volume1/media
files.list("/mnt/x") -> /mnt/xInstall & run
Published on npm as ugnas-mcp. Run it directly —
no clone, no build:
npx ugnas-mcp
# or install it once:
npm install -g ugnas-mcp
ugnas-mcpThat starts the stdio MCP server. It reads its config from ~/.ugnas-mcp/config.json
(or UGNAS_MCP_CONFIG / UGNAS_* env vars — see Configuration).
Wiring it into an MCP client
Point your client at the official package (stdio):
{
"mcpServers": {
"ugnas": {
"command": "npx",
"args": ["-y", "ugnas-mcp"],
"env": { "UGNAS_MCP_CONFIG": "/absolute/path/to/config.json" }
}
}
}Or, if you installed it globally, "command": "ugnas-mcp" with no args.
Optional HTTP transport
The server is stdio by default. Set UGNAS_HTTP_PORT to also expose a streamable HTTP
transport (both run side by side):
UGNAS_HTTP_HOST=127.0.0.1 UGNAS_HTTP_PORT=4110 ugnas-mcpPOST http://127.0.0.1:4110/mcp— JSON-RPC (stateless; a fresh session per request, max 1 MiB body).GET http://127.0.0.1:4110/health— liveness + target host.
It binds to loopback by default. UGNAS_HTTP_HOST=0.0.0.0 (or any non-loopback address) is refused
unless UGNAS_HTTP_ALLOW_REMOTE=1 is also set — the /mcp endpoint has no authentication, and
confirmation tokens are process-wide, so only opt in if the port is secured by something else
(reverse proxy with auth, VPN, etc.).
Prerequisites on the NAS
SSH enabled (UGOS: Control Panel → Terminal & SNMP).
The SSH user can run
docker(be in thedockergroup) and, for scheduled backups, usecrontab.tar,df,du,ip,ssare present on UGOS — these are standard.backup.schedulejob names must be plain words ([A-Za-z0-9._-]) — they are embedded in a generated shell script and a crontab line, so anything else is rejected up front.rsyncis optional, used only byfiles.sync. If it's missing you get a note explaining how to install it or how to enable the built-incpfallback (files.sync { fallback: "cp" }); every other file tool works without rsync.
License
MIT — see LICENSE. Contributing, architecture, and the dev/release toolchain
live in DEVELOPMENT.md.
This server cannot be deployed
Maintenance
Related MCP Connectors
- emisarOAuthdev.emisar
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Securely control computers you explicitly pair through files, terminals, processes, screenshots, desktop UI/input, clipboard, browser automation, diagnostics, and document tools.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Scoped, audited SSH exec, sessions, and SFTP on your saved servers without exposing credentials
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceProvides read-only server monitoring and diagnostic tools for AI assistants to manage Linux and Unraid systems via SSH. It enables natural language interactions for container management, storage health checks, and system log analysis while keeping credentials secure.17ISC
- FlicenseBqualityCmaintenanceEnables AI assistants to monitor and manage OpenMediaVault NAS systems by providing access to storage, network shares, user accounts, and system services. It supports OMV 5 and 6 via the JSON-RPC API for comprehensive hardware and configuration oversight through natural language.393-
- AlicenseNot gradedqualityBmaintenanceProvides comprehensive management of TrueNAS SCALE instances through 278 actions across 18 categories using a token-efficient hierarchical tool design. Users can perform tasks like storage management, service configuration, and system monitoring while benefiting from built-in safety confirmations and read-only dashboard resources.38 npm7MIT
- FlicenseAqualityDmaintenanceGives AI assistants full control over a VPS via SSH, enabling command execution, file management, service control, Docker and firewall management.96-