Skip to main content
Glama

mcp-server-omv

CI

An MCP server for OpenMediaVault (OMV) 7 and 8. It runs omv-rpc on the NAS over SSH, so an MCP client such as Claude can read storage health, list shares, and stage changes that you review and apply. There is no web-UI scraping and no agent on the NAS: the only thing it can run there is omv-rpc.

Status: scaffold. The server starts and answers omv_get_status, and nothing more yet. The SSH runner and the call policy are in; the NAS tools are being added one task at a time (see docs/plans/v1.md). Nothing has been run against a real NAS: every detail of how OMV answers omv-rpc is a named assumption (see Verification status).

Not affiliated with the OpenMediaVault project.

Design

  • Two phases. OMV stages configuration changes and applies them separately, and so does this server: write tools stage, a person reviews the pending changes, and a separate tool applies them.

  • Writes are off by default. OMV_ALLOW_WRITES=1 turns the write tier on.

  • One narrow transport. The only remote command the server will build is an omv-rpc call. There is no shell tool, no file transfer, and no port forwarding.

Related MCP server: omv-mcp

Install

Not on PyPI yet. From source:

git clone https://github.com/SDNick484/mcp-server-omv.git && cd mcp-server-omv
python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev]" && pytest

Requires Python 3.11+ and an OpenSSH client (ssh) on the machine that runs the server.

First contact

mcp-server-omv --version
mcp-server-omv call omv_get_status

With no NAS configured the status tool still answers, and says what to set.

Use it with an MCP client

