Labsco
atom2ueki logo

Synology MCP Server

β˜… 132

from atom2ueki

Manage files and downloads on Synology NAS devices using an AI assistant.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

πŸ’Ύ Synology MCP Server

A Model Context Protocol (MCP) server for Synology NAS devices. Enables AI assistants to manage files and downloads through secure authentication and session management.

🌟 NEW: Unified server supports both Claude/Cursor (stdio) and Xiaozhi (WebSocket) simultaneously!

🌟 Xiaozhi Integration

New unified architecture supports both clients simultaneously!

How It Works

  • ENABLE_XIAOZHI=false (default): Standard MCP server for Claude/Cursor via stdio

  • ENABLE_XIAOZHI=true: Multi-client bridge supporting both:

  • πŸ“‘ Xiaozhi: WebSocket connection

  • πŸ’» Claude/Cursor: stdio connection

Setup Steps

  • Add to your .env file:
Copy & paste β€” that's it
ENABLE_XIAOZHI=true
XIAOZHI_TOKEN=your_xiaozhi_token_here
  • Run normally:
Copy & paste β€” that's it
# Same command, different behavior based on environment
python main.py
# OR
docker-compose up

Key Features

  • βœ… Zero Configuration Conflicts: One server, multiple clients

  • βœ… Parallel Operation: Both clients can work simultaneously

  • βœ… All Tools Available: Xiaozhi gets access to all Synology MCP tools

  • βœ… Backward Compatible: Existing setups work unchanged

  • βœ… Auto-Reconnection: Handles WebSocket connection drops

  • βœ… Environment Controlled: Simple boolean flag to enable/disable

Startup Messages

Claude/Cursor only mode:

Copy & paste β€” that's it
πŸš€ Synology MCP Server
==============================
πŸ“Œ Claude/Cursor only mode (ENABLE_XIAOZHI=false)

Both clients mode:

Copy & paste β€” that's it
πŸš€ Synology MCP Server with Xiaozhi Bridge
==================================================
🌟 Supports BOTH Xiaozhi and Claude/Cursor simultaneously!

πŸ› οΈ Available MCP Tools

πŸ” Authentication

  • synology_status - Check authentication status and active sessions

  • synology_list_nas - List all configured NAS units from settings.json

  • synology_login - Authenticate with Synology NAS (conditional)

  • synology_logout - Logout from session (conditional)

πŸ“ File System Operations

  • list_shares - List all available NAS shares

  • list_directory - List directory contents with metadata

  • path (required): Directory path starting with /

  • get_file_info - Get detailed file/directory information

  • path (required): File path starting with /

  • search_files - Search files matching pattern

  • path (required): Search directory

  • pattern (required): Search pattern (e.g., *.pdf)

  • create_file - Create new files with content

  • path (required): Full file path starting with /

  • content (optional): File content (default: empty string)

  • overwrite (optional): Overwrite existing files (default: false)

  • create_directory - Create new directories

  • folder_path (required): Parent directory path starting with /

  • name (required): New directory name

  • force_parent (optional): Create parent directories if needed (default: false)

  • delete - Delete files or directories (auto-detects type)

  • path (required): File/directory path starting with /

  • rename_file - Rename files or directories

  • path (required): Current file path

  • new_name (required): New filename

  • move_file - Move files to new location

  • source_path (required): Source file path

  • destination_path (required): Destination path

  • overwrite (optional): Overwrite existing files

πŸ“₯ Download Station Management

  • ds_get_info - Get Download Station information

  • ds_list_tasks - List all download tasks with status

  • offset (optional): Pagination offset

  • limit (optional): Max tasks to return

  • ds_create_task - Create new download task

  • uri (required): Download URL or magnet link

  • destination (optional): Download folder path

  • ds_pause_tasks - Pause download tasks

  • task_ids (required): Array of task IDs

  • ds_resume_tasks - Resume paused tasks

  • task_ids (required): Array of task IDs

  • ds_delete_tasks - Delete download tasks

  • task_ids (required): Array of task IDs

  • force_complete (optional): Force delete completed

  • ds_get_statistics - Get download/upload statistics

