Giving AI Access to Your NAS: Building a QNAP MCP Server for Disk Health & Backup Audits

Giving AI Access to Your NAS with QNAP MCP Server

QNAP QTS is a powerful operating system for enterprise and homelab storage, but navigating the web interface just to check drive health, QuLog alerts, or HBS3 replication jobs can be slow and tedious.

In this post, I detail how we built and deployed mcp-qnap—a FastMCP microservice listening on port 8442 that allows Antigravity to perform deep diagnostics, SMART disk inspections, and shared folder ACL audits directly from the prompt.

The Architecture: FastMCP on QTS

We interface with QNAP’s underlying QTS management API using Python and FastMCP. The service exposes read-only endpoints secured with Bearer token authentication:

  • Endpoint: http://10.10.30.25:8442/mcp
  • Transport: HTTP JSON-RPC
  • Auth: Pre-shared API Key in Authorization: Bearer <token>

What the AI Can Inspect

Our mcp-qnap server registers 25 granular inspection tools:

1. Storage & SMART Telemetry

  • list_disks / list_storages: Checks NVMe and HDD SMART temperatures, reallocated sector counts, and pool capacity.
  • get_pool_usage_history / get_qts_volume_usage_history: Identifies capacity growth trends.

2. Access Control & Shared Folders

  • list_shared_folder / get_shared_folder_permission_acl: Audits SMB/NFS permissions and subfolder ACL inheritance.
  • verify_shared_folder_permission: Verifies whether user wojcieh or service account kopia has write access without guessing.

3. System Load & Security

  • query_top_processes / query_load_avg: Diagnoses CPU/RAM spikes without SSH logins.
  • get_securitycenter_report / get_qvr_logs: Scans for failed login attempts and firewall blocks.

Real-World Example: Automating 3-2-1 Backup Verification

When verifying our automated Kopia backups to QNAP NFS:

1
2
3
4
5
6
7
8
9
User: "Antigravity, audit my QNAP backup storage pool before we trigger the weekly offsite sync."

Agent:
1. Calls mcp_qnap_list_disks: All 4 WD Red Pro drives healthy, max temp 36°C, 0 bad sectors.
2. Calls mcp_qnap_get_shared_folder(folder="Kopia-Backups"): 2.4 TB used, 4.1 TB free.
3. Calls mcp_qnap_verify_shared_folder_permission(user="kopia-svc", folder="Kopia-Backups"): Write Access: OK.

Agent Response:
"Storage Pool 1 is healthy (all drives nominal at 36°C). The Kopia-Backups share has 4.1 TB available space with correct POSIX write permissions. Ready for offsite sync."

By connecting your NAS via MCP, your AI assistant becomes a proactive storage reliability engineer.

Written from personal dictation & experience, edited with AI pair-programming tools.
Built with Hugo
Theme Stack designed by Jimmy