Local (stdio): Claude Code and Claude Desktop launch it themselves. For Claude Code: claude mcp add omv -- mcp-server-omv (use the full path to the venv's mcp-server-omv). In Claude Desktop's claude_desktop_config.json:

{
  "mcpServers": {
    "omv": {
      "command": "/path/to/venv/bin/mcp-server-omv",
      "env": { "OMV_HOST": "nas.example.com", "OMV_SSH_KEY": "/path/to/key" }
    }
  }
}

As a service (Streamable HTTP), to share one instance between clients through a Cloudflare Tunnel with Cloudflare Access in front:

CF_ACCESS_TEAM_DOMAIN=<team>.cloudflareaccess.com CF_ACCESS_AUD=<aud tag> \
  mcp-server-omv serve --http --public-host mcp.example.com     # 127.0.0.1:8719/omv/mcp

GET /healthz and GET /omv/mcp/healthz answer 200 while the process is up. Every other request must carry a valid Access JWT (Cf-Access-Jwt-Assertion); the checks and the flags are documented in src/omv_mcp/remote.py.

On Alpine (a Proxmox LXC, say), deploy/alpine/install.sh installs it as an OpenRC service on port 8719, with its settings in /etc/mcp-server-omv/env and its SSH key and known_hosts in /var/lib/mcp-server-omv. Re-running it upgrades the code and keeps all of those. The file's header has the layout.

Configuration

Environment variables beat config.json in OMV_CONFIG_DIR (default $XDG_CONFIG_HOME/mcp-server-omv). A key in config.json is the variable's name without OMV_, in lower case (ssh_user). A bad value is reported by omv_get_status and the default is used.

Setting

Default

What it does

OMV_HOST

none

NAS host name or address. Without it the server starts and every tool says what to set

OMV_SSH_USER

omv-mcp

SSH login user on the NAS

OMV_SSH_PORT

22

SSH port

OMV_SSH_KEY

none

Private key file; without it ssh uses its own defaults

OMV_SSH_KNOWN_HOSTS

none

known_hosts file the SSH client reads and writes (passed as -o UserKnownHostsFile=); without it ssh uses ~/.ssh/known_hosts. The Alpine service sets it to a file in its state directory

OMV_SUDO

1

Run omv-rpc through sudo -n; 0 is for a user in the openmediavault-engined group

OMV_TIMEOUT

60

Seconds per RPC call, 1 to 170 (OMV's own socket timeout is 180 s)

OMV_ALLOW_WRITES

0

1 enables the write tier. Off by default

OMV_DRY_RUN

0

Write tools report what they would send and send nothing (serve --dry-run too)

OMV_LOG_UNREDACTED

0

Skip address masking in logs (--no-redact); secrets are still masked

OMV_CONFIG_DIR itself is read from the environment only. For serve --http, MCP_ALLOWED_SERVICE_TOKENS and MCP_AUTOMATION_TIERS come from the shared remote.py (what each caller may do).

Tools

Tool

What it does

omv_get_status

Start here: whether a NAS is configured and reachable, its OpenMediaVault version, host name, uptime, load, memory, pending changes, reboot and update counts, which plugins and optional services it has, whether writes and dry run are on, and configuration problems

omv_list_services

The NAS's services (SMB, NFS, SSH, the rsync server, and the rest) with enabled and running; name one (ssh, smb, nfs, rsyncd) for its key settings, from a fixed allow-list that never includes free-text options or secrets

omv_list_updates

The upgradable packages with their installed and candidate versions, and the count, as of the NAS's last package index refresh. Read only: it neither refreshes the index nor installs anything

omv_list_shared_folders

The shared folders: name, filesystem, relative and absolute path, comment, and the SMB and NFS shares that reference each one

omv_list_shares

The SMB and NFS shares with the settings that decide who can reach them (enabled, guest access, read-only, browseable, NFS client and options), and whether each service is installed and enabled; an absent or disabled service is stated, not an error

omv_list_disks

The physical disks: model, size, serial (masked unless asked), temperature, and SMART's overall verdict

omv_get_disk_health

One disk's SMART information, attributes, and self-test log, with the concerns in plain sentences; refuses a device the disk list does not have

omv_list_filesystems

Filesystems with label, type, mount point, size, used, available, percent, and mounted; an external drive shows up here with its usage

omv_list_raid_arrays

Software RAID arrays with level, size, state, and members; says available: false and why when the md plugin is not installed

omv_start_job

Start a background job on the NAS and follow it: refresh_updates (the package index, works with writes off) or smart_test (one of the NAS's scheduled SMART self-tests, chosen by disk and type; needs writes on). Returns a job id; at most 4 jobs at once, one per kind and target

omv_get_job

A job's state (running, succeeded, failed, stopped, or lost) and its last 200 output lines, or every job this server run started

omv_stop_job

Stop a running job (SIGTERM on the NAS) and keep its last output

Who may call what

Every tool has an authorization tier. People (an Access login, or stdio) may use all of them; an Access service token, if you admit one, gets only MCP_AUTOMATION_TIERS. The tiers are read, everyday, and costly (costly asks the person to confirm).

Tool

Tier

omv_get_status

read

omv_list_services

read

omv_list_updates

read

omv_list_shared_folders

read

omv_list_shares

read

omv_list_disks

read

omv_get_disk_health

read

omv_list_filesystems

read

omv_list_raid_arrays

read

omv_start_job

everyday

omv_get_job

read

omv_stop_job

everyday

Safety design

What exists now: writes are off by default, a malformed OMV_HOST or account name is refused before anything could use it, and the HTTP transport checks the Cloudflare Access assertion on every request.

  • One remote command. The runner (runner.py) can only build sudo -n /usr/sbin/omv-rpc -u admin <service> <method> <params>, every part quoted, with service and method names of letters and digits only. It runs the system ssh without a local shell, with stdin closed, and with forwarding, agent, X11, and TTY requests off. One call at a time, each under OMV_TIMEOUT.

  • A call policy in front of it. Every call goes through policy.py, and the runner accepts only what the policy allowed. Reads are allowed; anything else, including a method the policy does not know, is a write and needs OMV_ALLOW_WRITES=1. A deny list refuses, in every mode, what v1 does not offer (commands, packages, accounts and keys, destroying data, taking the NAS offline, extraoptions) and reads that return secrets.

The NAS-side account setup, and what that account does and does not limit, are written up with the tools that use it.

Troubleshooting

omv_get_status (or mcp-server-omv call omv_get_status) lists configuration problems, one sentence each, and says why the NAS could not be reached. mcp-server-omv check is first contact in one line; mcp-server-omv doctor checks each layer (settings, ssh and sudo, version, plugins, services) and says which one failed.

Development

pip install -e ".[dev]"
pytest -q           # no NAS needed: tests never touch the network
ruff check . && ruff format --check . && mypy
python scripts/sync_shared.py --check

What the tests cover:

File

Covers

test_tools.py

The MCP contract the model sees: tool names, titles, annotations, tiers, schemas

test_config.py

Settings sources and order, bad values, and that the table above matches the code's defaults

test_cli.py

--version, call, and the serve --http defaults

test_stdio.py

The console script over stdio with no NAS configured

test_assumptions.py

Every assumption appears in the README table and in HARDWARE_VALIDATION.md

test_deploy.py

The Alpine service files are OpenRC, the settings template holds placeholders only, and release.yml triggers only on a v* tag

test_runner.py

The ssh argv and remote command against a stub ssh (hostile names and params), each failure's message, timeout, one call at a time, and the test fixtures

test_policy.py

Every rule and deny group of the call policy, and that no refused call reaches the runner

test_status.py

omv_get_status for OMV 7 and 8, an unreachable NAS, an unsupported major, capability detection from the plugin list and probes, the client's cache, list_all, and byte sizes

test_storage.py

The four storage tools for OMV 7 and 8: the disk and SMART join, masked serials, disk health and its refusal of an unlisted device, filesystems including the external drive, RAID with and without the md plugin, and that no write method is called

test_doctor.py

check and doctor, the /healthz check, and that doctor --dump scrubs addresses, keys, serial numbers, and e-mail addresses

test_services.py

omv_list_services and omv_list_updates for OMV 7 and 8: the service rows, the settings allow-lists (free text and secrets never appear), the refusals, and that nothing is refreshed or installed

test_shares.py

omv_list_shared_folders and omv_list_shares for OMV 7 and 8, absent and disabled services, NAS text kept as data, and the folder and filesystem lookups the write side reuses

test_jobs.py

Background jobs from start to succeeded, failed, stopped, or lost through scripted Exec.getOutput answers (never Exec.isRunning), the status filename pattern, smart_test and refresh_updates refusals, the limits, run_job for other modules, and a bounded shutdown

The shared modules and their tests (remote.py, logsafe.py, tasks.py, ratelimit.py, registry.py, lookup.py, tools.py, feedback.py) come from mcp-server-shared and are not edited here.

Verification status

These are the OpenMediaVault details the code depends on (claim, source, and for verified ones the evidence, in src/omv_mcp/assumptions.py). hardware-verified means seen working on a real NAS; hardware-contradicted means a real NAS did something else; the rest are read in the OMV source only.

Assumption

Confidence

Status

O-RPC-CLI

medium

simulator-only

O-RPC-ERROR

medium

simulator-only

O-SUDO

medium

simulator-only

O-INFO-FIELDS

medium

simulator-only

O-VERSION-STRING

medium

simulator-only

O-PLUGIN-LIST

medium

simulator-only

O-404-MISSING

medium

simulator-only

O-SERVICES-STATUS

medium

simulator-only

O-APT-LIST

low

simulator-only

O-SHARE-FIELDS

medium

simulator-only

O-SMB-LIST

medium

simulator-only

O-NFS-LIST

medium

simulator-only

O-DISK-FIELDS

low

simulator-only

O-SMART-FIELDS

low

simulator-only

O-FS-FIELDS

medium

simulator-only

O-MD-PLUGIN

medium

simulator-only

O-BG-FILENAME

medium

simulator-only

O-EXEC-OUTPUT

medium

simulator-only

O-EXEC-DELETES

medium

simulator-only

O-EXEC-STOP

low

simulator-only

O-APT-UPDATE

medium

simulator-only

O-SMART-EXECUTE

medium

simulator-only

test_assumptions.py fails if this table and assumptions.py disagree.

Roadmap

  • Storage health, shares, two-phase changes, services and updates, and background jobs

  • Validate on hardware (HARDWARE_VALIDATION.md)

License

MIT. See LICENSE.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Exposes tools to manage and inspect an OpenMediaVault NAS, running on the NAS and communicating over SSH with any MCP-capable coding harness.
      48
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      An MCP server that lets AI assistants manage an OpenMediaVault NAS over SSH using OMV's own RPC interface, covering disks, filesystems, shares, users, S.M.A.R.T. health, services, and configuration changes. It exposes a small set of generic tools to discover and call RPC methods, plus optional shell access.
      6
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP clients to inspect and manage an OpenMediaVault host and its Debian system, Docker Compose stacks, containers, images, volumes, networks, and other OMV plugins through the official RPC API. It starts read-only and lets administrators opt into sensitive, write, and destructive operations through environment tiers.
      MIT