πŸ₯ Health Monitoring

  • synology_system_info - Get system model, serial, DSM version, uptime, temperature

  • synology_utilization - Get real-time CPU, memory, swap, and disk I/O utilization

  • synology_disk_health - List all physical disks with SMART status, model, temp, size

  • synology_disk_smart - Get detailed SMART attributes for a specific disk

  • synology_volume_status - List all volumes with status, size, usage, filesystem type

  • synology_storage_pool - List RAID/storage pools with level, status, member disks

  • synology_network - Get network interface status and transfer rates

  • synology_ups - Get UPS status, battery level, power readings

  • synology_services - List installed packages and their running status

  • synology_system_log - Get recent system log entries

  • synology_health_summary - Aggregate system info, utilization, disk health, and volume status

🐳 Container Manager

  • synology_container_list - List Container Manager containers

  • offset (optional): Pagination offset

  • limit (optional): Maximum containers to return

  • container_type (optional): Container filter (default: all)

  • synology_container_get - Get a Container Manager container

  • name (required): Container name

  • synology_container_start - Start a Container Manager container

  • name (required): Container name

  • synology_container_stop - Stop a Container Manager container

  • name (required): Container name

  • synology_container_restart - Restart a Container Manager container

  • name (required): Container name

  • synology_container_delete - Delete a Container Manager container

  • name (required): Container name

  • force (optional): Force deletion (default: false)

  • preserve_profile (optional): Preserve Synology container profile (default: true)

  • synology_container_logs - Get Container Manager container logs

  • name (required): Container name

  • since (optional): Log start time/filter

  • offset (optional): Pagination offset (default: 0)

  • limit (optional): Maximum log lines to return (default: 1000)

  • synology_container_resource - Get real-time resource usage for a Container Manager container

  • name (required): Container name

  • synology_container_project_list - List Container Manager projects

  • synology_container_project_get - Get a Container Manager project

  • name (required): Project name

  • synology_container_project_create - Create a Container Manager project

  • name (required): Project name

  • share_path (required): Project folder path on the NAS

  • content (required): Docker Compose YAML content

  • enable_service_portal (optional): Enable Synology service portal (default: false)

  • service_portal_name (optional): Service portal name

  • service_portal_port (optional): Service portal port

  • service_portal_protocol (optional): Service portal protocol (default: http)

  • synology_container_project_update - Update a Container Manager project

  • name (required): Project name

  • content (required): Docker Compose YAML content

  • enable_service_portal (optional): Enable Synology service portal

  • service_portal_name (optional): Service portal name

  • service_portal_port (optional): Service portal port

  • service_portal_protocol (optional): Service portal protocol

  • synology_container_project_start - Start a Container Manager project

  • name (required): Project name

  • synology_container_project_stop - Stop a Container Manager project

  • name (required): Project name

  • synology_container_project_restart - Restart a Container Manager project

  • name (required): Project name

  • synology_container_project_build - Build a Container Manager project

  • name (required): Project name

  • synology_container_project_clean - Clean a Container Manager project

  • name (required): Project name

  • synology_container_project_delete - Delete a Container Manager project

  • name (required): Project name

  • synology_container_image_list - List Container Manager images

  • offset (optional): Pagination offset

  • limit (optional): Maximum images to return

  • show_dsm (optional): Include DSM images (default: false)

  • synology_container_image_get - Get a Container Manager image

  • name (required): Image repository name

  • tag (optional): Image tag (default: latest)

  • synology_container_image_delete - Delete a Container Manager image

  • name (required): Image repository name

  • tag (optional): Image tag (default: latest)

  • synology_container_image_pull - Pull a Container Manager image

  • repository (required): Image repository name

  • tag (optional): Image tag (default: latest)

  • synology_container_registry_list - List Container Manager registries

  • synology_container_registry_search - Search Container Manager registries

  • query (required): Image search query

  • offset (optional): Pagination offset

  • limit (optional): Maximum results to return

  • synology_container_registry_tags - List tags for a registry image

  • repository (required): Image repository name

  • offset (optional): Pagination offset

  • limit (optional): Maximum tags to return

  • synology_container_registry_download - Download a registry image

  • repository (required): Image repository name

  • tag (optional): Image tag (default: latest)

  • synology_container_network_list - List Container Manager networks

  • synology_container_network_get - Get a Container Manager network

  • name (required): Network name

  • synology_container_network_create - Create a Container Manager network

  • name (required): Network name

  • driver (optional): Network driver (default: bridge)

  • subnet (optional): Subnet CIDR

  • gateway (optional): Gateway IP

  • ip_range (optional): Allocatable IP range CIDR

  • enable_ipv6 (optional): Enable IPv6 (default: false)

  • synology_container_network_delete - Delete a Container Manager network

  • name (required): Network name

πŸ“¦ NFS Management

  • synology_nfs_status - Get NFS service status and configuration

  • synology_nfs_enable - Enable or disable the NFS service

  • synology_nfs_list_shares - List all shared folders with their NFS permissions

  • synology_nfs_set_permission - Set NFS client access permissions on a shared folder

🧠 Claude Code / Claude.ai Skill

For Claude Code, Claude Desktop, and claude.ai users, this repo ships an Anthropic Agent Skill that teaches Claude how to use the MCP tools effectively β€” picking the right tool, targeting the right NAS in multi-NAS setups, preferring aggregate health checks over fan-out calls, and using correct path conventions.

The skill lives at skills/synology-nas/ and uses progressive disclosure across seven domains (auth, files, downloads, health, containers, shares/NFS, user management).

Install:

  • Claude Code: copy or symlink the folder into ~/.claude/skills/synology-nas/

  • Claude.ai / Claude Desktop: upload the synology-nas/ folder via the Skills settings page

The skill is purely additive β€” it works alongside the MCP and only triggers on Synology/NAS-related prompts.

✨ Features

  • βœ… Unified Entry Point - Single main.py supports both stdio and WebSocket clients

  • βœ… Environment Controlled - Switch modes via ENABLE_XIAOZHI environment variable

  • βœ… Multi-Client Support - Simultaneous Claude/Cursor + Xiaozhi access

  • βœ… Secure Authentication - RSA encrypted password transmission

  • βœ… Session Management - Persistent sessions across multiple NAS devices

  • βœ… Complete File Operations - Create, delete, list, search, rename, move files with detailed metadata

  • βœ… Directory Management - Recursive directory operations with safety checks

  • βœ… Download Station - Complete torrent and download management

  • βœ… Docker Support - Easy containerized deployment

  • βœ… Backward Compatible - Existing configurations work unchanged

  • βœ… Error Handling - Comprehensive error reporting and recovery

πŸ—οΈ Architecture

File Structure

Copy & paste β€” that's it
mcp-server-synology/
β”œβ”€β”€ main.py # 🎯 Unified entry point
β”œβ”€β”€ src/
β”‚ β”œβ”€β”€ mcp_server.py # Standard MCP server
β”‚ β”œβ”€β”€ multiclient_bridge.py # Multi-client bridge
β”‚ β”œβ”€β”€ auth/ # Authentication modules
β”‚ β”œβ”€β”€ filestation/ # File operations
β”‚ └── downloadstation/ # Download management
β”œβ”€β”€ docker-compose.yml # Single service, environment-controlled
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ requirements.txt
└── .env # Configuration

Mode Selection

  • ENABLE_XIAOZHI=false β†’ main.py β†’ mcp_server.py (stdio only)

  • ENABLE_XIAOZHI=true β†’ main.py β†’ multiclient_bridge.py β†’ mcp_server.py (both clients)

Perfect for any workflow - from simple Claude/Cursor usage to advanced multi-client setups! πŸš€